Public Member Functions | Protected Member Functions | Protected Attributes

TAO_RT_POA Class Reference

#include <RT_POA.h>

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

List of all members.

Public Member Functions

CORBA::Object_ptr create_reference_with_priority (const char *intf, RTCORBA::Priority priority)
CORBA::Object_ptr create_reference_with_id_and_priority (const PortableServer::ObjectId &oid, const char *intf, RTCORBA::Priority priority)
PortableServer::ObjectIdactivate_object_with_priority (PortableServer::Servant p_servant, RTCORBA::Priority priority)
void activate_object_with_id_and_priority (const PortableServer::ObjectId &oid, PortableServer::Servant p_servant, RTCORBA::Priority priority)
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)
virtual CORBA::PolicyList * client_exposed_policies (CORBA::Short object_priority)
 TAO_RT_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)
virtual ~TAO_RT_POA (void)
void * thread_pool (void) const

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.
virtual TAO_Stubkey_to_stub_i (const TAO::ObjectKey &key, const char *type_id, CORBA::Short priority)
 Like key_to_stub() but assume that the ORB is not shutting down.
void validate_priority (RTCORBA::Priority priority)
void validate_policies (void)
void parse_rt_policies (TAO_POA_Policy_Set &policies)
size_t endpoint_count (void)
TAO_Stubcreate_stub_object (const TAO::ObjectKey &object_key, const char *type_id, CORBA::PolicyList *policy_list, TAO_Acceptor_Filter *filter, TAO_PriorityBandedConnectionPolicy *priority_bands)
int lane_required (TAO_Thread_Lane *lane, TAO_PriorityBandedConnectionPolicy *priority_bands)

Protected Attributes

TAO_Thread_Poolthread_pool_

Detailed Description

Definition at line 48 of file RT_POA.h.


Constructor & Destructor Documentation

TAO_RT_POA::TAO_RT_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 
)

Definition at line 39 of file RT_POA.cpp.

  : TAO_Regular_POA (name,
                     poa_manager,
                     policies,
                     parent,
                     lock,
                     thread_lock,
                     orb_core,
                     object_adapter),
  thread_pool_ (0)
{
  // Parse the RT policies and update our policy cache.
  this->parse_rt_policies (this->policies ());
}

TAO_RT_POA::~TAO_RT_POA ( void   )  [virtual]

Definition at line 62 of file RT_POA.cpp.

{
}


Member Function Documentation

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

Reimplemented from TAO_Root_POA.

Definition at line 641 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::activate_object (p_servant);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 648 of file RT_POA.cpp.

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

void TAO_RT_POA::activate_object_with_id_and_priority ( const PortableServer::ObjectId oid,
PortableServer::Servant  p_servant,
RTCORBA::Priority  priority 
)

Definition at line 75 of file RT_POA.inl.

{
  // Check that this method can be used based on this POA's policies.
  this->validate_policies ();

  this->validate_priority (priority);

  while (true)
    {
      bool wait_occurred_restart_call = false;

      // Lock access for the duration of this transaction.
      TAO_POA_GUARD;

      this->activate_object_with_id_i (oid,
                                       servant,
                                       priority,
                                       wait_occurred_restart_call);

      // If we ended up waiting on a condition variable, the POA state
      // may have changed while we are waiting.  Therefore, we need to
      // restart this call.
      if (wait_occurred_restart_call)
        continue;
      else
        return;
    }
}

PortableServer::ObjectId * TAO_RT_POA::activate_object_with_priority ( PortableServer::Servant  p_servant,
RTCORBA::Priority  priority 
)

Definition at line 45 of file RT_POA.inl.

{
  // Check that this method can be used based on this POA's policies.
  this->validate_policies ();

  this->validate_priority (priority);

  while (true)
    {
      bool wait_occurred_restart_call = false;

      // Lock access for the duration of this transaction.
      TAO_POA_GUARD_RETURN (0);

      PortableServer::ObjectId *result =
        this->activate_object_i (servant, priority, wait_occurred_restart_call);

      // If we ended up waiting on a condition variable, the POA state
      // may have changed while we are waiting.  Therefore, we need to
      // restart this call.
      if (wait_occurred_restart_call)
        continue;
      else
        return result;
    }
}

CORBA::PolicyList * TAO_RT_POA::client_exposed_policies ( CORBA::Short  object_priority  )  [virtual]

