|
How to Look up Object in Distributable Name Space |
|
|
This tip shows the way to look up Object in Distributed Name Space:
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
props.put("java.naming.provider.url", "iiop://192.168.0.22:2215");
Context c = new InitialContext(props);
Object o = c.lookup("ejb/BankMgr");
BankMgrHome bankMgrHome = (BankMgrHome)PortableRemoteObject.narrow(o, BankMgrHome.class);
|
Where Bankmgr is JNDI name of An EJB and BankmgrHome is Component Home Interface of BankMgr EJB.
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.