Public Member Functions | Protected Member Functions | Protected Attributes

TAO_RT_Protocols_Hooks Class Reference

#include <RT_Protocols_Hooks.h>

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

List of all members.

Public Member Functions

 TAO_RT_Protocols_Hooks (void)
 Constructor.
virtual ~TAO_RT_Protocols_Hooks (void)
 Destructor.
void init_hooks (TAO_ORB_Core *orb_core)
 Initialize the protocols hooks instance.
CORBA::Boolean set_client_network_priority (IOP::ProfileId protocol_tag, TAO_Stub *stub)
CORBA::Boolean set_server_network_priority (IOP::ProfileId protocol_tag, CORBA::Policy *policy)
void server_protocol_properties_at_orb_level (TAO_IIOP_Protocol_Properties &protocol_properties)
void client_protocol_properties_at_orb_level (TAO_IIOP_Protocol_Properties &protocol_properties)
void server_protocol_properties_at_orb_level (TAO_UIOP_Protocol_Properties &protocol_properties)
void client_protocol_properties_at_orb_level (TAO_UIOP_Protocol_Properties &protocol_properties)
void server_protocol_properties_at_orb_level (TAO_SHMIOP_Protocol_Properties &protocol_properties)
void client_protocol_properties_at_orb_level (TAO_SHMIOP_Protocol_Properties &protocol_properties)
void server_protocol_properties_at_orb_level (TAO_DIOP_Protocol_Properties &protocol_properties)
void client_protocol_properties_at_orb_level (TAO_DIOP_Protocol_Properties &protocol_properties)
void server_protocol_properties_at_orb_level (TAO_SCIOP_Protocol_Properties &protocol_properties)
void client_protocol_properties_at_orb_level (TAO_SCIOP_Protocol_Properties &protocol_properties)
CORBA::Long get_dscp_codepoint (void)
void get_selector_hook (CORBA::Policy *model_policy, CORBA::Boolean &is_client_propagated, CORBA::Short &server_priority)
void get_selector_bands_policy_hook (CORBA::Policy *bands_policy, CORBA::Short priority, CORBA::Short &min_priority, CORBA::Short &max_priority, bool &in_range)

int get_thread_CORBA_priority (CORBA::Short &priority)
int get_thread_native_priority (CORBA::Short &)
int get_thread_CORBA_and_native_priority (CORBA::Short &, CORBA::Short &)
int get_thread_implicit_CORBA_priority (CORBA::Short &)
int set_thread_CORBA_priority (CORBA::Short)
int restore_thread_CORBA_and_native_priority (CORBA::Short, CORBA::Short)

Protected Member Functions

int set_thread_native_priority (CORBA::Short)
RTCORBA::ProtocolProperties_ptr server_protocol_properties (IOP::ProfileId protocol_tag, CORBA::Policy_ptr policy)
RTCORBA::ProtocolProperties_ptr client_protocol_properties (IOP::ProfileId protocol_tag, CORBA::Policy_ptr policy)
RTCORBA::ProtocolProperties_ptr server_protocol_properties_at_orb_level (IOP::ProfileId protocol_tag)
RTCORBA::ProtocolProperties_ptr client_protocol_properties_at_orb_level (IOP::ProfileId protocol_tag)
RTCORBA::ProtocolProperties_ptr client_protocol_properties_at_object_level (IOP::ProfileId protocol_tag, TAO_Stub *stub)
void extract_protocol_properties (TAO_IIOP_Protocol_Properties &to, RTCORBA::ProtocolProperties_ptr from)
void extract_protocol_properties (TAO_UIOP_Protocol_Properties &to, RTCORBA::ProtocolProperties_ptr from)
void extract_protocol_properties (TAO_SHMIOP_Protocol_Properties &to, RTCORBA::ProtocolProperties_ptr from)
void extract_protocol_properties (TAO_DIOP_Protocol_Properties &to, RTCORBA::ProtocolProperties_ptr from)
void extract_protocol_properties (TAO_SCIOP_Protocol_Properties &to, RTCORBA::ProtocolProperties_ptr from)
CORBA::Boolean set_network_priority (IOP::ProfileId protocol_tag, RTCORBA::ProtocolProperties_ptr protocol_properties)

