View RSS Feed

My Java Tips

JNDI lookup with a corbaname URL

Rate this Entry
by , 11-01-2011 at 06:09 PM (1439 Views)
A corbaname can be useful at times as a lookup name. If, for example, the target object is not a member of the federated name space and cannot be located with a qualifiied name, a corbaname can be a convenient way to look up the object.


A lookup with a corbaname URL follows.

Java Code:
// Get the initial context as shown in a previous example.
...
// Look up the home interface using a corbaname URL.
try {
   java.lang.Object ejbHome = initialContext.lookup(
      "corbaname:iiop:someHost:2809#com/mycompany/accounting/AccountEJB");
   accountHome =
      (AccountHome)javax.rmi.PortableRemoteObject.narrow(ejbHome, AccountHome.class);
}
catch (NamingException e) { // Error getting the home interface
   ...
}

Submit "JNDI lookup with a corbaname URL" to Facebook Submit "JNDI lookup with a corbaname URL" to Digg Submit "JNDI lookup with a corbaname URL" to del.icio.us Submit "JNDI lookup with a corbaname URL" to StumbleUpon Submit "JNDI lookup with a corbaname URL" to Google

Tags: None Add / Edit Tags
Categories
JBoss

Comments