This method gives the policies that are exposed to the client. These policies are shipped within the IOR.

Reimplemented from TAO_Root_POA.

Definition at line 441 of file RT_POA.cpp.

{
  CORBA::PolicyList *client_exposed_policies = 0;
  ACE_NEW_THROW_EX (client_exposed_policies,
                    CORBA::PolicyList (),
                    CORBA::NO_MEMORY (TAO::VMCID,
                                      CORBA::COMPLETED_NO));

  CORBA::PolicyList_var safe_client_exposed_policies = client_exposed_policies;

  // Add in all of the client exposed policies.
  this->policies_.add_client_exposed_fixed_policies (client_exposed_policies);

  // Check if the priority model policy has been set, and if so, let
  // the client know about it.
  CORBA::Short poa_priority =
    this->cached_policies_.server_priority ();

  if (poa_priority != TAO_INVALID_PRIORITY)
    {
      TAO::Portable_Server::Cached_Policies::PriorityModel priority_model =
        this->cached_policies_.priority_model ();

      // If the priority model is client propagated, let the client
      // about the default server priority (the POA priority).  If
      // the priority model is server declared, tell the client the
      // servant's priority.
      CORBA::Short priority;
      if (priority_model == TAO::Portable_Server::Cached_Policies::CLIENT_PROPAGATED)
        priority = poa_priority;
      else
        priority = object_priority;

      const CORBA::ULong current_length =
        client_exposed_policies->length ();
      client_exposed_policies->length (current_length + 1);

      TAO_PriorityModelPolicy *priority_model_policy;
      ACE_NEW_THROW_EX (priority_model_policy,
                        TAO_PriorityModelPolicy (RTCORBA::PriorityModel (priority_model),
                                                 priority),
                        CORBA::NO_MEMORY (TAO::VMCID,
                                          CORBA::COMPLETED_NO));

      (*client_exposed_policies)[current_length] = priority_model_policy;
    }

  return safe_client_exposed_policies._retn ();
}

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

Reimplemented from TAO_Root_POA.

Definition at line 543 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 535 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 552 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 527 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::create_lifespan_policy (value);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 494 of file RT_POA.cpp.

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

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

Reimplemented from TAO_Root_POA.

Definition at line 662 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::create_reference (intf);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 669 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::create_reference_with_id (oid, intf);
}

CORBA::Object_ptr TAO_RT_POA::create_reference_with_id_and_priority ( const PortableServer::ObjectId oid,
const char *  intf,
RTCORBA::Priority  priority 
)

Definition at line 28 of file RT_POA.inl.

{
  // Check that this method can be used based on this POA's policies.
  this->validate_policies ();

  this->validate_priority (priority);

  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->create_reference_with_id_i (oid, intf, priority);
}

CORBA::Object_ptr TAO_RT_POA::create_reference_with_priority ( const char *  intf,
RTCORBA::Priority  priority 
)

Definition at line 12 of file RT_POA.inl.

