TAO_Notify_RT_POA_Helper Class Reference

Helper for creating RT POA objects. More...

#include <RT_POA_Helper.h>

Inheritance diagram for TAO_Notify_RT_POA_Helper:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_RT_POA_Helper:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~TAO_Notify_RT_POA_Helper ()
 Destructor.

void init (PortableServer::POA_ptr parent_poa, const char *poa_name, const NotifyExt::ThreadPoolParams &tp_params)
void init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolParams &tp_params)
void init (PortableServer::POA_ptr parent_poa, const char *poa_name, const NotifyExt::ThreadPoolLanesParams &tpl_params)
void init (PortableServer::POA_ptr parent_poa, const NotifyExt::ThreadPoolLanesParams &tpl_params)
void init (PortableServer::POA_ptr parent_poa)

Detailed Description

Helper for creating RT POA objects.

Definition at line 32 of file RT_POA_Helper.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_RT_POA_Helper::~TAO_Notify_RT_POA_Helper  ) 
 

Destructor.

Definition at line 16 of file RT_POA_Helper.cpp.

00017 {
00018 }


Member Function Documentation

void TAO_Notify_RT_POA_Helper::init PortableServer::POA_ptr  parent_poa  ) 
 

Create a new PortableServer::POA. The name is chosen at random. The CLIENT_PROPAGATED policy is applied to the new POA.

Reimplemented from TAO_Notify_POA_Helper.

Definition at line 147 of file RT_POA_Helper.cpp.

References ACE_CHECK, ACE_CString, ACE_ENV_ARG_PARAMETER, TAO_Notify_POA_Helper::create_i(), TAO_Notify_POA_Helper::get_unique_id(), TAO_Singleton< TYPE, ACE_LOCK >::instance(), and TAO::unbounded_object_reference_sequence< Policy, Policy_var >::length().

00148 {
00149   CORBA::PolicyList policy_list (1);
00150 
00151   RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
00152 
00153   policy_list.length (1);
00154 
00155   policy_list[0] =
00156     rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
00157                                           0
00158                                           ACE_ENV_ARG_PARAMETER);
00159   ACE_CHECK;
00160 
00161   ACE_CString child_poa_name = this->get_unique_id ();
00162 
00163   this->create_i (parent_poa, child_poa_name.c_str (), policy_list ACE_ENV_ARG_PARAMETER);
00164 }

void TAO_Notify_RT_POA_Helper::init PortableServer::POA_ptr  parent_poa,
const NotifyExt::ThreadPoolLanesParams &  tpl_params
 

Create a new PortableServer::POA. The name is chosen at random. The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread lane policy is applied to the new POA.

Definition at line 80 of file RT_POA_Helper.cpp.

References ACE_CString, ACE_ENV_ARG_PARAMETER, TAO_Notify_POA_Helper::get_unique_id(), and init().

00081 {
00082   ACE_CString child_poa_name = this->get_unique_id ();
00083 
00084   this->init (parent_poa, child_poa_name.c_str (), tpl_params ACE_ENV_ARG_PARAMETER);
00085 }

void TAO_Notify_RT_POA_Helper::init PortableServer::POA_ptr  parent_poa,
const char *  poa_name,
const NotifyExt::ThreadPoolLanesParams &  tpl_params
 

Create a new PortableServer::POA. The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread lane policy is applied to the new POA.

Definition at line 88 of file RT_POA_Helper.cpp.

References ACE_CHECK, ACE_DEBUG, ACE_ENV_ARG_PARAMETER, TAO_Notify_POA_Helper::create_i(), TAO_Singleton< TYPE, ACE_LOCK >::instance(), TAO::unbounded_object_reference_sequence< Policy, Policy_var >::length(), LM_DEBUG, TAO_Notify_POA_Helper::set_policy(), and TAO_debug_level.

00090 {
00091   CORBA::PolicyList policy_list (4);
00092 
00093   this->set_policy (parent_poa, policy_list ACE_ENV_ARG_PARAMETER);
00094   ACE_CHECK;
00095 
00096   RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
00097 
00098   RTCORBA::PriorityModel priority_model =
00099     tpl_params.priority_model == NotifyExt::CLIENT_PROPAGATED ?
00100     RTCORBA::CLIENT_PROPAGATED : RTCORBA::SERVER_DECLARED;
00101 
00102   policy_list.length (3);
00103   policy_list[2] =
00104     rt_orb->create_priority_model_policy (priority_model,
00105                                           tpl_params.server_priority
00106                                           ACE_ENV_ARG_PARAMETER);
00107   ACE_CHECK;
00108 
00109   // Populate RTCORBA Lanes.
00110   RTCORBA::ThreadpoolLanes lanes (tpl_params.lanes.length ());
00111   lanes.length (tpl_params.lanes.length ());
00112 
00113   for (CORBA::ULong index = 0; index < tpl_params.lanes.length (); ++index)
00114     {
00115       if (TAO_debug_level > 0)
00116             {
00117               ACE_DEBUG ((LM_DEBUG, "Creating threadpool lane %d: priority = %d, static threads = %d\n",
00118                           index, tpl_params.lanes[index].lane_priority, tpl_params.lanes[index].static_threads));
00119             }
00120 
00121       lanes[index].lane_priority = tpl_params.lanes[index].lane_priority;
00122       lanes[index].static_threads = tpl_params.lanes[index].static_threads;
00123       lanes[index].dynamic_threads = tpl_params.lanes[index].dynamic_threads;
00124     }
00125 
00126   // Create the thread-pool.
00127   RTCORBA::ThreadpoolId threadpool_id =
00128     rt_orb->create_threadpool_with_lanes (tpl_params.stacksize,
00129                                           lanes,
00130                                           tpl_params.allow_borrowing,
00131                                           tpl_params.allow_request_buffering,
00132                                           tpl_params.max_buffered_requests,
00133                                           tpl_params.max_request_buffer_size
00134                                           ACE_ENV_ARG_PARAMETER);
00135   ACE_CHECK;
00136 
00137   policy_list.length (4);
00138   policy_list[3] =
00139     rt_orb->create_threadpool_policy (threadpool_id
00140                                       ACE_ENV_ARG_PARAMETER);
00141   ACE_CHECK;
00142 
00143   this->create_i (parent_poa, poa_name, policy_list ACE_ENV_ARG_PARAMETER);
00144 }

