Monday, November 05, 2007

Example: Getting an initial context by setting the provider URL property

You can use two different provider URL forms with WebSphere Application Server's initial context factory:

  • A CORBA object URL (new for J2EE 1.3)
  • An IIOP URL

Using a CORBA object URL

env.put(Context.PROVIDER_URL, "corbaloc:iiop:myhost.mycompany.com:2809");

Using a CORBA object URL with multiple name server addresses

env.put(Context.PROVIDER_URL,
"corbaloc::myhost1:9810,:myhost1:9811,:myhost2:9810");

Using a CORBA object URL from an non-WebSphere Application Server JNDI implementation

env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.somecompany.naming.TheirInitialContextFactory");
env.put(Context.PROVIDER_URL,
"corbaname:iiop:myhost.mycompany.com:9810/NameServiceServerRoot");

Using an IIOP URL

env.put(Context.PROVIDER_URL, "iiop://myhost.mycompany.com:2809");

ref


No comments: