I am trying to implement a standalone client application that is able to login to multiple JBoss 3.0 servers using JBossSX. The logins must be active concurrently and the desired scenario would be to create a LoginContext for each server prior to getting the InitialContext and to switch between them as EJB calls are made to a paricular server. Obviously it would not be very convenient or efficient to create a new LoginContext and recreate the IntialContext prior to each EJB call.
I have not tried coding any this yet and I still have a basic mystery around the magic of how the LoginContext and the IntialContext relate, and how the Subject ultimately gets passed over to the serverside during the EJB call.
One solution I have considered is to cache the JASS particulars with calls such as:
when I intially create the connection to a particular server and to reinstate them before each EJB call to that particular server. This approach seems a littler heavy handed and I am not even certian yet that it will produce the desired effect.