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

TAO_ORBInitializer_Registry Class Reference

Global list that contains all portable interceptor ORB initializers. More...

#include <ORBInitializer_Registry.h>

Collaboration diagram for TAO_ORBInitializer_Registry:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_ORBInitializer_Registry (void)
 Only allow this class to be instantiated as a singleton instance, so declare the constructor as protected. More...

 ~TAO_ORBInitializer_Registry (void)
 Destructor. Releases duplicated ORBInitializer references. More...


Protected Methods

void register_orb_initializer (PortableInterceptor::ORBInitializer_ptr init ACE_ENV_ARG_DECL)
 Register an ORBInitializer with the underlying ORBInitializer array. More...

void pre_init (PortableInterceptor::ORBInitInfo_ptr info ACE_ENV_ARG_DECL)
 Begin initialization of all registered ORBInitializers before the ORB itself is initialized. More...

void post_init (PortableInterceptor::ORBInitInfo_ptr info ACE_ENV_ARG_DECL)
 Complete initialization of all registered ORBInitializers after the ORB has been initialized. More...


Static Protected Methods

TAO_ORBInitializer_Registry * instance (void)
 Return a unique singleton instance. More...


Private Methods

 TAO_ORBInitializer_Registry (const TAO_ORBInitializer_Registry &)
 Prevent copying. More...

void operator= (const TAO_ORBInitializer_Registry &)

Private Attributes

ACE_Array_Base< PortableInterceptor::ORBInitializer_ptrinitializers_
 Dynamic array containing registered ORBInitializers. More...


Friends

void PortableInterceptor::register_orb_initializer (PortableInterceptor::ORBInitializer_ptr init ACE_ENV_ARG_DECL_NOT_USED)
CORBA::ORB_ptr CORBA::ORB_init (int &, char *argv[], const char *, CORBA_Environment &)

Detailed Description

Global list that contains all portable interceptor ORB initializers.

Note:
This class should be instantiated via its instance() method. Normally this would be enforced by making the constructor protected but that forces a friend declaration containing a template type (TAO_Singleton) with a static member to be introduced. In turn, this potentially introduces problems in MS Windows DLL environments due to the occurance of multiple singleton instances. There should only be one!

Definition at line 41 of file ORBInitializer_Registry.h.


Constructor & Destructor Documentation

TAO_ORBInitializer_Registry::TAO_ORBInitializer_Registry void   
 

Only allow this class to be instantiated as a singleton instance, so declare the constructor as protected.

Note:
See the note in the class description for an explanation of why this constructor is not protected.

Definition at line 49 of file ORBInitializer_Registry.cpp.

00050   : initializers_ ()
00051 {
00052 }

TAO_ORBInitializer_Registry::~TAO_ORBInitializer_Registry void   
 

Destructor. Releases duplicated ORBInitializer references.

Definition at line 54 of file ORBInitializer_Registry.cpp.

References initializers_, CORBA::release, and ACE_Array_Base< PortableInterceptor::ORBInitializer_ptr >::size.

00055 {
00056   size_t initializer_count = this->initializers_.size ();
00057   for (size_t i = 0; i < initializer_count; ++i)
00058     CORBA::release (this->initializers_[i]);
00059 }

TAO_ORBInitializer_Registry::TAO_ORBInitializer_Registry const TAO_ORBInitializer_Registry &    [private]
 

Prevent copying.


Member Function Documentation

TAO_ORBInitializer_Registry * TAO_ORBInitializer_Registry::instance void    [static, protected]
 

Return a unique singleton instance.

Definition at line 118 of file ORBInitializer_Registry.cpp.

References TAO_Singleton::instance.

void TAO_ORBInitializer_Registry::operator= const TAO_ORBInitializer_Registry &    [private]
 

void TAO_ORBInitializer_Registry::post_init PortableInterceptor::ORBInitInfo_ptr info    ACE_ENV_ARG_DECL [protected]
 

Complete initialization of all registered ORBInitializers after the ORB has been initialized.

Definition at line 104 of file ORBInitializer_Registry.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, initializers_, and ACE_Array_Base< PortableInterceptor::ORBInitializer_ptr >::size.

00107 {
00108   size_t initializer_count = this->initializers_.size ();
00109   for (size_t i = 0; i < initializer_count; ++i)
00110     {
00111       this->initializers_[i]->post_init (info
00112                                          ACE_ENV_ARG_PARAMETER);
00113       ACE_CHECK;
00114     }
00115 }

void TAO_ORBInitializer_Registry::pre_init PortableInterceptor::ORBInitInfo_ptr info    ACE_ENV_ARG_DECL [protected]
 

Begin initialization of all registered ORBInitializers before the ORB itself is initialized.

Definition at line 90 of file ORBInitializer_Registry.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, initializers_, and ACE_Array_Base< PortableInterceptor::ORBInitializer_ptr >::size.

00093 {
00094   size_t initializer_count = this->initializers_.size ();
00095   for (size_t i = 0; i < initializer_count; ++i)
00096     {
00097       this->initializers_[i]->pre_init (info
00098                                         ACE_ENV_ARG_PARAMETER);
00099       ACE_CHECK;
00100     }
00101 }

void TAO_ORBInitializer_Registry::register_orb_initializer PortableInterceptor::ORBInitializer_ptr init    ACE_ENV_ARG_DECL [protected]
 

Register an ORBInitializer with the underlying ORBInitializer array.

Definition at line 62 of file ORBInitializer_Registry.cpp.

References PortableInterceptor::ORBInitializer::_duplicate, CORBA_SystemException::_tao_minor_code, ACE_ENV_ARG_DECL, ACE_THROW, initializers_, CORBA::is_nil, ACE_Array_Base< PortableInterceptor::ORBInitializer_ptr >::size, and TAO_DEFAULT_MINOR_CODE.

00065 {
00066   if (!CORBA::is_nil (init))
00067     {
00068       // Increase the length of the ORBInitializer array by one.
00069       size_t cur_len = this->initializers_.size ();
00070       size_t new_len = cur_len + 1;
00071       if (this->initializers_.size (new_len) != 0)
00072         ACE_THROW (CORBA::INTERNAL ());
00073 
00074       // @@ Do we need to duplicate the reference to the
00075       //    ORBInitializer?
00076 
00077       // Add the given ORBInitializer to the sequence.
00078       this->initializers_[cur_len] =
00079         PortableInterceptor::ORBInitializer::_duplicate (init);
00080     }
00081   else
00082     ACE_THROW (CORBA::INV_OBJREF (
00083                  CORBA_SystemException::_tao_minor_code (
00084                    TAO_DEFAULT_MINOR_CODE,
00085                    EINVAL),
00086                  CORBA::COMPLETED_NO));
00087 }


Friends And Related Function Documentation

CORBA::ORB_ptr CORBA::ORB_init int &   ,
char *    argv[],
const char *   ,
CORBA_Environment  
[friend]
 

void PortableInterceptor::register_orb_initializer PortableInterceptor::ORBInitializer_ptr init    ACE_ENV_ARG_DECL_NOT_USED [friend]
 


Member Data Documentation

ACE_Array_Base<PortableInterceptor::ORBInitializer_ptr> TAO_ORBInitializer_Registry::initializers_ [private]
 

Dynamic array containing registered ORBInitializers.

Definition at line 95 of file ORBInitializer_Registry.h.

Referenced by post_init, pre_init, register_orb_initializer, and ~TAO_ORBInitializer_Registry.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:32:04 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002