Public Member Functions | Static Public Member Functions | Protected Member Functions

TAO_GOA Class Reference

#include <GOA.h>

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

List of all members.

Public Member Functions

PortableServer::POA_ptr create_POA (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, const CORBA::PolicyList &policies)
PortableServer::POA_ptr find_POA (const char *adapter_name, CORBA::Boolean activate_it)
void destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion)
PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value)
PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value)
PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value)
PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value)
PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value)
PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value)
PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value)
char * the_name (void)
PortableServer::POA_ptr the_parent (void)
PortableServer::POAList * the_children (void)
PortableServer::POAManager_ptr the_POAManager (void)
PortableServer::AdapterActivator_ptr the_activator (void)
void the_activator (PortableServer::AdapterActivator_ptr adapter_activator)
PortableServer::ServantManager_ptr get_servant_manager (void)
void set_servant_manager (PortableServer::ServantManager_ptr imgr)
PortableServer::Servant get_servant (void)
void set_servant (PortableServer::Servant servant)
PortableServer::ObjectIdactivate_object (PortableServer::Servant p_servant)
void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant p_servant)
void deactivate_object (const PortableServer::ObjectId &oid)
CORBA::Object_ptr create_reference (const char *intf)
CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, const char *intf)
PortableServer::ObjectIdservant_to_id (PortableServer::Servant p_servant)
CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant)
PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference)
PortableServer::ObjectIdreference_to_id (CORBA::Object_ptr reference)
PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid)
CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid)
CORBA::OctetSeq * id (void)
 TAO_GOA (const String &name, PortableServer::POAManager_ptr poa_manager, const TAO_POA_Policy_Set &policies, TAO_Root_POA *parent, ACE_Lock &lock, TAO_SYNCH_MUTEX &thread_lock, TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter)
virtual ~TAO_GOA (void)
MIOP specification methods

virtual PortableServer::ObjectIdcreate_id_for_reference (CORBA::Object_ptr the_ref)
virtual PortableGroup::IDsreference_to_ids (CORBA::Object_ptr the_ref)
virtual void associate_reference_with_id (CORBA::Object_ptr ref, const PortableServer::ObjectId &oid)
virtual void disassociate_reference_with_id (CORBA::Object_ptr ref, const PortableServer::ObjectId &oid)

Static Public Member Functions

static int Initializer (void)

Protected Member Functions

virtual TAO_Root_POAnew_POA (const String &name, PortableServer::POAManager_ptr poa_manager, const TAO_POA_Policy_Set &policies, TAO_Root_POA *parent, ACE_Lock &lock, TAO_SYNCH_MUTEX &thread_lock, TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter)
 Template method for creating new POA's of this type.
int find_group_component (const CORBA::Object_ptr the_ref, PortableGroup::TagGroupTaggedComponent &group)
int find_group_component_in_profile (const TAO_Profile *profile, PortableGroup::TagGroupTaggedComponent &group)
int create_group_acceptors (CORBA::Object_ptr the_ref, TAO_PortableGroup_Acceptor_Registry &acceptor_registry, TAO_ORB_Core &orb_core)
void associate_group_with_ref (CORBA::Object_ptr group_ref, CORBA::Object_ptr obj_ref)

Detailed Description

Implementation of the PortableGroup::GOA interface.

Definition at line 48 of file GOA.h.


Constructor & Destructor Documentation

TAO_GOA::TAO_GOA ( const String name,
PortableServer::POAManager_ptr  poa_manager,
const TAO_POA_Policy_Set policies,
TAO_Root_POA parent,
ACE_Lock lock,
TAO_SYNCH_MUTEX &  thread_lock,
TAO_ORB_Core orb_core,
TAO_Object_Adapter object_adapter 
)

Definition at line 71 of file GOA.cpp.

  : TAO_Regular_POA (name,
                     poa_manager,
                     policies,
                     parent,
                     lock,
                     thread_lock,
                     orb_core,
                     object_adapter)
{
}

TAO_GOA::~TAO_GOA ( void   )  [virtual]

Definition at line 90 of file GOA.cpp.

