![]() |
![]() |
BEA WebLogic Enterprise 4.2 Developer Center |
![]() HOME | SITE MAP | SEARCH | CONTACT | GLOSSARY | PDF FILES | WHAT'S NEW |
||
![]() JAVA REFERENCE | TABLE OF CONTENTS | PREVIOUS TOPIC | NEXT TOPIC |
This chapter supplements the information in package org.omg.CORBA
by providing the following topics:
[This section is reprinted from the package information for An application or applet gains access to the CORBA environment by initializing itself into an ORB using one of three Class name of an ORB implementation
Class name of the ORB returned by
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:
Initializing the ORB
org.omg.CORBA
, as published by Sun Microsystems, Inc. for the JDK 1.2.]
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
org.omg.CORBA.ORBSingletonClass
init()
Note that the 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:
com.sun.CORBA.iiop.ORB
.
p
.
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 WebLogic Enterprise ORB implementation.
An application or applet can be initialized in one or more ORBs. ORB initialization is a bootstrap call into the CORBA world.
When you compile WebLogic Enterprise client and server applications, use the ORB orb = ORB.init(myApplet, null);
Passing the Address of the IIOP Listener
-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:
ORB.init
method
By keeping host and port specifications out of your client and server application code, you maximize the portability and reusability of your application code.
WebLogic Enterprise provides two methods on the These two methods are:
Initializing the ORB for Native and Remote Clients
com.beasys.Tobj_Bootstrap
object that client applications use to initialize the ORB, depending on whether the client is native (that is, on a process that is inside the WebLogic Enterprise domain) or remote (that is, on a machine that needs to communicate to the server application via the IIOP Listener/Handler).
getNativeProperties
method
This method returns a set of properties that need to be passed in a subsequent invocation of the The org.omg.CORBA.ORB.init
method. This subsequent invocation causes BEA's Java ORB to be initialized. The getNativeProperties
method also initializes the WebLogic Enterprise infrastructure.
getNativeProperties
method must be invoked before any attempt is made to access any class in the org.omg.CORBA
package; otherwise, errors will occur when receiving CORBA exceptions from the server.
getRemoteProperties
method
This method returns the properties needed to initialize the ORB for remote clients. The
Note:
In WLE 4.2, Java native clients are not supported.
getRemoteProperties
method is specified for symmetry and always returns null
.