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 (void)
 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 ( void   ) 

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 133 of file RT_POA_Helper.cpp.

References ACE_String_Base< CHAR >::c_str(), TAO_Notify_POA_Helper::create_i(), TAO_Notify_POA_Helper::get_unique_id(), TAO_Notify_RT_Properties::instance(), and TAO_Notify_RT_Properties::rt_orb().

00134 {
00135   CORBA::PolicyList policy_list (1);
00136 
00137   RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
00138 
00139   policy_list.length (1);
00140 
00141   policy_list[0] =
00142     rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED,
00143                                           0);
00144 
00145   ACE_CString child_poa_name = this->get_unique_id ();
00146 
00147   this->create_i (parent_poa, child_poa_name.c_str (), policy_list);
00148 }

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 73 of file RT_POA_Helper.cpp.

References ACE_String_Base< CHAR >::c_str(), TAO_Notify_POA_Helper::get_unique_id(), and init().

00074 {
00075   ACE_CString child_poa_name = this->get_unique_id ();
00076 
00077   this->init (parent_poa, child_poa_name.c_str (), tpl_params);
00078 }

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 81 of file RT_POA_Helper.cpp.

References ACE_DEBUG, TAO_Notify_POA_Helper::create_i(), TAO_Notify_RT_Properties::instance(), LM_DEBUG, TAO_Notify_RT_Properties::rt_orb(), TAO_Notify_POA_Helper::set_policy(), and TAO_debug_level.

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

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_String_Base< CHAR >::c_str(), 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);
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_DEBUG, TAO_Notify_POA_Helper::create_i(), TAO_Notify_RT_Properties::instance(), LM_DEBUG, TAO_Notify_RT_Properties::rt_orb(), 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);
00035 
00036   RTCORBA::RTORB_var rt_orb = TAO_Notify_RT_PROPERTIES::instance ()->rt_orb ();
00037 
00038   RTCORBA::PriorityModel priority_model =
00039     tp_params.priority_model == NotifyExt::CLIENT_PROPAGATED ?
00040     RTCORBA::CLIENT_PROPAGATED : RTCORBA::SERVER_DECLARED;
00041 
00042   if (TAO_debug_level > 0)
00043     ACE_DEBUG ((LM_DEBUG, "Priority Model = %d, Server prio = %d\n"
00044                 , tp_params.priority_model, tp_params.server_priority));
00045 
00046   policy_list.length (3);
00047   policy_list[2] =
00048     rt_orb->create_priority_model_policy (priority_model,
00049                                           tp_params.server_priority);
00050 
00051   if (TAO_debug_level > 0)
00052     ACE_DEBUG ((LM_DEBUG, "Creating threadpool: static threads = %d, def. prio = %d\n"
00053                 , tp_params.static_threads, tp_params.default_priority));
00054 
00055   // Create the thread-pool.
00056   RTCORBA::ThreadpoolId threadpool_id =
00057     rt_orb->create_threadpool (tp_params.stacksize,
00058                                tp_params.static_threads,
00059                                tp_params.dynamic_threads,
00060                                tp_params.default_priority,
00061                                tp_params.allow_request_buffering,
00062                                tp_params.max_buffered_requests,
00063                                tp_params.max_request_buffer_size);
00064 
00065   policy_list.length (4);
00066   policy_list[3] =
00067     rt_orb->create_threadpool_policy (threadpool_id);
00068 
00069   this->create_i (parent_poa, poa_name, policy_list);
00070 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:29 2010 for TAO_CosNotification by  doxygen 1.4.7