1 |
Context initialContext = new InitialContext();
|
2 |
CartHome cartHome = (CartHome)
|
3 |
initialContext.lookup
|
4 |
("applications/mall/shopping-carts");
|
5 |
Client-side code may be written in Java in an applet, application or servlet, or in a C++ application using CORBA.
|
6 |
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.
|