2.3. Starting and Stopping the ORB and BOA/POA

BOA refers to Basic Object Adapter, and POA refers to Portable Object Adepter.
JBoss Transaction Service needs to be correctly initialized before any application object is created. To guarantee this, you must use the initORB method, and either of the initBOA or initPOA methods of the ORBInterface class, which is described in the ORB Portability Manual. Do not use the ORB_init, BOA_init, or create_POA methods provided by the underlying ORB, because they may lead to incorrectly operating applications.

Example 2.1. ORB Initialization

public static void main (String[] args)
{
    ORBInterface.initORB(args, null);
    ORBInterface.initOA();
    . . .
};

ORBInterface Methods

orb
Returns references to the ORB
boa
Returns references to the BOA
poa
Returns references to the POA
rootPoa
Returns references to the root POA
shutdownOA
Shut down the BOA. Run this before shutdownORB, and before terminating the application.
shutdownORB
Shut down the ORB. Use this after shutdownOA. Run this before terminating the application.
Use the shutdownOA and shutdownORB methods, in sequence, before terminating an application. This allows JBoss Transaction Service to perform necessary cleanup routines. The shutdownOA routine either shuts down the BOA or the POA, depending upon the ORB being used.

Example 2.2. Shutting Down the ORB

public static void main (String[] args)
{
    . . .
    ORBInterface.shutdownOA();
    ORBInterface.shutdownORB();
};
Do not use more CORBA objects after you call shutdown. You need to reinitialize the BOA/POA and ORB before using more CORBA objects.

Note

The term Object Adapter is used in the rest of this guide to refer to either the BOA or the POA, interchangeably. Where possible, this guide uses the ORB Portability classes to mask the differences between POA and BOA.