Protected Attributes

TAO_ORB_Coreorb_core_
TAO_Priority_Mapping_Manager_var mapping_manager_
TAO_Network_Priority_Mapping_Manager_var network_mapping_manager_
RTCORBA::Current_var current_

Detailed Description

Definition at line 36 of file RT_Protocols_Hooks.h.


Constructor & Destructor Documentation

TAO_RT_Protocols_Hooks::TAO_RT_Protocols_Hooks ( void   ) 

Constructor.

Definition at line 33 of file RT_Protocols_Hooks.cpp.

  : orb_core_ (0)
  , current_ ()
{
}

TAO_RT_Protocols_Hooks::~TAO_RT_Protocols_Hooks ( void   )  [virtual]

Destructor.

Definition at line 40 of file RT_Protocols_Hooks.cpp.

{
}


Member Function Documentation

RTCORBA::ProtocolProperties_ptr TAO_RT_Protocols_Hooks::client_protocol_properties ( IOP::ProfileId  protocol_tag,
CORBA::Policy_ptr  policy 
) [protected]

Definition at line 109 of file RT_Protocols_Hooks.cpp.

{
  if (CORBA::is_nil (policy))
    return RTCORBA::ProtocolProperties::_nil ();

  RTCORBA::ClientProtocolPolicy_var client_protocol_policy =
    RTCORBA::ClientProtocolPolicy::_narrow (policy);

  if (CORBA::is_nil (client_protocol_policy.in ()))
    return RTCORBA::ProtocolProperties::_nil ();

  TAO_ClientProtocolPolicy *client_protocols =
    dynamic_cast<TAO_ClientProtocolPolicy *> (client_protocol_policy.in ());

  if (client_protocols == 0)
    return RTCORBA::ProtocolProperties::_nil ();

  // TAO_ClientProtocolPolicy
  RTCORBA::ProtocolList &protocols =
    client_protocols->protocols_rep ();

  for (CORBA::ULong j = 0; j < protocols.length (); ++j)
    {
      if (protocols[j].protocol_type == protocol_tag)
        {
          return RTCORBA::ProtocolProperties::_duplicate (
                  protocols[j].transport_protocol_properties.in ());
        }
    }

  return RTCORBA::ProtocolProperties::_nil ();
}

RTCORBA::ProtocolProperties_ptr TAO_RT_Protocols_Hooks::client_protocol_properties_at_object_level ( IOP::ProfileId  protocol_tag,
TAO_Stub stub 
) [protected]

Definition at line 164 of file RT_Protocols_Hooks.cpp.

{
  CORBA::Policy_var policy =
    stub->get_cached_policy (TAO_CACHED_POLICY_RT_CLIENT_PROTOCOL);

  return this->client_protocol_properties (protocol_tag, policy.in ());
}

void TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( TAO_SHMIOP_Protocol_Properties protocol_properties  )  [virtual]
void TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( TAO_DIOP_Protocol_Properties protocol_properties  )  [virtual]
void TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( TAO_UIOP_Protocol_Properties protocol_properties  )  [virtual]
void TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( TAO_SCIOP_Protocol_Properties protocol_properties  )  [virtual]
RTCORBA::ProtocolProperties_ptr TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( IOP::ProfileId  protocol_tag  )  [protected]

Definition at line 154 of file RT_Protocols_Hooks.cpp.

void TAO_RT_Protocols_Hooks::client_protocol_properties_at_orb_level ( TAO_IIOP_Protocol_Properties protocol_properties  )  [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 200 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::ProtocolProperties_var from =
    this->client_protocol_properties_at_orb_level (IOP::TAG_INTERNET_IOP);

  if (!CORBA::is_nil (from.in ()))
    this->extract_protocol_properties (to, from.in ());
}