{
  // Check that this method can be used based on this POA's policies.
  this->validate_policies ();

  this->validate_priority (priority);

  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->create_reference_i (intf, priority);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 567 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 559 of file RT_POA.cpp.

TAO_Stub * TAO_RT_POA::create_stub_object ( const TAO::ObjectKey &  object_key,
const char *  type_id,
CORBA::PolicyList *  policy_list,
TAO_Acceptor_Filter filter,
TAO_PriorityBandedConnectionPolicy priority_bands 
) [protected]

Definition at line 325 of file RT_POA.cpp.

{
  bool error = false;

  // Count the number of endpoints.
  size_t const profile_count = this->endpoint_count ();

  // Create a profile container and have acceptor registries populate
  // it with profiles as appropriate.
  TAO_MProfile mprofile (0);

  // Allocate space for storing the profiles.  There can never be more
  // profiles than there are endpoints.  In some cases, there can be
  // less profiles than endpoints.
  int result =
    mprofile.set (static_cast <CORBA::ULong> (profile_count));
  if (result == -1)
    error = true;

  TAO_Thread_Lane **lanes =
    this->thread_pool_->lanes ();

  // Leave it to the filter to decide which acceptors/in which order
  // go into the mprofile.
  for (CORBA::ULong i = 0;
       i != this->thread_pool_->number_of_lanes () &&
         !error;
       ++i)
    {
      if (this->lane_required (lanes[i],
                               priority_bands))
        {
          TAO_Acceptor_Registry &acceptor_registry =
            lanes[i]->resources ().acceptor_registry ();

          result =
            filter->fill_profile (object_key,
                                  mprofile,
                                  acceptor_registry.begin (),
                                  acceptor_registry.end (),
                                  lanes[i]->lane_priority ());
          if (result == -1)
            error = true;
        }
    }

  if (!error)
    result = filter->encode_endpoints (mprofile);
  if (result == -1)
    error = 1;

  if (error)
    throw ::CORBA::INTERNAL (
      CORBA::SystemException::_tao_minor_code (
        TAO_MPROFILE_CREATION_ERROR,
        0),
      CORBA::COMPLETED_NO);

  // Make sure we have at least one profile.  <mp> may end up being
  // empty if none of the acceptor endpoints have the right priority
  // for this object, for example.
  if (mprofile.profile_count () == 0)
    throw ::CORBA::BAD_PARAM (
      CORBA::SystemException::_tao_minor_code (
        TAO_MPROFILE_CREATION_ERROR,
        0),
      CORBA::COMPLETED_NO);

  return
    this->orb_core_.create_stub_object (mprofile, type_id, policy_list);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 518 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::create_thread_policy (value);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 656 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 508 of file RT_POA.cpp.

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

size_t TAO_RT_POA::endpoint_count ( void   )  [protected]

Definition at line 402 of file RT_POA.cpp.

{
  size_t profile_count = 0;

  TAO_Thread_Lane **lanes =
    this->thread_pool_->lanes ();

  for (CORBA::ULong i = 0;
       i != this->thread_pool_->number_of_lanes ();
       ++i)
    profile_count +=
      lanes[i]->resources ().acceptor_registry ().endpoint_count ();

  return profile_count;
}

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

Reimplemented from TAO_Root_POA.

Definition at line 502 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::find_POA (adapter_name, activate_it);
}

PortableServer::Servant TAO_RT_POA::get_servant ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 627 of file RT_POA.cpp.

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

PortableServer::ServantManager_ptr TAO_RT_POA::get_servant_manager ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 615 of file RT_POA.cpp.

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

Reimplemented from TAO_Root_POA.

Definition at line 713 of file RT_POA.cpp.

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

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

Reimplemented from TAO_Root_POA.

Definition at line 707 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::id_to_reference (oid);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 701 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::id_to_servant (oid);
}

TAO_Stub * TAO_RT_POA::key_to_stub_i ( const TAO::ObjectKey &  key,
const char *  type_id,
CORBA::Short  priority 
) [protected, virtual]

Like key_to_stub() but assume that the ORB is not shutting down.

Reimplemented from TAO_Root_POA.

Definition at line 222 of file RT_POA.cpp.

