BEA Logo BEA WebLogic Enterprise Release 5.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Enterprise Doc Home   |   Programming Topics   |   Previous Topic   |   Next Topic   |   Contents   |   Index

CORBA ORB

 

This chapter supplements the information in package org.omg.CORBA by providing information on the following topics:

 


Initializing the ORB

[This section is reprinted from the package information for org.omg.CORBA, as published by Sun Microsystems, Inc. for the JDK 1.2.]

An application or applet gains access to the CORBA environment by initializing itself into an ORB using one of three init methods. Two of the three methods use the properties (associations of a name with a value) shown in the following table:

Property Name

Property Value

org.omg.CORBA.ORBClass

Class name of an ORB implementation

org.omg.CORBA.ORBSingletonClass

Class name of the ORB returned by init()

These properties allow a different vendor's ORB implementation to be "plugged in."

When an ORB instance is being created, the class name of the ORB implementation is located using the following standard search order:

  1. Check in Applet parameter or application string array, if any.

  2. Check in properties parameter, if any.

  3. Check in the System properties (currently applications only).

  4. Fall back on a hardcoded default behavior (use the Java IDL implementation).

Note that the BEA WebLogic Enterprise ORB provides a default implementation for the fully functional ORB and for the Singleton ORB. When the init method is given no parameters, the default Singleton ORB is returned. When the init method is given parameters but no ORB class is specified, the Java IDL ORB implementation is returned.

The following code fragment creates an ORB object initialized with the default ORB Singleton. This ORB has a restricted implementation to prevent malicious applets from doing anything beyond creating typecodes. It is called a Singleton because there is only one instance for an entire virtual machine.

ORB orb = ORB.init();

The following code fragment creates an ORB object and a Singleton ORB object for an application.

Properties p = new Properties();
p.put("org.omg.CORBA.ORBClass", "com.sun.CORBA.iiop.ORB");
p.put("org.omg.CORBA.ORBSingletonClass","com.sun.CORBA.idl.ORBSingleton");
System.setProperties(p);
ORB orb = ORB.init(args, p);

In the preceding code fragment, note the following:

The following code fragment creates an ORB object for the applet supplied as the first parameter. If the given applet does not specify an ORB class, the new ORB will be initialized with the default BEA WebLogic Enterprise ORB implementation.

ORB orb = ORB.init(myApplet, null);

An application or applet can be initialized in one or more ORBs. ORB initialization is a bootstrap call into the CORBA world.

 


Passing the Address of the IIOP Listener

When you compile BEA WebLogic Enterprise client and server applications, use the -DTOBJADDR option to specify the host and port of the IIOP Listener. This allows you, in the application code, to specify null as a host and port string in invocations to:

By keeping host and port specifications out of your client and server application code, you maximize the portability and reusability of your application code.