void TAO_RT_Protocols_Hooks::extract_protocol_properties ( TAO_DIOP_Protocol_Properties to,
RTCORBA::ProtocolProperties_ptr  from 
) [protected]

Definition at line 279 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::UserDatagramProtocolProperties_var protocol_properties =
    RTCORBA::UserDatagramProtocolProperties::_narrow (from);

  to.enable_network_priority_ = protocol_properties->enable_network_priority ();
  to.send_buffer_size_ = protocol_properties->send_buffer_size ();
  to.recv_buffer_size_ = protocol_properties->recv_buffer_size ();
}

void TAO_RT_Protocols_Hooks::extract_protocol_properties ( TAO_SCIOP_Protocol_Properties to,
RTCORBA::ProtocolProperties_ptr  from 
) [protected]

Definition at line 314 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::StreamControlProtocolProperties_var protocol_properties =
    RTCORBA::StreamControlProtocolProperties::_narrow (from);

  to.send_buffer_size_ = protocol_properties->send_buffer_size ();
  to.recv_buffer_size_ = protocol_properties->recv_buffer_size ();
  to.keep_alive_ = protocol_properties->keep_alive ();
  to.dont_route_ = protocol_properties->dont_route ();
  to.no_delay_ = protocol_properties->no_delay ();
  to.enable_network_priority_ = protocol_properties->enable_network_priority ();
}

void TAO_RT_Protocols_Hooks::extract_protocol_properties ( TAO_SHMIOP_Protocol_Properties to,
RTCORBA::ProtocolProperties_ptr  from 
) [protected]

Definition at line 244 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::SharedMemoryProtocolProperties_var protocol_properties =
    RTCORBA::SharedMemoryProtocolProperties::_narrow (from);

  to.preallocate_buffer_size_ = protocol_properties->preallocate_buffer_size ();
  to.mmap_filename_ = protocol_properties->mmap_filename ();
  to.mmap_lockname_ = protocol_properties->mmap_lockname ();
}

void TAO_RT_Protocols_Hooks::extract_protocol_properties ( TAO_IIOP_Protocol_Properties to,
RTCORBA::ProtocolProperties_ptr  from 
) [protected]

Definition at line 175 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::TCPProtocolProperties_var protocol_properties =
    RTCORBA::TCPProtocolProperties::_narrow (from);

  to.send_buffer_size_ = protocol_properties->send_buffer_size ();
  to.recv_buffer_size_ = protocol_properties->recv_buffer_size ();
  to.keep_alive_ = protocol_properties->keep_alive ();
  to.dont_route_ = protocol_properties->dont_route ();
  to.no_delay_ = protocol_properties->no_delay ();
  to.enable_network_priority_ = protocol_properties->enable_network_priority ();
}

void TAO_RT_Protocols_Hooks::extract_protocol_properties ( TAO_UIOP_Protocol_Properties to,
RTCORBA::ProtocolProperties_ptr  from 
) [protected]

Definition at line 210 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::UnixDomainProtocolProperties_var protocol_properties =
    RTCORBA::UnixDomainProtocolProperties::_narrow (from);

  to.send_buffer_size_ = protocol_properties->send_buffer_size ();
  to.recv_buffer_size_ = protocol_properties->recv_buffer_size ();
}

