How does a client find and connect to a specific# Java - 爪哇娇娃
w*k
1 楼
A client accesses an Enterprise JavaBean by looking up the class
implementing its home interface by name through JNDI. It then uses
methods of the home interface to acquire access to an instance of the class
implementing the remote interface.
Context initialContext = new InitialContext()
AccountHome accountHome =
javax.rmi.PortableRemoteObject.narrow(
initialContext.lookup("applications/bank/accounts"),
Ac
implementing its home interface by name through JNDI. It then uses
methods of the home interface to acquire access to an instance of the class
implementing the remote interface.
Context initialContext = new InitialContext()
AccountHome accountHome =
javax.rmi.PortableRemoteObject.narrow(
initialContext.lookup("applications/bank/accounts"),
Ac