{
  // Client exposed policies.
  CORBA::PolicyList_var client_exposed_policies =
    this->client_exposed_policies (priority);

  // Server protocol policy.
  CORBA::Policy_var protocol =
    this->policies ().get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL);

  RTCORBA::ServerProtocolPolicy_var server_protocol_policy =
    RTCORBA::ServerProtocolPolicy::_narrow (protocol.in ());

  TAO_ServerProtocolPolicy *server_protocol =
    dynamic_cast <TAO_ServerProtocolPolicy *> (server_protocol_policy.in ());

  // Filter for server protocol.
  TAO_Server_Protocol_Acceptor_Filter filter (server_protocol->protocols_rep ());

  // If this POA is using the default thread pool or a thread pool
  // without lanes, create the IOR with the acceptors in the thread
  // pool.
  if (this->thread_pool_ == 0 ||
      !this->thread_pool_->with_lanes ())
    {
      TAO_Acceptor_Registry *acceptor_registry = 0;

      if (this->thread_pool_ == 0)
        {
          TAO_Thread_Lane_Resources_Manager &thread_lane_resources_manager =
            this->orb_core_.thread_lane_resources_manager ();

          TAO_Thread_Lane_Resources &resources =
            thread_lane_resources_manager.default_lane_resources ();

          acceptor_registry = &resources.acceptor_registry ();
        }
      else
        {
          TAO_Thread_Lane **lanes = this->thread_pool_->lanes ();

          TAO_Thread_Lane_Resources &resources = lanes[0]->resources ();

          acceptor_registry = &resources.acceptor_registry ();
        }

      return
        this->TAO_Regular_POA::create_stub_object (object_key,
                                           type_id,
                                           client_exposed_policies._retn (),
                                           &filter,
                                           *acceptor_registry);
    }

  // If this POA has the SERVER_DECLARED policy, create the IOR with
  // the acceptors in the only thread lane that matches the priority
  // of the object.
  if (this->cached_policies_.priority_model () ==
      TAO::Portable_Server::Cached_Policies::SERVER_DECLARED)
    {
      TAO_Thread_Lane **lanes =
        this->thread_pool_->lanes ();

      for (CORBA::ULong i = 0;
           i != this->thread_pool_->number_of_lanes ();
           ++i)
        {
          if (lanes[i]->lane_priority () == priority)
            return this->TAO_Regular_POA::create_stub_object (object_key,
                                                      type_id,
                                                      client_exposed_policies._retn (),
                                                      &filter,
                                                      lanes[i]->resources ().acceptor_registry ()
                                                     );
        }

      ACE_ASSERT (0);
    }

  // If this POA has the CLIENT_PROPAGATED policy, create the IOR with
  // the acceptors in the thread lanes that matches the bands in this
  // POA.  If there are no bands, all the thread lanes are used.
  CORBA::Policy_var bands =
    this->policies ().get_cached_policy (
      TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION
     );

  RTCORBA::PriorityBandedConnectionPolicy_var priority_bands
    = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ());

  TAO_PriorityBandedConnectionPolicy *priority_bands_i =
    dynamic_cast <TAO_PriorityBandedConnectionPolicy *> (priority_bands.in ());

  return this->create_stub_object (object_key,
                                   type_id,
                                   client_exposed_policies._retn (),
                                   &filter,
                                   priority_bands_i);
}

int TAO_RT_POA::lane_required ( TAO_Thread_Lane lane,
TAO_PriorityBandedConnectionPolicy priority_bands 
) [protected]

Definition at line 419 of file RT_POA.cpp.

{
  if (priority_bands == 0)
    return 1;

  RTCORBA::PriorityBands &bands =
    priority_bands->priority_bands_rep ();

  for (CORBA::ULong i = 0;
       i < bands.length ();
       ++i)
    {
      if (bands[i].low <= lane->lane_priority () &&
          bands[i].high >= lane->lane_priority ())
        return 1;
    }

  return 0;
}

TAO_Root_POA * TAO_RT_POA::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 67 of file RT_POA.cpp.

{
  TAO_RT_POA *poa = 0;

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

  return poa;
}

void TAO_RT_POA::parse_rt_policies ( TAO_POA_Policy_Set policies  )  [protected]

Parse the policy list for RT policies and update our cached policy instance.

Definition at line 94 of file RT_POA.cpp.

{
  {
    CORBA::Policy_var policy =
      policies.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL);

    RTCORBA::PriorityModelPolicy_var priority_model =
      RTCORBA::PriorityModelPolicy::_narrow (policy.in ());

    if (!CORBA::is_nil (priority_model.in ()))
      {
        RTCORBA::PriorityModel rt_priority_model =
          priority_model->priority_model ();

        this->cached_policies_.priority_model (
          TAO::Portable_Server::Cached_Policies::PriorityModel (rt_priority_model));

        RTCORBA::Priority priority =
          priority_model->server_priority ();

        this->cached_policies_.server_priority (priority);
      }
  }

  this->thread_pool_ =
    TAO_POA_RT_Policy_Validator::extract_thread_pool (this->orb_core_,
                                                      policies.policies ());
}

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

Reimplemented from TAO_Root_POA.

Definition at line 695 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::reference_to_id (reference);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 689 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::reference_to_servant (reference);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 677 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::servant_to_id (p_servant);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 683 of file RT_POA.cpp.

{
  return this->TAO_Regular_POA::servant_to_reference (p_servant);
}

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

Reimplemented from TAO_Root_POA.

Definition at line 633 of file RT_POA.cpp.

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

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

Reimplemented from TAO_Root_POA.

Definition at line 621 of file RT_POA.cpp.

PortableServer::AdapterActivator_ptr TAO_RT_POA::the_activator ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 603 of file RT_POA.cpp.

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

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