CORBA::Long TAO_RT_Protocols_Hooks::get_dscp_codepoint ( void   )  [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 417 of file RT_Protocols_Hooks.cpp.

{
  if (TAO_debug_level)
    ACE_DEBUG ((LM_DEBUG,
                "TAO_RT_Protocols_Hooks::get_dscp_codepoint\n"));

  CORBA::Long codepoint = 0;

  try
    {
      // Make several invocation, changing the priority of this thread
      // for each.

      RTCORBA::NetworkPriorityMapping *pm =
        this->network_mapping_manager_->mapping ();

      CORBA::Short const priority = this->current_->the_priority ();

      if (pm->to_network (priority, codepoint) == 0)
        {
          if (TAO_debug_level > 0)
            {
              ACE_ERROR ((LM_ERROR,
                          "Cannot convert corba priority %d "
                          "to network priority\n",
                          priority));
            }

          return -1;
        }
    }
  catch (const ::CORBA::Exception& ex)
    {
      if (TAO_debug_level > 0)
        {
          ex._tao_print_exception (
            "TAO_RT_Protocols_Hooks::get_dscp_codepoint");
        }

      return -1;
    }

  return codepoint;
}

void TAO_RT_Protocols_Hooks::get_selector_bands_policy_hook ( CORBA::Policy bands_policy,
CORBA::Short  priority,
CORBA::Short min_priority,
CORBA::Short max_priority,
bool &  in_range 
) [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 488 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::PriorityBandedConnectionPolicy_var bands_policy_ptr =
    RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands_policy);

  TAO_PriorityBandedConnectionPolicy *priority_bands_policy =
    static_cast<TAO_PriorityBandedConnectionPolicy *> (bands_policy_ptr.in ());

  // Find the band with the range covering our target priority.
  RTCORBA::PriorityBands &bands =
    priority_bands_policy->priority_bands_rep ();

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

          in_range = true;
          break;
        }
    }
}

void TAO_RT_Protocols_Hooks::get_selector_hook ( CORBA::Policy model_policy,
CORBA::Boolean is_client_propagated,
CORBA::Short server_priority 
) [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 463 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::PriorityModelPolicy_var model_policy_ptr =
    RTCORBA::PriorityModelPolicy::_narrow (model_policy);

  TAO_PriorityModelPolicy *priority_model_policy =
    static_cast<TAO_PriorityModelPolicy *> (model_policy_ptr.in ());

  if (priority_model_policy->get_priority_model () == RTCORBA::CLIENT_PROPAGATED)
    {
      is_client_propagated = true;
    }

  if (!is_client_propagated)
    {
      server_priority = priority_model_policy->server_priority ();
    }

  return;
}

