Context initialContext = new InitialContext();
|
CartHome cartHome = (CartHome)
|
initialContext.lookup
|
("applications/mall/shopping-carts");
|
Client-side code may be written in Java in an applet, application or servlet, or in a C++ application using CORBA.
|
Getting the home of the remote bean:
-
InitialContext gets the root of the JNDI naming hierarchy
-
lookup method gets the instance of CartHome wanted (from a known JNDI path).
-
The actual container and server are transparent to the user - a container can be on several servers.
|