Hey

Cor Hofman wrote:
> When looking at the client code doing the login and
> creating the Session bean seem two completely disjoint
> operations. How does the server know that a login
> applies to a session bean I created? The articel suggests
> that the code to execute basically boils down to the following
> (all details are excluded, like setting up the handler as well
> as the try and catch mechanism):
> 
> //
> //      Do the login
> //
> LoginContext lc            = new LoginContext("TestClient", handler);
> lc.login();
> //
> //      Create the bean
> //
> InitialContext jndiContext = new InitialContext();
> StatelessSessionHome home  = (StatelessSessionHome)
> jndiContext.lookup("StatelessSession");
> StatelessSession bean      = home.create();
> 
> How does the StatelessSession bean called "bean" get
> associated with the login()?

The login information is associated with the current thread (or the
entire JVM; same principle though). When you call a bean this
information is used for authentication by the bean's stub object ("bean"
above).

It's that simple :-)

regards,
  Rickard

-- 
Rickard Öberg
Email: [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to