int TAO_RT_Protocols_Hooks::get_thread_CORBA_and_native_priority ( CORBA::Short priority,
CORBA::Short native_priority 
) [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 551 of file RT_Protocols_Hooks.cpp.

{
  if (this->get_thread_native_priority (native_priority) == -1)
    {
      return -1;
    }

  if (this->get_thread_CORBA_priority (priority) == -1)
    {
      // This thread had an unset CORBA priority - as this method
      // should only be used to get and restore the state of play before and
      // after invocations that might be OK for all I know. Or care frankly.
      priority = -1;
    }

  return 0;
}

int TAO_RT_Protocols_Hooks::get_thread_CORBA_priority ( CORBA::Short priority  )  [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 520 of file RT_Protocols_Hooks.cpp.

int TAO_RT_Protocols_Hooks::get_thread_implicit_CORBA_priority ( CORBA::Short priority  )  [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 572 of file RT_Protocols_Hooks.cpp.

{
  TAO_Priority_Mapping *pm =
    this->mapping_manager_.in ()->mapping ();

  CORBA::Short native_priority = 0;
  if (this->get_thread_native_priority (native_priority) == 0 &&
      pm->to_CORBA (native_priority, priority))
    {
      return 0;
    }

  return -1;
}

int TAO_RT_Protocols_Hooks::get_thread_native_priority ( CORBA::Short native_priority  )  [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 528 of file RT_Protocols_Hooks.cpp.

{
  ACE_hthread_t current;
  ACE_Thread::self (current);

  int priority;

  if (ACE_Thread::getprio (current, priority) == -1)
    {
      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("TAO (%P|%t) - ")
                  ACE_TEXT ("RT_Protocols_Hooks::get_thread_native_priority: ")
                  ACE_TEXT (" ACE_Thread::get_prio failed\n")));

      return -1;
    }

  native_priority = CORBA::Short (priority);
  return 0;
}

void TAO_RT_Protocols_Hooks::init_hooks ( TAO_ORB_Core orb_core  )  [virtual]

Initialize the protocols hooks instance.

Implements TAO_Protocols_Hooks.

Definition at line 45 of file RT_Protocols_Hooks.cpp.

{
  this->orb_core_ = orb_core;

  // Save a reference to the priority mapping manager.
  CORBA::Object_var obj =
    orb_core->object_ref_table ().resolve_initial_reference (
      TAO_OBJID_PRIORITYMAPPINGMANAGER);

  this->mapping_manager_ =
    TAO_Priority_Mapping_Manager::_narrow (obj.in ());

  // Save a reference to the priority mapping manager.
  CORBA::Object_var object =
    orb_core->object_ref_table ().resolve_initial_reference (
      TAO_OBJID_NETWORKPRIORITYMAPPINGMANAGER);

  this->network_mapping_manager_ =
    TAO_Network_Priority_Mapping_Manager::_narrow (object.in ());

  object =
    this->orb_core_->object_ref_table ().resolve_initial_reference (
      TAO_OBJID_RTCURRENT);

  this->current_ = RTCORBA::Current::_narrow (object.in ());

}

int TAO_RT_Protocols_Hooks::restore_thread_CORBA_and_native_priority ( CORBA::Short  priority,
CORBA::Short  native_priority 
) [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 588 of file RT_Protocols_Hooks.cpp.

{
  // Only used for restoration of values that were previously set /
  // checked when so no need to re-apply the mapping.
  int result = this->set_thread_native_priority (native_priority);

  if (result == 0)
    TAO_TSS_Resources::instance ()->rtcorba_current_priority_ = priority;

  return result;
}

RTCORBA::ProtocolProperties_ptr TAO_RT_Protocols_Hooks::server_protocol_properties ( IOP::ProfileId  protocol_tag,
CORBA::Policy_ptr  policy 
) [protected]

Definition at line 74 of file RT_Protocols_Hooks.cpp.

{
  if (CORBA::is_nil (policy))
    return RTCORBA::ProtocolProperties::_nil ();

  RTCORBA::ServerProtocolPolicy_var server_protocol_policy =
    RTCORBA::ServerProtocolPolicy::_narrow (policy);

  if (CORBA::is_nil (server_protocol_policy.in ()))
    return RTCORBA::ProtocolProperties::_nil ();

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

  if (server_protocols == 0)
    return RTCORBA::ProtocolProperties::_nil ();

  // TAO_ServerProtocolPolicy
  RTCORBA::ProtocolList &protocols =
    server_protocols->protocols_rep ();

  for (CORBA::ULong j = 0; j < protocols.length (); ++j)
    {
      if (protocols[j].protocol_type == protocol_tag)
        {
          return RTCORBA::ProtocolProperties::_duplicate (
                  protocols[j].transport_protocol_properties.in ());
        }
    }

  return RTCORBA::ProtocolProperties::_nil ();
}

void TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( TAO_IIOP_Protocol_Properties protocol_properties  )  [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 190 of file RT_Protocols_Hooks.cpp.

{
  RTCORBA::ProtocolProperties_var from =
    this->server_protocol_properties_at_orb_level (IOP::TAG_INTERNET_IOP);

  if (!CORBA::is_nil (from.in ()))
    this->extract_protocol_properties (to, from.in ());
}

void TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( TAO_SCIOP_Protocol_Properties protocol_properties  )  [virtual]
void TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( TAO_SHMIOP_Protocol_Properties protocol_properties  )  [virtual]
RTCORBA::ProtocolProperties_ptr TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( IOP::ProfileId  protocol_tag  )  [protected]

Definition at line 144 of file RT_Protocols_Hooks.cpp.

void TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( TAO_UIOP_Protocol_Properties protocol_properties  )  [virtual]
void TAO_RT_Protocols_Hooks::server_protocol_properties_at_orb_level ( TAO_DIOP_Protocol_Properties protocol_properties  )  [virtual]
CORBA::Boolean TAO_RT_Protocols_Hooks::set_client_network_priority ( IOP::ProfileId  protocol_tag,
TAO_Stub stub 
) [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 387 of file RT_Protocols_Hooks.cpp.

{
  if (protocol_tag != IOP::TAG_INTERNET_IOP &&
      protocol_tag != TAO_TAG_DIOP_PROFILE &&
      protocol_tag != TAO_TAG_SCIOP_PROFILE)
    return false;

  RTCORBA::ProtocolProperties_var protocol_properties =
    this->client_protocol_properties_at_object_level (protocol_tag, stub);

  return this->set_network_priority (protocol_tag, protocol_properties.in ());
}

CORBA::Boolean TAO_RT_Protocols_Hooks::set_network_priority ( IOP::ProfileId  protocol_tag,
RTCORBA::ProtocolProperties_ptr  protocol_properties 
) [protected]

Definition at line 352 of file RT_Protocols_Hooks.cpp.

{
  if (CORBA::is_nil (protocol_properties))
      return false;

  if (protocol_tag == IOP::TAG_INTERNET_IOP)
    {
      RTCORBA::TCPProtocolProperties_var tcp_protocol_properties =
        RTCORBA::TCPProtocolProperties::_narrow (protocol_properties);

      return tcp_protocol_properties->enable_network_priority ();
    }

  if (protocol_tag == TAO_TAG_DIOP_PROFILE)
    {
      RTCORBA::UserDatagramProtocolProperties_var udp_protocol_properties =
        RTCORBA::UserDatagramProtocolProperties::_narrow (protocol_properties);

      return udp_protocol_properties->enable_network_priority ();
    }

  if (protocol_tag == TAO_TAG_SCIOP_PROFILE)
    {
      RTCORBA::StreamControlProtocolProperties_var sctp_protocol_properties =
        RTCORBA::StreamControlProtocolProperties::_narrow (protocol_properties);

      return sctp_protocol_properties->enable_network_priority ();
    }

  return false;
}

CORBA::Boolean TAO_RT_Protocols_Hooks::set_server_network_priority ( IOP::ProfileId  protocol_tag,
CORBA::Policy policy 
) [virtual]

Implements TAO_Protocols_Hooks.

Definition at line 402 of file RT_Protocols_Hooks.cpp.

{
  if (protocol_tag != IOP::TAG_INTERNET_IOP &&
      protocol_tag != TAO_TAG_DIOP_PROFILE &&
      protocol_tag != TAO_TAG_SCIOP_PROFILE)
    return false;

  RTCORBA::ProtocolProperties_var protocol_properties =
    this->server_protocol_properties (protocol_tag, policy);

  return this->set_network_priority (protocol_tag, protocol_properties.in ());
}

int TAO_RT_Protocols_Hooks::set_thread_CORBA_priority ( CORBA::Short  priority  )  [virtual]

Accessor and modifier to the current thread priority, used to implement the RTCORBA::Current interface, but it is faster for some critical components.

Implements TAO_Protocols_Hooks.

Definition at line 604 of file RT_Protocols_Hooks.cpp.

{
  TAO_Priority_Mapping *priority_mapping =
    this->mapping_manager_.in ()->mapping ();

  CORBA::Short native_priority;

  if (priority_mapping->to_native (priority, native_priority) == 0)
    {
      return -1;
    }

  return this->restore_thread_CORBA_and_native_priority (priority,
                                                         native_priority);
}

int TAO_RT_Protocols_Hooks::set_thread_native_priority ( CORBA::Short  native_priority  )  [protected]

Definition at line 621 of file RT_Protocols_Hooks.cpp.

{
  ACE_hthread_t current;
  ACE_Thread::self (current);

  if (ACE_Thread::setprio (current, native_priority) == -1)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("(%N,%l) Error setting thread ")
                         ACE_TEXT ("priority to %d, errno %d %m\n"),
                         native_priority,
                         ACE_ERRNO_GET),
                       -1);
    }

  return 0;
}


Member Data Documentation

RTCORBA::Current_var TAO_RT_Protocols_Hooks::current_ [protected]

Definition at line 159 of file RT_Protocols_Hooks.h.

Definition at line 156 of file RT_Protocols_Hooks.h.

Definition at line 157 of file RT_Protocols_Hooks.h.

Definition at line 153 of file RT_Protocols_Hooks.h.


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