{
}


Member Function Documentation

PortableServer::ObjectId * TAO_GOA::activate_object ( PortableServer::Servant  p_servant  ) 

Reimplemented from TAO_Root_POA.

Definition at line 298 of file GOA.cpp.

{
  PortableServer::ObjectId *object_id =
    this->TAO_Regular_POA::activate_object (p_servant);
  return object_id;
}

void TAO_GOA::activate_object_with_id ( const PortableServer::ObjectId id,
PortableServer::Servant  p_servant 
)

Reimplemented from TAO_Root_POA.

Definition at line 306 of file GOA.cpp.

{
  this->TAO_Regular_POA::activate_object_with_id (id, p_servant);
}

void TAO_GOA::associate_group_with_ref ( CORBA::Object_ptr  group_ref,
CORBA::Object_ptr  obj_ref 
) [protected]

Helper function to associate group references with object references.

Definition at line 478 of file GOA.cpp.

{
  // Find the Group Component so that we can extract the Group ID.
  PortableGroup::TagGroupTaggedComponent *tmp_group_id;
  ACE_NEW_THROW_EX (tmp_group_id,
                    PortableGroup::TagGroupTaggedComponent,
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableGroup::TagGroupTaggedComponent_var group_id = tmp_group_id;

  if (this->find_group_component (group_ref, group_id.inout ()) != 0)
    {
      // Group component wasn't found.  The group reference
      // that was passed in must be bogus.
      throw PortableGroup::NotAGroupObject ();
    }

  PortableGroup_Request_Dispatcher *rd =
    dynamic_cast <PortableGroup_Request_Dispatcher*>(
      this->orb_core_.request_dispatcher());

  // Create the acceptors necessary to receive requests for the
  // specified group reference.
  this->create_group_acceptors (group_ref,
                                rd->acceptor_registry_,
                                this->orb_core_);

  // Add a mapping from GroupId to Object key in the PortableGroup
  const TAO::ObjectKey &key =
    obj_ref->_stubobj ()->profile_in_use ()->object_key ();
  rd->group_map_.add_groupid_objectkey_pair (group_id._retn (), key);
}

void TAO_GOA::associate_reference_with_id ( CORBA::Object_ptr  ref,
const PortableServer::ObjectId oid 
) [virtual]

Definition at line 49 of file GOA.cpp.

{
  // Create a reference for the specified ObjectId, since
  // it is much easier to extract the object key from the
  // reference.
  CORBA::Object_var obj_ref = this->id_to_reference (oid);

  // Associate the object reference with the group reference.
  this->associate_group_with_ref (ref,
                                  obj_ref.in ());
}

int TAO_GOA::create_group_acceptors ( CORBA::Object_ptr  the_ref,
TAO_PortableGroup_Acceptor_Registry acceptor_registry,
TAO_ORB_Core orb_core 
) [protected]

Definition at line 449 of file GOA.cpp.

{
  const TAO_MProfile& profiles = the_ref->_stubobj ()->base_profiles ();
  const TAO_Profile* profile;
  CORBA::ULong slot;
  int num = 0;

  // Iterate through the tagged profiles, and
  // create acceptors for the multicast ones.
  slot = 0;
  while (0 != (profile = profiles.get_profile (slot)))
    {
      if (profile->supports_multicast ())
        {
          acceptor_registry.open (profile,
                                  orb_core);
          ++num;
        }

      ++slot;
    }

  // Return the number of acceptors registered.
  return num;
}

PortableServer::IdAssignmentPolicy_ptr TAO_GOA::create_id_assignment_policy ( PortableServer::IdAssignmentPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 180 of file GOA.cpp.

{
  PortableServer::IdAssignmentPolicy_ptr policy =
    this->TAO_Regular_POA::create_id_assignment_policy (value);
  return policy;
}

PortableServer::ObjectId * TAO_GOA::create_id_for_reference ( CORBA::Object_ptr  the_ref  )  [virtual]

Definition at line 22 of file GOA.cpp.

{
  // Get the RepositoryId from the Group reference so
  // we know what kind of reference to make.
  const char* repository_id = the_ref->_stubobj ()->type_id.in ();

  // Create a temporary object reference and then get the
  // ObjectId out of it.
  CORBA::Object_var obj_ref = this->create_reference (repository_id);

  PortableServer::ObjectId_var obj_id =
    this->reference_to_id (obj_ref.in ());

  // Associate the object reference with the group reference.
  this->associate_group_with_ref (the_ref,
                                  obj_ref.in ());

  return obj_id._retn ();
}

PortableServer::IdUniquenessPolicy_ptr TAO_GOA::create_id_uniqueness_policy ( PortableServer::IdUniquenessPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 171 of file GOA.cpp.

{
  PortableServer::IdUniquenessPolicy_ptr policy =
    this->TAO_Regular_POA::create_id_uniqueness_policy (value);
  return policy;
}

PortableServer::ImplicitActivationPolicy_ptr TAO_GOA::create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 191 of file GOA.cpp.

{
  PortableServer::ImplicitActivationPolicy_ptr policy =
    this->TAO_Regular_POA::create_implicit_activation_policy (value);
  return policy;
}

PortableServer::LifespanPolicy_ptr TAO_GOA::create_lifespan_policy ( PortableServer::LifespanPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 163 of file GOA.cpp.

{
  PortableServer::LifespanPolicy_ptr policy =
    this->TAO_Regular_POA::create_lifespan_policy (value);
  return policy;
}

PortableServer::POA_ptr TAO_GOA::create_POA ( const char *  adapter_name,
PortableServer::POAManager_ptr  poa_manager,
const CORBA::PolicyList &  policies 
)

Reimplemented from TAO_Root_POA.

Definition at line 122 of file GOA.cpp.

{
  PortableServer::POA_ptr poa = this->TAO_Regular_POA::create_POA (adapter_name,
                                                           poa_manager,
                                                           policies);
  return poa;
}

CORBA::Object_ptr TAO_GOA::create_reference ( const char *  intf  ) 

Reimplemented from TAO_Root_POA.

Definition at line 319 of file GOA.cpp.

{
  CORBA::Object_ptr obj =
    this->TAO_Regular_POA::create_reference (intf);
  return obj;
}

CORBA::Object_ptr TAO_GOA::create_reference_with_id ( const PortableServer::ObjectId oid,
const char *  intf 
)

Reimplemented from TAO_Root_POA.

Definition at line 327 of file GOA.cpp.

{
  CORBA::Object_ptr obj =
    this->TAO_Regular_POA::create_reference_with_id (oid,
                                             intf);
  return obj;
}

PortableServer::RequestProcessingPolicy_ptr TAO_GOA::create_request_processing_policy ( PortableServer::RequestProcessingPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 208 of file GOA.cpp.

{
  PortableServer::RequestProcessingPolicy_ptr policy =
    this->TAO_Regular_POA::create_request_processing_policy (value);
  return policy;
}

PortableServer::ServantRetentionPolicy_ptr TAO_GOA::create_servant_retention_policy ( PortableServer::ServantRetentionPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 199 of file GOA.cpp.

{
  PortableServer::ServantRetentionPolicy_ptr policy =
    this->TAO_Regular_POA::create_servant_retention_policy (value);
  return policy;
}

PortableServer::ThreadPolicy_ptr TAO_GOA::create_thread_policy ( PortableServer::ThreadPolicyValue  value  ) 

Reimplemented from TAO_Root_POA.

Definition at line 153 of file GOA.cpp.

{
  PortableServer::ThreadPolicy_ptr policy =
    this->TAO_Regular_POA::create_thread_policy (value);
  return policy;
}

void TAO_GOA::deactivate_object ( const PortableServer::ObjectId oid  ) 

Reimplemented from TAO_Root_POA.

Definition at line 313 of file GOA.cpp.

void TAO_GOA::destroy ( CORBA::Boolean  etherealize_objects,
CORBA::Boolean  wait_for_completion 
)

Reimplemented from TAO_Root_POA.

Definition at line 142 of file GOA.cpp.

{
  this->TAO_Regular_POA::destroy (etherealize_objects,
                          wait_for_completion);
}

void TAO_GOA::disassociate_reference_with_id ( CORBA::Object_ptr  ref,
const PortableServer::ObjectId oid 
) [virtual]

Definition at line 63 of file GOA.cpp.

{
  ACE_UNUSED_ARG (ref);
  ACE_UNUSED_ARG (oid);
}

int TAO_GOA::find_group_component ( const CORBA::Object_ptr  the_ref,
PortableGroup::TagGroupTaggedComponent &  group 
) [protected]

Definition at line 392 of file GOA.cpp.

{
  const TAO_MProfile& profiles = the_ref->_stubobj ()->base_profiles ();
  const TAO_Profile* profile;
  CORBA::ULong slot;

  // Iterate through the tagged profiles, and
  // create acceptors for the multicast ones.
  slot = 0;
  while (0 != (profile = profiles.get_profile (slot)))
    {
      if (this->find_group_component_in_profile (profile, group) == 0)
        return 0;

      ++slot;
    }

  // Not found.
  return -1;
}

int TAO_GOA::find_group_component_in_profile ( const TAO_Profile profile,
PortableGroup::TagGroupTaggedComponent &  group 
) [protected]

Definition at line 415 of file GOA.cpp.

{
  // Iterate through the tagged components looking for
  // group tag.
  const TAO_Tagged_Components& components = profile->tagged_components ();

  IOP::TaggedComponent tagged_component;
  tagged_component.tag = IOP::TAG_GROUP;

  // Try to find it.
  if (components.get_component (tagged_component) == 0)
    return -1;

  // Found it.
  const CORBA::Octet *buf =
    tagged_component.component_data.get_buffer ();

  TAO_InputCDR in_cdr (reinterpret_cast <const char*> (buf),
                       tagged_component.component_data.length ());

  // Extract the Byte Order.
  CORBA::Boolean byte_order;
  if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
    return -1;
  in_cdr.reset_byte_order (static_cast <int> (byte_order));

  if ((in_cdr >> group) == 0)
    return -1;

  return 0;
}

PortableServer::POA_ptr TAO_GOA::find_POA ( const char *  adapter_name,
CORBA::Boolean  activate_it 
)

Reimplemented from TAO_Root_POA.

Definition at line 133 of file GOA.cpp.

{
  PortableServer::POA_ptr poa = this->TAO_Regular_POA::find_POA (adapter_name,
                                                         activate_it);
  return poa;
}

PortableServer::Servant TAO_GOA::get_servant ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 282 of file GOA.cpp.

{
  PortableServer::Servant servant =
    this->TAO_Regular_POA::get_servant ();
  return servant;
}

PortableServer::ServantManager_ptr TAO_GOA::get_servant_manager ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 268 of file GOA.cpp.

{
  PortableServer::ServantManager_ptr servant_manager =
    this->TAO_Regular_POA::get_servant_manager ();
  return servant_manager;
}

CORBA::OctetSeq * TAO_GOA::id ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 386 of file GOA.cpp.

{
  return this->TAO_Regular_POA::id ();
}

CORBA::Object_ptr TAO_GOA::id_to_reference ( const PortableServer::ObjectId oid  ) 

Reimplemented from TAO_Root_POA.

Definition at line 378 of file GOA.cpp.

{
  CORBA::Object_ptr obj =
    this->TAO_Regular_POA::id_to_reference (oid);
  return obj;
}

PortableServer::Servant TAO_GOA::id_to_servant ( const PortableServer::ObjectId oid  ) 

Reimplemented from TAO_Root_POA.

Definition at line 370 of file GOA.cpp.

{
  PortableServer::Servant servant =
    this->TAO_Regular_POA::id_to_servant (oid);
  return servant;
}

static int TAO_GOA::Initializer ( void   )  [static]
TAO_Root_POA * TAO_GOA::new_POA ( const String name,
PortableServer::POAManager_ptr  poa_manager,
const TAO_POA_Policy_Set policies,
TAO_Root_POA parent,
ACE_Lock lock,
TAO_SYNCH_MUTEX &  thread_lock,
TAO_ORB_Core orb_core,
TAO_Object_Adapter object_adapter 
) [protected, virtual]

Template method for creating new POA's of this type.

Reimplemented from TAO_Root_POA.

Definition at line 95 of file GOA.cpp.

{
  TAO_GOA *poa = 0;

  ACE_NEW_THROW_EX (poa,
                    TAO_GOA (name,
                             poa_manager,
                             policies,
                             parent,
                             lock,
                             thread_lock,
                             orb_core,
                             object_adapter),
                    CORBA::NO_MEMORY ());

  return poa;
}

PortableServer::ObjectId * TAO_GOA::reference_to_id ( CORBA::Object_ptr  reference  ) 

Reimplemented from TAO_Root_POA.

Definition at line 362 of file GOA.cpp.

{
  PortableServer::ObjectId *object_id =
    this->TAO_Regular_POA::reference_to_id (reference);
  return object_id;
}

PortableGroup::IDs * TAO_GOA::reference_to_ids ( CORBA::Object_ptr  the_ref  )  [virtual]

Definition at line 43 of file GOA.cpp.

{
  return 0;
}

PortableServer::Servant TAO_GOA::reference_to_servant ( CORBA::Object_ptr  reference  ) 

Reimplemented from TAO_Root_POA.

Definition at line 354 of file GOA.cpp.

{
  PortableServer::Servant servant =
    this->TAO_Regular_POA::reference_to_servant (reference);
  return servant;
}

PortableServer::ObjectId * TAO_GOA::servant_to_id ( PortableServer::Servant  p_servant  ) 

Reimplemented from TAO_Root_POA.

Definition at line 337 of file GOA.cpp.

{
  PortableServer::ObjectId *object_id =
    this->TAO_Regular_POA::servant_to_id (p_servant);
  return object_id;
}

CORBA::Object_ptr TAO_GOA::servant_to_reference ( PortableServer::Servant  p_servant  ) 

Reimplemented from TAO_Root_POA.

Definition at line 345 of file GOA.cpp.

{
  CORBA::Object_ptr obj =
    this->TAO_Regular_POA::servant_to_reference (p_servant);
  return obj;
}

void TAO_GOA::set_servant ( PortableServer::Servant  servant  ) 

Reimplemented from TAO_Root_POA.

Definition at line 290 of file GOA.cpp.

{
  this->TAO_Regular_POA::set_servant (servant);
}

void TAO_GOA::set_servant_manager ( PortableServer::ServantManager_ptr  imgr  ) 

Reimplemented from TAO_Root_POA.

Definition at line 276 of file GOA.cpp.

void TAO_GOA::the_activator ( PortableServer::AdapterActivator_ptr  adapter_activator  ) 

Reimplemented from TAO_Root_POA.

Definition at line 262 of file GOA.cpp.

{
  this->TAO_Regular_POA::the_activator (adapter_activator);
}

PortableServer::AdapterActivator_ptr TAO_GOA::the_activator ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 254 of file GOA.cpp.

{
  PortableServer::AdapterActivator_ptr activator =
    this->TAO_Regular_POA::the_activator ();
  return activator;
}

PortableServer::POAList * TAO_GOA::the_children ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 235 of file GOA.cpp.

{
  PortableServer::POAList *children =
    this->TAO_Regular_POA::the_children ();
  return children;
}

char * TAO_GOA::the_name ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 219 of file GOA.cpp.

{
  char * name =
    this->TAO_Regular_POA::the_name ();
  return name;
}

PortableServer::POA_ptr TAO_GOA::the_parent ( void   ) 

Reimplemented from TAO_Regular_POA.

Definition at line 227 of file GOA.cpp.

{
  PortableServer::POA_ptr parent =
    this->TAO_Regular_POA::the_parent ();
  return parent;
}

PortableServer::POAManager_ptr TAO_GOA::the_POAManager ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 243 of file GOA.cpp.

{
  PortableServer::POAManager_ptr poa_manager =
    this->TAO_Regular_POA::the_POAManager ();
  return poa_manager;
}


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