Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_ORB_Manager Class Reference

Helper class for simple ORB/POA initialization and registering servants with the POA. More...

#include <ORB_Manager.h>

List of all members.

Public Methods

 TAO_ORB_Manager (CORBA::ORB_ptr orb = 0, PortableServer::POA_ptr poa = 0, PortableServer::POAManager_ptr poa_manager = 0)
int init (int &argc, char *argv[], CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int init (int &argc, char *argv[], const char *orb_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int init_child_poa (int &argc, char *argv[], const char *poa_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int init_child_poa (int &argc, char *argv[], const char *poa_name, const char *orb_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int fini (CORBA_Environment &ACE_TRY_ENV)
 ~TAO_ORB_Manager (void)
 Destructor.

int activate_poa_manager (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
char* activate (PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
void deactivate (const char *id, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
char* activate_under_child_poa (const char *object_name, PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
void deactivate_under_child_poa (const char *id, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int run (CORBA_Environment &ACE_TRY_ENV, ACE_Time_Value *tv)
int run (ACE_Time_Value &tv, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
int run (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
CORBA::ORB_ptr orb (void)
PortableServer::POA_ptr root_poa (void)
PortableServer::POA_ptr child_poa (void)
PortableServer::POAManager_ptr poa_manager (void)

Protected Attributes

CORBA::ORB_var orb_
 The ORB.

PortableServer::POA_var poa_
 The POA for this ORB.

PortableServer::POA_var child_poa_
 Child poa under the root POA.

PortableServer::POAManager_var poa_manager_
 The POA manager of poa_.


Detailed Description

Helper class for simple ORB/POA initialization and registering servants with the POA.

This class is a TAO extension that makes it easier to write CORBA applications. It's just a wrapper and doesn't do anything special within the ORB itself.


Constructor & Destructor Documentation

TAO_ORB_Manager::TAO_ORB_Manager ( CORBA::ORB_ptr orb = 0,
PortableServer::POA_ptr poa = 0,
PortableServer::POAManager_ptr poa_manager = 0 ) [inline]
 

Constructor.

Parameters:
orb   pointer to an ORB which is duplicated an stored internally in an ORB_var. If pointer is 0, a new ORB pointer is created internally in the init() call.
poa   pointer to a POA which is duplicated and stored internally in a POA_var. If pointer is 0, a pointer to the Root POA is obtained from the ORB.
poa_manager   pointer to a POA Manager which is duplicated and stored internally in a POAManager_var. If pointer is 0, a new POAManager is created internally in the init() call.

TAO_ORB_Manager::~TAO_ORB_Manager ( void )
 

Destructor.


Member Function Documentation

char * TAO_ORB_Manager::activate ( PortableServer::Servant servant,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Activate <servant>, using the POA call. Users can call this method multiple times to activate multiple objects.

Returns:
0 on failure, a string representation of the object ID if successful. Caller of this method is responsible for memory deallocation of the string.

int TAO_ORB_Manager::activate_poa_manager ( CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Put POA manager into the state, so that incoming corba requests are processed. This method is useful for clients, which are not going to enter "orb->run" loop, yet may want to service incoming requests while waiting for a result of CORBA call on a server.

Returns:
-1 on failure, 0 on success

char * TAO_ORB_Manager::activate_under_child_poa ( const char * object_name,
PortableServer::Servant servant,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Precondition: init_child_poa has been called. Activate <servant> using the POA created from the string <object_name>. Users should call this to activate objects under the child_poa.

Parameters:
object_name   String name which will be used to create an Object ID for the servant.
servant   The servant to activate under the child POA.

Returns:
0 on failure, a string representation of the object ID if successful. Caller of this method is responsible for memory deallocation of the string.

PortableServer::POA_ptr TAO_ORB_Manager::child_poa ( void )
 

Accessor which returns the child poa. Following the normal CORBA memory management rules of return values from functions, this function duplicates the poa return value before returning it.

Returns:
Child POA pointer which has been duplicated. Caller must release pointer when done.

void TAO_ORB_Manager::deactivate ( const char * id,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Deactivate object in RootPOA.

Parameters:
id   a string representation of the Object ID of the servant to deactivate in the POA

void TAO_ORB_Manager::deactivate_under_child_poa ( const char * id,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Deactivate object in child POA.

Parameters:
id   string representation of the object ID, which represents the object to deactivate in the POA

int TAO_ORB_Manager::fini ( CORBA_Environment & ACE_TRY_ENV )
 

Shut down. Invoke the destroy() methods on the orb and poa.

Returns:
-1 on failure, 0 on success

int TAO_ORB_Manager::init ( int & argc,
char * argv[],
const char * orb_name,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Initialize the ORB/root POA, using the supplied command line arguments or the default ORB components.

Returns:
-1 on failure, 0 on success

int TAO_ORB_Manager::init ( int & argc,
char * argv[],
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Initialize the ORB/root POA, using the supplied command line arguments or the default ORB components.

Returns:
-1 on failure, 0 on success

int TAO_ORB_Manager::init_child_poa ( int & argc,
char * argv[],
const char * poa_name,
const char * orb_name,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Creates a child poa under the root poa with PERSISTENT and USER_ID policies. Call this if you want a <child_poa> with the above policies, otherwise call init. Returns -1 on failure.

int TAO_ORB_Manager::init_child_poa ( int & argc,
char * argv[],
const char * poa_name,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

Creates a child poa under the root poa with PERSISTENT and USER_ID policies. Call this if you want a <child_poa> with the above policies, otherwise call init.

Returns:
-1 on failure, 0 on success

CORBA::ORB_ptr TAO_ORB_Manager::orb ( void )
 

Accessor which returns the ORB pointer. Following the normal CORBA memory management rules of return values from functions, this function duplicates the orb return value before returning it.

Returns:
orb ORB pointer which has been duplicated, so caller must release pointer when done.

PortableServer::POAManager_ptr TAO_ORB_Manager::poa_manager ( void )
 

Accessor which returns the poa manager. Following the normal CORBA memory management rules of return values from functions, this function duplicates the poa manager return value before returning it.

Returns:
POAManager pointer which has been duplicated. Caller must release pointer when done.

PortableServer::POA_ptr TAO_ORB_Manager::root_poa ( void )
 

Accessor which returns the root poa. Following the normal CORBA memory management rules of return values from functions, this function duplicates the poa return value before returning it.

Returns:
poa Root POA pointer which has been duplicated. Caller must release pointer when done.

int TAO_ORB_Manager::run ( CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

int TAO_ORB_Manager::run ( ACE_Time_Value & tv,
CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )
 

int TAO_ORB_Manager::run ( CORBA_Environment & ACE_TRY_ENV,
ACE_Time_Value * tv )
 

Run the ORB event loop with the specified <tv> time value.

Parameters:
tv   the time interval for how long to run the ORB event loop.
Returns:
-1 on failure, 0 on success


Member Data Documentation

PortableServer::POA_var TAO_ORB_Manager::child_poa_ [protected]
 

Child poa under the root POA.

CORBA::ORB_var TAO_ORB_Manager::orb_ [protected]
 

The ORB.

PortableServer::POA_var TAO_ORB_Manager::poa_ [protected]
 

The POA for this ORB.

PortableServer::POAManager_var TAO_ORB_Manager::poa_manager_ [protected]
 

The POA manager of poa_.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 11:51:20 2001 for TAO_PortableServer by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000