Reimplemented from TAO_Root_POA.

Definition at line 609 of file RT_POA.cpp.

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

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

Reimplemented from TAO_Root_POA.

Definition at line 588 of file RT_POA.cpp.

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

char * TAO_RT_POA::the_name ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 576 of file RT_POA.cpp.

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

PortableServer::POA_ptr TAO_RT_POA::the_parent ( void   ) 

Reimplemented from TAO_Regular_POA.

Definition at line 582 of file RT_POA.cpp.

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

PortableServer::POAManager_ptr TAO_RT_POA::the_POAManager ( void   ) 

Reimplemented from TAO_Root_POA.

Definition at line 594 of file RT_POA.cpp.

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

void * TAO_RT_POA::thread_pool ( void   )  const [virtual]

Reimplemented from TAO_Root_POA.

Definition at line 108 of file RT_POA.inl.

{
  return this->thread_pool_;
}

void TAO_RT_POA::validate_policies ( void   )  [protected]

Definition at line 192 of file RT_POA.cpp.

{
  // For each of the above operations, if the POA supports the
  // IMPLICIT_ACTIVATION option for the ImplicitActivationPolicy then
  // the ORB shall raise a WrongPolicy user exception. This relieves
  // an ORB implementation of the need to retrieve the target object's
  // priority from "somewhere" when a request arrives for an inactive
  // object.
  if (this->cached_policies_.implicit_activation () ==
      PortableServer::IMPLICIT_ACTIVATION)
    {
      throw PortableServer::POA::WrongPolicy ();
    }

  // For each of the above operations, if the POA does not support the
  // SERVER_DECLARED option for the PriorityModelPolicy then the ORB
  // shall raise a WrongPolicy user exception.
  if (this->cached_policies_.priority_model () !=
      TAO::Portable_Server::Cached_Policies::SERVER_DECLARED)
    {
      throw PortableServer::POA::WrongPolicy ();
    }

  // In all other respects the semantics of the corresponding
  // (i.e. without the name extensions "_with_priority" and
  // "_and_priority") PortableServer::POA operations shall be
  // observed.
}

void TAO_RT_POA::validate_priority ( RTCORBA::Priority  priority  )  [protected]

Definition at line 124 of file RT_POA.cpp.

{
  if (priority < RTCORBA::minPriority
           // The line below will always be false unless the value of
           // RTCORBA::maxPriority, which is now assigned the value of
           // 32767, is changed in RTCORBA.pidl.
//      || priority > RTCORBA::maxPriority
     )
    {
      throw ::CORBA::BAD_PARAM ();
    }

  // If this POA is using a thread pool with lanes, make sure the
  // priority matches one of the thread lanes.  Note that in this
  // case, bands do not matter since matching the lanes priority is a
  // stricter condition than meeting the band ranges.  In addition,
  // when the POA was created, the bands had to match the lanes.
  if (this->thread_pool_ != 0 && this->thread_pool_->with_lanes ())
    {
      TAO_Thread_Lane **lanes = this->thread_pool_->lanes ();

      for (CORBA::ULong i = 0;
           i != this->thread_pool_->number_of_lanes ();
           ++i)
        {
          if (lanes[i]->lane_priority () == priority)
            return;
        }

      throw ::CORBA::BAD_PARAM ();
    }
  else
    // Else we are dealing with a thread pool without lanes.
    {
      // Check if we have bands.
      CORBA::Policy_var bands =
        this->policies ().get_cached_policy (
          TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION);

      RTCORBA::PriorityBandedConnectionPolicy_var priority_bands
        = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ());

      TAO_PriorityBandedConnectionPolicy *priority_bands_i =
        dynamic_cast <TAO_PriorityBandedConnectionPolicy *>
                          (priority_bands.in ());

      if (priority_bands_i)
        {
          // If we do have bands, make sure that the priority is
          // matching one of the bands.
          RTCORBA::PriorityBands &bands =
            priority_bands_i->priority_bands_rep ();

          for (CORBA::ULong i = 0;
               i < bands.length ();
               ++i)
            {
              if (bands[i].low <= priority &&
                  bands[i].high >= priority)
                return;
            }

          throw ::CORBA::BAD_PARAM ();
        }
    }
}


Member Data Documentation

Definition at line 229 of file RT_POA.h.


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