Oracle8i Enterprise JavaBeans and CORBA Developer's Guide
Release 8.1.5






Prev  Chap Top Next

Activating ORBs and Server Objects

A CORBA application requires that an ORB be active on both the client system and the system running the server. In looking at the examples shown so far in this chapter, it is not obvious how the ORB is activated, either on the client or the server. This section presents more information about that topic.

Client Side

The client-side ORB is normally initialized as part of the processing that goes on when the client invokes the lookup() method on the JNDI InitialContext object that it instantiates.

If you need to get a reference to the client ORB, use the init() method on the ORB pseudo-object to get it, as shown in this statement:

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init ();

The init() method invoked on the client with no parameters always returns a reference to the existing client ORB.

Server Side

The ORB on the server is started by the presentation that handles IIOP requests. This is done, lazily, when the session is created.

About Object Activation

Objects are activated on demand. When a client looks up an object the ORB loads the object into memory and caches it. To activate the object, the ORB looks up the class by the fully-qualified class name under which the object was published. The class name is resolved in the schema defined at publication time, rather than the caller's schema. See the description of the command-line tool "publish" for more information.

When the class is located, the ORB creates a new instance of it, using newInstance(). This is the reason that the no-argument constructor of a persistent object class must be public. If the class implements the oracle.aurora.AuroraServices.ActivatableObject interface (as determined by reflection), then the _initializeAuroraObject()message is sent to the instance. (See "Using the CORBA Tie Mechanism" for an example that requires _initializeAuroraObject()).

There is no need for the server implementation to register persistent objects with the object adapter using a boa.obj_is_ready() call--the JServer ORB does that automatically.

Transient objects that are generated by other objects, such as persistent published objects, must be registered with the BOA using obj_is_ready(). For a good example of this, see the factory demo in the examples/corba/basic/factory directory of the product CD.



Copyright © 1999 Oracle Corporation.

All Rights Reserved.