void TAO_Notify_RT_POA_Helper::init PortableServer::POA_ptr  parent_poa,
const NotifyExt::ThreadPoolParams &  tp_params
 

Create a new PortableServer::POA. The name is chosen at random. The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread pool policy is applied to the new POA.

Definition at line 21 of file RT_POA_Helper.cpp.

References ACE_CString, ACE_ENV_ARG_PARAMETER, TAO_Notify_POA_Helper::get_unique_id(), and init().

00022 {
00023   ACE_CString child_poa_name = this->get_unique_id ();
00024 
00025   this->init (parent_poa, child_poa_name.c_str (), tp_params ACE_ENV_ARG_PARAMETER);
00026 }

void TAO_Notify_RT_POA_Helper::init PortableServer::POA_ptr  parent_poa,
const char *  poa_name,
const NotifyExt::ThreadPoolParams &  tp_params
 

Create a new PortableServer::POA. The UNIQUE_ID, USER_ID , CLIENT_PROPAGATED and thread pool policy is applied to the new POA.

Definition at line 29 of file RT_POA_Helper.cpp.

References ACE_CHECK, ACE_DEBUG, ACE_ENV_ARG_PARAMETER, TAO_Notify_POA_Helper::create_i(), TAO_Singleton< TYPE, ACE_LOCK >::instance(), TAO::unbounded_object_reference_sequence< Policy, Policy_var >::length(), LM_DEBUG, TAO_Notify_POA_Helper::set_policy(), and TAO_debug_level.

Referenced by TAO_Notify_RT_Builder::apply_lane_concurrency(), TAO_Notify_RT_Builder::apply_thread_pool_concurrency(), and init().

00031 {
00032   CORBA::PolicyList policy_list (4);
00033 
00034   this->set_policy (parent_poa, policy_list ACE_ENV_ARG_PARAMETER);
00035   ACE_CHECK;
00036 
00037   RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
00038 
00039   RTCORBA::PriorityModel priority_model =
00040     tp_params.priority_model == NotifyExt::CLIENT_PROPAGATED ?
00041     RTCORBA::CLIENT_PROPAGATED : RTCORBA::SERVER_DECLARED;
00042 
00043   if (TAO_debug_level > 0)
00044     ACE_DEBUG ((LM_DEBUG, "Priority Model = %d, Server prio = %d\n"
00045                 , tp_params.priority_model, tp_params.server_priority));
00046 
00047   policy_list.length (3);
00048   policy_list[2] =
00049     rt_orb->create_priority_model_policy (priority_model,
00050                                           tp_params.server_priority
00051                                           ACE_ENV_ARG_PARAMETER);
00052   ACE_CHECK;
00053 
00054   if (TAO_debug_level > 0)
00055     ACE_DEBUG ((LM_DEBUG, "Creating threadpool: static threads = %d, def. prio = %d\n"
00056                 , tp_params.static_threads, tp_params.default_priority));
00057 
00058   // Create the thread-pool.
00059   RTCORBA::ThreadpoolId threadpool_id =
00060     rt_orb->create_threadpool (tp_params.stacksize,
00061                                tp_params.static_threads,
00062                                tp_params.dynamic_threads,
00063                                tp_params.default_priority,
00064                                tp_params.allow_request_buffering,
00065                                tp_params.max_buffered_requests,
00066                                tp_params.max_request_buffer_size
00067                                ACE_ENV_ARG_PARAMETER);
00068   ACE_CHECK;
00069 
00070   policy_list.length (4);
00071   policy_list[3] =
00072     rt_orb->create_threadpool_policy (threadpool_id
00073                                       ACE_ENV_ARG_PARAMETER);
00074   ACE_CHECK;
00075 
00076   this->create_i (parent_poa, poa_name, policy_list ACE_ENV_ARG_PARAMETER);
00077 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:33:05 2006 for TAO_CosNotification by doxygen 1.3.6