Public Member Functions | Static Public Member Functions | Private Attributes

TAO_BiDirGIOP_Loader Class Reference

Class that loads the BiDir library. More...

#include <BiDirGIOP.h>

Inheritance diagram for TAO_BiDirGIOP_Loader:
Inheritance graph
[legend]
Collaboration diagram for TAO_BiDirGIOP_Loader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_BiDirGIOP_Loader (void)
 Constructor.
virtual ~TAO_BiDirGIOP_Loader (void)
 Destructor.
virtual int init (int argc, ACE_TCHAR *[])
 Initialize the BiDIR loader hooks.
virtual void load_policy_validators (TAO_Policy_Validator &validator)

Static Public Member Functions

static int Initializer (void)
 Used to force the initialization of the ORB code.

Private Attributes

bool initialized_

Detailed Description

Class that loads the BiDir library.

Definition at line 41 of file BiDirGIOP.h.


Constructor & Destructor Documentation

TAO_BiDirGIOP_Loader::TAO_BiDirGIOP_Loader ( void   ) 

Constructor.

Definition at line 15 of file BiDirGIOP.cpp.

  : initialized_ (false)
{
}

TAO_BiDirGIOP_Loader::~TAO_BiDirGIOP_Loader ( void   )  [virtual]

Destructor.

Definition at line 20 of file BiDirGIOP.cpp.

{
}


Member Function Documentation

int TAO_BiDirGIOP_Loader::init ( int  argc,
ACE_TCHAR [] 
) [virtual]

Initialize the BiDIR loader hooks.

Register the BiDir ORBInitializer.

Reimplemented from ACE_Shared_Object.

Definition at line 25 of file BiDirGIOP.cpp.

{
  if (this->initialized_)
    return 0;

  this->initialized_ = true;

  ACE_Service_Gestalt *gestalt = ACE_Service_Config::current ();

  ACE_Service_Object * const bidir_loader =
    ACE_Dynamic_Service<ACE_Service_Object>::instance (
      gestalt,
      "BiDirGIOP_Loader",
      true);

  if (bidir_loader != 0 && bidir_loader != this)
    {
      return bidir_loader->init (0, 0);
    }

  if (TAO_DEF_GIOP_MINOR >= 2)
    {
      PortableInterceptor::ORBInitializer_ptr tmp_orb_initializer =
        PortableInterceptor::ORBInitializer::_nil ();
      PortableInterceptor::ORBInitializer_var bidir_orb_initializer;

      try
        {
          /// Register the BiDir ORBInitializer.
          ACE_NEW_THROW_EX (tmp_orb_initializer,
                            TAO_BiDir_ORBInitializer,
                            CORBA::NO_MEMORY (
                                CORBA::SystemException::_tao_minor_code (
                                    TAO::VMCID,
                                    ENOMEM),
                                CORBA::COMPLETED_NO));

          bidir_orb_initializer = tmp_orb_initializer;

          PortableInterceptor::register_orb_initializer (
            bidir_orb_initializer.in ());
        }
      catch (const ::CORBA::Exception& ex)
        {
          if (TAO_debug_level > 0)
            {
              ex._tao_print_exception ("Caught exception:");
            }
          return -1;
        }
    }

  return 0;
}

int TAO_BiDirGIOP_Loader::Initializer ( void   )  [static]

Used to force the initialization of the ORB code.

Definition at line 108 of file BiDirGIOP.cpp.

{
  return ACE_Service_Config::process_directive (ace_svc_desc_TAO_BiDirGIOP_Loader);
}

void TAO_BiDirGIOP_Loader::load_policy_validators ( TAO_Policy_Validator validator  )  [virtual]

Implements TAO_BiDir_Adapter.

Definition at line 81 of file BiDirGIOP.cpp.

{
  // Is this true? Does the GIOP protocol version matter here?
  if (TAO_DEF_GIOP_MINOR < 2)
    return;

  TAO_BiDirPolicy_Validator *validator = 0;
  ACE_NEW_THROW_EX (validator,
                    TAO_BiDirPolicy_Validator (val.orb_core ()),
                    CORBA::NO_MEMORY (
                        CORBA::SystemException::_tao_minor_code (
                            TAO::VMCID,
                            ENOMEM),
                        CORBA::COMPLETED_NO));

  // We may be adding another TAO_BiDirPolicy_Validator instance for
  // the same ORB (different POA). In cases where huge numbers of
  // bi-directional POA instances are created, having a validator
  // instance per POA may introduce additional delays in policy
  // validation and hence, the overal policy creation time. Since this
  // is out of the critical invocation processing path, I plan to keep
  // the design simple and not try to avoid an ineficiency of such
  // small proportions.
  val.add_validator (validator);
}


Member Data Documentation

Flag to indicate whether the BiDirGIOP library has been activated.

Definition at line 64 of file BiDirGIOP.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines