TAO_CEC_Default_Factory Class Reference

A generic factory for EC experimentation. More...

#include <CEC_Default_Factory.h>

Inheritance diagram for TAO_CEC_Default_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_CEC_Default_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_CEC_Default_Factory (void)
 Constructor.
virtual ~TAO_CEC_Default_Factory (void)
 destructor...
virtual int init (int argc, ACE_TCHAR *argv[])
virtual int fini (void)
virtual TAO_CEC_Dispatchingcreate_dispatching (TAO_CEC_EventChannel *)
 Create and destroy the dispatching module.
virtual void destroy_dispatching (TAO_CEC_Dispatching *)
virtual TAO_CEC_Pulling_Strategycreate_pulling_strategy (TAO_CEC_EventChannel *)
 Create and destroy the pulling strategy.
virtual void destroy_pulling_strategy (TAO_CEC_Pulling_Strategy *)
virtual TAO_CEC_ConsumerAdmincreate_consumer_admin (TAO_CEC_EventChannel *)
 Create and destroy the consumer admin implementation.
virtual void destroy_consumer_admin (TAO_CEC_ConsumerAdmin *)
virtual TAO_CEC_SupplierAdmincreate_supplier_admin (TAO_CEC_EventChannel *)
 Create and destroy the supplier admin implementation.
virtual void destroy_supplier_admin (TAO_CEC_SupplierAdmin *)
virtual TAO_CEC_ProxyPushSuppliercreate_proxy_push_supplier (TAO_CEC_EventChannel *)
 Create and destroy a ProxyPushSupplier.
virtual void destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier *)
virtual TAO_CEC_ProxyPullSuppliercreate_proxy_pull_supplier (TAO_CEC_EventChannel *)
 Create and destroy a ProxyPullSupplier.
virtual void destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier *)
virtual TAO_CEC_ProxyPushConsumercreate_proxy_push_consumer (TAO_CEC_EventChannel *)
 Create and destroy a ProxyPushConsumer.
virtual void destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer *)
virtual TAO_CEC_ProxyPullConsumercreate_proxy_pull_consumer (TAO_CEC_EventChannel *)
 Create and destroy a ProxyPullConsumer.
virtual void destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer *)
virtual TAO_CEC_ProxyPushConsumer_Collectioncreate_proxy_push_consumer_collection (TAO_CEC_EventChannel *)
 Create and destroy a collection of TAO_CEC_ProxyPushConsumers.
virtual void destroy_proxy_push_consumer_collection (TAO_CEC_ProxyPushConsumer_Collection *)
virtual TAO_CEC_ProxyPullConsumer_Collectioncreate_proxy_pull_consumer_collection (TAO_CEC_EventChannel *)
 Create and destroy a collection of TAO_CEC_ProxyPullConsumers.
virtual void destroy_proxy_pull_consumer_collection (TAO_CEC_ProxyPullConsumer_Collection *)
virtual TAO_CEC_ProxyPushSupplier_Collectioncreate_proxy_push_supplier_collection (TAO_CEC_EventChannel *)
 Create and destroy a collection of TAO_CEC_ProxyPushSuppliers.
virtual void destroy_proxy_push_supplier_collection (TAO_CEC_ProxyPushSupplier_Collection *)
virtual TAO_CEC_ProxyPullSupplier_Collectioncreate_proxy_pull_supplier_collection (TAO_CEC_EventChannel *)
 Create and destroy a collection of TAO_CEC_ProxyPullSuppliers.
virtual void destroy_proxy_pull_supplier_collection (TAO_CEC_ProxyPullSupplier_Collection *)
virtual ACE_Lockcreate_consumer_lock (void)
virtual void destroy_consumer_lock (ACE_Lock *)
virtual ACE_Lockcreate_supplier_lock (void)
virtual void destroy_supplier_lock (ACE_Lock *)
virtual TAO_CEC_ConsumerControlcreate_consumer_control (TAO_CEC_EventChannel *)
virtual void destroy_consumer_control (TAO_CEC_ConsumerControl *)
virtual TAO_CEC_SupplierControlcreate_supplier_control (TAO_CEC_EventChannel *)
virtual void destroy_supplier_control (TAO_CEC_SupplierControl *)
virtual CORBA::Policy_ptr create_roundtrip_timeout_policy (const ACE_Time_Value &timeout)

Static Public Member Functions

static int init_svcs (void)

Private Member Functions

int parse_collection_arg (ACE_TCHAR *opt)
 Parse an argument to set the type of collections used.

Private Attributes

int dispatching_
 Several flags to control the kind of object created.
int pulling_strategy_
int consumer_collection_
int supplier_collection_
int consumer_lock_
int supplier_lock_
int dispatching_threads_
int dispatching_threads_flags_
int dispatching_threads_priority_
int dispatching_threads_force_active_
int reactive_pulling_period_
char * orbid_
 Use this ORB to locate global resources.
int orbid_dupped_
 Indicate ORB ID has been duplicated (memory allocated).
int consumer_control_
 The consumer and supplier control policies.
int supplier_control_
int consumer_control_period_
 The consumer and supplier control periods in usecs.
int supplier_control_period_
ACE_Time_Value consumer_control_timeout_
 The consumer and supplier control timeout in usecs.
ACE_Time_Value supplier_control_timeout_
ACE_Time_Value consumer_timeout_
ACE_Time_Value supplier_timeout_
unsigned int proxy_disconnect_retries_
 The number of retries before disconnecting a proxy.

Detailed Description

A generic factory for EC experimentation.

This class allows the user to experiment with different EC configurations. Using a command-line like interface the user can specify which strategies will this factory generate. Since the class can be dynamically loaded the strategies can be set in the service configurator file. = MEMORY MANAGMENT

Definition at line 44 of file CEC_Default_Factory.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_CEC_Default_Factory::TAO_CEC_Default_Factory ( void   ) 

Constructor.

Definition at line 8 of file CEC_Default_Factory.inl.

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_CEC_Default_Factory::~TAO_CEC_Default_Factory ( void   )  [virtual]

destructor...

Definition at line 50 of file CEC_Default_Factory.cpp.

References ACE_OS::free().

00051 {
00052     if (orbid_dupped_ != 0)
00053       {
00054         ACE_OS::free (orbid_);
00055       }
00056 }


Member Function Documentation

TAO_CEC_ConsumerAdmin * TAO_CEC_Default_Factory::create_consumer_admin ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy the consumer admin implementation.

Implements TAO_CEC_Factory.

Definition at line 499 of file CEC_Default_Factory.cpp.

00500 {
00501   return new TAO_CEC_ConsumerAdmin (ec);
00502 }

TAO_CEC_ConsumerControl * TAO_CEC_Default_Factory::create_consumer_control ( TAO_CEC_EventChannel  )  [virtual]

The ConsumerControl and SupplierControl strategies are used to discard non-existent consumers and suppliers

Implements TAO_CEC_Factory.

Definition at line 1279 of file CEC_Default_Factory.cpp.

References TAO_Pseudo_Var_T< T >::in(), and CORBA::ORB_init().

01280 {
01281   if (this->consumer_control_ == 0)
01282     return new TAO_CEC_ConsumerControl ();
01283   else if (this->consumer_control_ == 1)
01284     {
01285       int argc = 0;
01286       char **argv = 0;
01287       CORBA::ORB_var orb =
01288         CORBA::ORB_init (argc, argv, this->orbid_);
01289 
01290       ACE_Time_Value rate (0, this->consumer_control_period_);
01291       return new TAO_CEC_Reactive_ConsumerControl (
01292                                  rate, this->consumer_control_timeout_,
01293                                  this->proxy_disconnect_retries_,
01294                                  ec, orb.in ());
01295     }
01296   return 0;
01297 }

ACE_Lock * TAO_CEC_Default_Factory::create_consumer_lock ( void   )  [virtual]

Create and destroy the locking strategies for both ProxyPushConsumers and ProxyPushSuppliers

Implements TAO_CEC_Factory.

Definition at line 1243 of file CEC_Default_Factory.cpp.

01244 {
01245   if (this->consumer_lock_ == 0)
01246     return new ACE_Lock_Adapter<ACE_Null_Mutex>;
01247   else if (this->consumer_lock_ == 1)
01248     return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
01249   else if (this->consumer_lock_ == 2)
01250     return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
01251   return 0;
01252 }

TAO_CEC_Dispatching * TAO_CEC_Default_Factory::create_dispatching ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy the dispatching module.

Implements TAO_CEC_Factory.

Definition at line 441 of file CEC_Default_Factory.cpp.

00442 {
00443   if (this->dispatching_ == 0)
00444     return new TAO_CEC_Reactive_Dispatching ();
00445   else if (this->dispatching_ == 1)
00446     return new TAO_CEC_MT_Dispatching (this->dispatching_threads_,
00447                                       this->dispatching_threads_flags_,
00448                                       this->dispatching_threads_priority_,
00449                                       this->dispatching_threads_force_active_);
00450   return 0;
00451 }

TAO_CEC_ProxyPullConsumer * TAO_CEC_Default_Factory::create_proxy_pull_consumer ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a ProxyPullConsumer.

Implements TAO_CEC_Factory.

Definition at line 635 of file CEC_Default_Factory.cpp.

References ACE_NEW_RETURN, supplier_control_, supplier_timeout_, and ACE_Time_Value::zero.

00636 {
00637   TAO_CEC_ProxyPullConsumer *created;
00638   ACE_Time_Value timeout = this->supplier_control_ ? this->supplier_timeout_
00639     : ACE_Time_Value::zero;
00640   ACE_NEW_RETURN (created, TAO_CEC_ProxyPullConsumer (ec, timeout), 0);
00641   return created;
00642 }

TAO_CEC_ProxyPullConsumer_Collection * TAO_CEC_Default_Factory::create_proxy_pull_consumer_collection ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a collection of TAO_CEC_ProxyPullConsumers.

Implements TAO_CEC_Factory.

Definition at line 875 of file CEC_Default_Factory.cpp.

References ACE_NULL_SYNCH, ACE_SYNCH, and TAO_SYNCH_MUTEX.

00876 {
00877   if (this->consumer_collection_ == 0x000)
00878     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
00879       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00880       TAO_CEC_PullConsumer_List_Iterator,
00881       TAO_SYNCH_MUTEX> ();
00882   else if (this->consumer_collection_ == 0x001)
00883     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
00884       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00885       TAO_CEC_PullConsumer_List_Iterator,
00886       TAO_SYNCH_MUTEX> ();
00887   else if (this->consumer_collection_ == 0x002)
00888     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
00889       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00890       TAO_CEC_PullConsumer_List_Iterator,
00891       ACE_SYNCH> ();
00892   else if (this->consumer_collection_ == 0x003)
00893     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
00894       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00895       TAO_CEC_PullConsumer_List_Iterator,
00896       ACE_SYNCH> ();
00897   else if (this->consumer_collection_ == 0x010)
00898     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
00899       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00900       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00901       TAO_SYNCH_MUTEX> ();
00902   else if (this->consumer_collection_ == 0x011)
00903     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
00904       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00905       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00906       TAO_SYNCH_MUTEX> ();
00907   else if (this->consumer_collection_ == 0x012)
00908     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
00909       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00910       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00911       ACE_SYNCH> ();
00912   else if (this->consumer_collection_ == 0x013)
00913     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
00914       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00915       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00916       ACE_SYNCH> ();
00917   else if (this->consumer_collection_ == 0x100)
00918     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
00919       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00920       TAO_CEC_PullConsumer_List_Iterator,
00921       ACE_Null_Mutex> ();
00922   else if (this->consumer_collection_ == 0x101)
00923     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
00924       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00925       TAO_CEC_PullConsumer_List_Iterator,
00926       ACE_Null_Mutex> ();
00927   else if (this->consumer_collection_ == 0x102)
00928     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
00929       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00930       TAO_CEC_PullConsumer_List_Iterator,
00931       ACE_NULL_SYNCH> ();
00932   else if (this->consumer_collection_ == 0x103)
00933     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
00934       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullConsumer>,
00935       TAO_CEC_PullConsumer_List_Iterator,
00936       ACE_NULL_SYNCH> ();
00937   else if (this->consumer_collection_ == 0x110)
00938     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullConsumer,
00939       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00940       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00941       ACE_Null_Mutex> ();
00942   else if (this->consumer_collection_ == 0x111)
00943     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullConsumer,
00944       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00945       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00946       ACE_Null_Mutex> ();
00947   else if (this->consumer_collection_ == 0x112)
00948     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullConsumer,
00949       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00950       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00951       ACE_NULL_SYNCH> ();
00952   else if (this->consumer_collection_ == 0x113)
00953     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullConsumer,
00954       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullConsumer>,
00955       TAO_CEC_PullConsumer_RB_Tree_Iterator,
00956       ACE_NULL_SYNCH> ();
00957 
00958   return 0;
00959 }

TAO_CEC_ProxyPullSupplier * TAO_CEC_Default_Factory::create_proxy_pull_supplier ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a ProxyPullSupplier.

Implements TAO_CEC_Factory.

Definition at line 583 of file CEC_Default_Factory.cpp.

References ACE_NEW_RETURN, consumer_control_, consumer_timeout_, and ACE_Time_Value::zero.

00584 {
00585   TAO_CEC_ProxyPullSupplier *created;
00586   ACE_Time_Value timeout = this->consumer_control_ ? this->consumer_timeout_
00587     : ACE_Time_Value::zero;
00588   ACE_NEW_RETURN (created, TAO_CEC_ProxyPullSupplier (ec, timeout), 0);
00589   return created;
00590 }

TAO_CEC_ProxyPullSupplier_Collection * TAO_CEC_Default_Factory::create_proxy_pull_supplier_collection ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a collection of TAO_CEC_ProxyPullSuppliers.

Implements TAO_CEC_Factory.

Definition at line 1150 of file CEC_Default_Factory.cpp.

References ACE_NULL_SYNCH, ACE_SYNCH, and TAO_SYNCH_MUTEX.

01151 {
01152   if (this->supplier_collection_ == 0x000)
01153     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
01154       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01155       TAO_CEC_PullSupplier_List_Iterator,
01156       TAO_SYNCH_MUTEX> ();
01157   else if (this->supplier_collection_ == 0x001)
01158     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
01159       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01160       TAO_CEC_PullSupplier_List_Iterator,
01161       TAO_SYNCH_MUTEX> ();
01162   else if (this->supplier_collection_ == 0x002)
01163     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
01164       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01165       TAO_CEC_PullSupplier_List_Iterator,
01166       ACE_SYNCH> ();
01167   else if (this->supplier_collection_ == 0x003)
01168     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
01169       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01170       TAO_CEC_PullSupplier_List_Iterator,
01171       ACE_SYNCH> ();
01172   else if (this->supplier_collection_ == 0x010)
01173     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
01174       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01175       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01176       TAO_SYNCH_MUTEX> ();
01177   else if (this->supplier_collection_ == 0x011)
01178     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
01179       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01180       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01181       TAO_SYNCH_MUTEX> ();
01182   else if (this->supplier_collection_ == 0x012)
01183     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
01184       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01185       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01186       ACE_SYNCH> ();
01187   else if (this->supplier_collection_ == 0x013)
01188     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
01189       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01190       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01191       ACE_SYNCH> ();
01192   else if (this->supplier_collection_ == 0x100)
01193     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
01194       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01195       TAO_CEC_PullSupplier_List_Iterator,
01196       ACE_Null_Mutex> ();
01197   else if (this->supplier_collection_ == 0x101)
01198     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
01199       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01200       TAO_CEC_PullSupplier_List_Iterator,
01201       ACE_Null_Mutex> ();
01202   else if (this->supplier_collection_ == 0x102)
01203     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
01204       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01205       TAO_CEC_PullSupplier_List_Iterator,
01206       ACE_NULL_SYNCH> ();
01207   else if (this->supplier_collection_ == 0x103)
01208     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
01209       TAO_ESF_Proxy_List<TAO_CEC_ProxyPullSupplier>,
01210       TAO_CEC_PullSupplier_List_Iterator,
01211       ACE_NULL_SYNCH> ();
01212   else if (this->supplier_collection_ == 0x110)
01213     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPullSupplier,
01214       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01215       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01216       ACE_Null_Mutex> ();
01217   else if (this->supplier_collection_ == 0x111)
01218     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPullSupplier,
01219       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01220       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01221       ACE_Null_Mutex> ();
01222   else if (this->supplier_collection_ == 0x112)
01223     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPullSupplier,
01224       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01225       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01226       ACE_NULL_SYNCH> ();
01227   else if (this->supplier_collection_ == 0x113)
01228     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPullSupplier,
01229       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPullSupplier>,
01230       TAO_CEC_PullSupplier_RB_Tree_Iterator,
01231       ACE_NULL_SYNCH> ();
01232 
01233   return 0;
01234 }

TAO_CEC_ProxyPushConsumer * TAO_CEC_Default_Factory::create_proxy_push_consumer ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a ProxyPushConsumer.

Implements TAO_CEC_Factory.

Definition at line 599 of file CEC_Default_Factory.cpp.

References ACE_NEW_RETURN, supplier_control_, supplier_timeout_, and ACE_Time_Value::zero.

00600 {
00601   TAO_CEC_ProxyPushConsumer *created;
00602   ACE_Time_Value timeout = this->supplier_control_ ? this->supplier_timeout_
00603     : ACE_Time_Value::zero;
00604   ACE_NEW_RETURN (created, TAO_CEC_ProxyPushConsumer (ec, timeout), 0);
00605   return created;
00606 }

TAO_CEC_ProxyPushConsumer_Collection * TAO_CEC_Default_Factory::create_proxy_push_consumer_collection ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a collection of TAO_CEC_ProxyPushConsumers.

Implements TAO_CEC_Factory.

Definition at line 685 of file CEC_Default_Factory.cpp.

References ACE_NULL_SYNCH, ACE_SYNCH, and TAO_SYNCH_MUTEX.

00686 {
00687   if (this->consumer_collection_ == 0x000)
00688     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
00689       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00690       TAO_CEC_PushConsumer_List_Iterator,
00691       TAO_SYNCH_MUTEX> ();
00692   else if (this->consumer_collection_ == 0x001)
00693     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
00694       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00695       TAO_CEC_PushConsumer_List_Iterator,
00696       TAO_SYNCH_MUTEX> ();
00697   else if (this->consumer_collection_ == 0x002)
00698     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
00699       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00700       TAO_CEC_PushConsumer_List_Iterator,
00701       ACE_SYNCH> ();
00702   else if (this->consumer_collection_ == 0x003)
00703     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
00704       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00705       TAO_CEC_PushConsumer_List_Iterator,
00706       ACE_SYNCH> ();
00707   else if (this->consumer_collection_ == 0x010)
00708     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
00709       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00710       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00711       TAO_SYNCH_MUTEX> ();
00712   else if (this->consumer_collection_ == 0x011)
00713     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
00714       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00715       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00716       TAO_SYNCH_MUTEX> ();
00717   else if (this->consumer_collection_ == 0x012)
00718     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
00719       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00720       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00721       ACE_SYNCH> ();
00722   else if (this->consumer_collection_ == 0x013)
00723     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
00724       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00725       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00726       ACE_SYNCH> ();
00727   else if (this->consumer_collection_ == 0x100)
00728     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
00729       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00730       TAO_CEC_PushConsumer_List_Iterator,
00731       ACE_Null_Mutex> ();
00732   else if (this->consumer_collection_ == 0x101)
00733     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
00734       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00735       TAO_CEC_PushConsumer_List_Iterator,
00736       ACE_Null_Mutex> ();
00737   else if (this->consumer_collection_ == 0x102)
00738     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
00739       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00740       TAO_CEC_PushConsumer_List_Iterator,
00741       ACE_NULL_SYNCH> ();
00742   else if (this->consumer_collection_ == 0x103)
00743     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
00744       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushConsumer>,
00745       TAO_CEC_PushConsumer_List_Iterator,
00746       ACE_NULL_SYNCH> ();
00747   else if (this->consumer_collection_ == 0x110)
00748     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushConsumer,
00749       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00750       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00751       ACE_Null_Mutex> ();
00752   else if (this->consumer_collection_ == 0x111)
00753     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushConsumer,
00754       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00755       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00756       ACE_Null_Mutex> ();
00757   else if (this->consumer_collection_ == 0x112)
00758     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushConsumer,
00759       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00760       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00761       ACE_NULL_SYNCH> ();
00762   else if (this->consumer_collection_ == 0x113)
00763     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushConsumer,
00764       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushConsumer>,
00765       TAO_CEC_PushConsumer_RB_Tree_Iterator,
00766       ACE_NULL_SYNCH> ();
00767 
00768   return 0;
00769 }

TAO_CEC_ProxyPushSupplier * TAO_CEC_Default_Factory::create_proxy_push_supplier ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a ProxyPushSupplier.

Implements TAO_CEC_Factory.

Definition at line 555 of file CEC_Default_Factory.cpp.

References ACE_NEW_RETURN, consumer_control_, consumer_timeout_, and ACE_Time_Value::zero.

00556 {
00557   TAO_CEC_ProxyPushSupplier *created;
00558   ACE_Time_Value timeout = this->consumer_control_ ? this->consumer_timeout_
00559     : ACE_Time_Value::zero;
00560   ACE_NEW_RETURN (created, TAO_CEC_ProxyPushSupplier (ec, timeout), 0);
00561   return created;
00562 }

TAO_CEC_ProxyPushSupplier_Collection * TAO_CEC_Default_Factory::create_proxy_push_supplier_collection ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy a collection of TAO_CEC_ProxyPushSuppliers.

Implements TAO_CEC_Factory.

Definition at line 968 of file CEC_Default_Factory.cpp.

References ACE_NULL_SYNCH, ACE_SYNCH, and TAO_SYNCH_MUTEX.

00969 {
00970   if (this->supplier_collection_ == 0x000)
00971     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
00972       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
00973       TAO_CEC_PushSupplier_List_Iterator,
00974       TAO_SYNCH_MUTEX> ();
00975   else if (this->supplier_collection_ == 0x001)
00976     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
00977       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
00978       TAO_CEC_PushSupplier_List_Iterator,
00979       TAO_SYNCH_MUTEX> ();
00980   else if (this->supplier_collection_ == 0x002)
00981     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
00982       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
00983       TAO_CEC_PushSupplier_List_Iterator,
00984       ACE_SYNCH> ();
00985   else if (this->supplier_collection_ == 0x003)
00986     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
00987       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
00988       TAO_CEC_PushSupplier_List_Iterator,
00989       ACE_SYNCH> ();
00990   else if (this->supplier_collection_ == 0x010)
00991     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
00992       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
00993       TAO_CEC_PushSupplier_RB_Tree_Iterator,
00994       TAO_SYNCH_MUTEX> ();
00995   else if (this->supplier_collection_ == 0x011)
00996     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
00997       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
00998       TAO_CEC_PushSupplier_RB_Tree_Iterator,
00999       TAO_SYNCH_MUTEX> ();
01000   else if (this->supplier_collection_ == 0x012)
01001     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
01002       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01003       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01004       ACE_SYNCH> ();
01005   else if (this->supplier_collection_ == 0x013)
01006     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
01007       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01008       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01009       ACE_SYNCH> ();
01010   else if (this->supplier_collection_ == 0x100)
01011     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
01012       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
01013       TAO_CEC_PushSupplier_List_Iterator,
01014       ACE_Null_Mutex> ();
01015   else if (this->supplier_collection_ == 0x101)
01016     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
01017       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
01018       TAO_CEC_PushSupplier_List_Iterator,
01019       ACE_Null_Mutex> ();
01020   else if (this->supplier_collection_ == 0x102)
01021     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
01022       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
01023       TAO_CEC_PushSupplier_List_Iterator,
01024       ACE_NULL_SYNCH> ();
01025   else if (this->supplier_collection_ == 0x103)
01026     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
01027       TAO_ESF_Proxy_List<TAO_CEC_ProxyPushSupplier>,
01028       TAO_CEC_PushSupplier_List_Iterator,
01029       ACE_NULL_SYNCH> ();
01030   else if (this->supplier_collection_ == 0x110)
01031     return new TAO_ESF_Immediate_Changes<TAO_CEC_ProxyPushSupplier,
01032       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01033       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01034       ACE_Null_Mutex> ();
01035   else if (this->supplier_collection_ == 0x111)
01036     return new TAO_ESF_Copy_On_Read<TAO_CEC_ProxyPushSupplier,
01037       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01038       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01039       ACE_Null_Mutex> ();
01040   else if (this->supplier_collection_ == 0x112)
01041     return new TAO_ESF_Copy_On_Write<TAO_CEC_ProxyPushSupplier,
01042       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01043       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01044       ACE_NULL_SYNCH> ();
01045   else if (this->supplier_collection_ == 0x113)
01046     return new TAO_ESF_Delayed_Changes<TAO_CEC_ProxyPushSupplier,
01047       TAO_ESF_Proxy_RB_Tree<TAO_CEC_ProxyPushSupplier>,
01048       TAO_CEC_PushSupplier_RB_Tree_Iterator,
01049       ACE_NULL_SYNCH> ();
01050 
01051   return 0;
01052 }

TAO_CEC_Pulling_Strategy * TAO_CEC_Default_Factory::create_pulling_strategy ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy the pulling strategy.

Implements TAO_CEC_Factory.

Definition at line 475 of file CEC_Default_Factory.cpp.

References TAO_Pseudo_Var_T< T >::in(), and CORBA::ORB_init().

00476 {
00477   if (this->pulling_strategy_ == 0)
00478     {
00479       int argc = 0;
00480       char **argv = 0;
00481       CORBA::ORB_var orb =
00482         CORBA::ORB_init (argc, argv, this->orbid_);
00483 
00484       ACE_Time_Value rate (0, this->reactive_pulling_period_);
00485       return new TAO_CEC_Reactive_Pulling_Strategy (
00486                                  rate, this->supplier_control_timeout_,
00487                                  ec, orb.in ());
00488     }
00489   return 0;
00490 }

CORBA::Policy_ptr TAO_CEC_Default_Factory::create_roundtrip_timeout_policy ( const ACE_Time_Value timeout  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1379 of file CEC_Default_Factory.cpp.

References CORBA::ORB_init().

01380 {
01381   //get the existing orb
01382   int fake_argc = 0;
01383   CORBA::ORB_var orb = CORBA::ORB_init (fake_argc, 0, this->orbid_);
01384 
01385   CORBA::Any value;
01386   TimeBase::TimeT timet;
01387   ORBSVCS_Time::Time_Value_to_TimeT (timet, timeout);
01388   value <<= timet;
01389   return orb->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
01390     value);
01391 }

TAO_CEC_SupplierAdmin * TAO_CEC_Default_Factory::create_supplier_admin ( TAO_CEC_EventChannel  )  [virtual]

Create and destroy the supplier admin implementation.

Implements TAO_CEC_Factory.

Definition at line 527 of file CEC_Default_Factory.cpp.

00528 {
00529   return new TAO_CEC_SupplierAdmin (ec);
00530 }

TAO_CEC_SupplierControl * TAO_CEC_Default_Factory::create_supplier_control ( TAO_CEC_EventChannel  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1329 of file CEC_Default_Factory.cpp.

References TAO_Pseudo_Var_T< T >::in(), and CORBA::ORB_init().

01330 {
01331   if (this->supplier_control_ == 0)
01332     return new TAO_CEC_SupplierControl ();
01333   else if (this->supplier_control_ == 1)
01334     {
01335       int argc = 0;
01336       char **argv = 0;
01337       CORBA::ORB_var orb =
01338         CORBA::ORB_init (argc, argv, this->orbid_);
01339 
01340       ACE_Time_Value rate (0, this->supplier_control_period_);
01341       return new TAO_CEC_Reactive_SupplierControl (
01342                                  rate, this->supplier_control_timeout_,
01343                                  this->proxy_disconnect_retries_,
01344                                  ec, orb.in ());
01345     }
01346   return 0;
01347 }

ACE_Lock * TAO_CEC_Default_Factory::create_supplier_lock ( void   )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1261 of file CEC_Default_Factory.cpp.

01262 {
01263   if (this->supplier_lock_ == 0)
01264     return new ACE_Lock_Adapter<ACE_Null_Mutex>;
01265   else if (this->supplier_lock_ == 1)
01266     return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
01267   else if (this->supplier_lock_ == 2)
01268     return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
01269   return 0;
01270 }

void TAO_CEC_Default_Factory::destroy_consumer_admin ( TAO_CEC_ConsumerAdmin  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 513 of file CEC_Default_Factory.cpp.

00514 {
00515   delete x;
00516 }

void TAO_CEC_Default_Factory::destroy_consumer_control ( TAO_CEC_ConsumerControl  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1323 of file CEC_Default_Factory.cpp.

01324 {
01325   delete x;
01326 }

void TAO_CEC_Default_Factory::destroy_consumer_lock ( ACE_Lock  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1255 of file CEC_Default_Factory.cpp.

01256 {
01257   delete x;
01258 }

void TAO_CEC_Default_Factory::destroy_dispatching ( TAO_CEC_Dispatching  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 469 of file CEC_Default_Factory.cpp.

00470 {
00471   delete x;
00472 }

void TAO_CEC_Default_Factory::destroy_proxy_pull_consumer ( TAO_CEC_ProxyPullConsumer  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 645 of file CEC_Default_Factory.cpp.

00646 {
00647   delete x;
00648 }

void TAO_CEC_Default_Factory::destroy_proxy_pull_consumer_collection ( TAO_CEC_ProxyPullConsumer_Collection  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 962 of file CEC_Default_Factory.cpp.

00963 {
00964   delete x;
00965 }

void TAO_CEC_Default_Factory::destroy_proxy_pull_supplier ( TAO_CEC_ProxyPullSupplier  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 593 of file CEC_Default_Factory.cpp.

00594 {
00595   delete x;
00596 }

void TAO_CEC_Default_Factory::destroy_proxy_pull_supplier_collection ( TAO_CEC_ProxyPullSupplier_Collection  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1237 of file CEC_Default_Factory.cpp.

01238 {
01239   delete x;
01240 }

void TAO_CEC_Default_Factory::destroy_proxy_push_consumer ( TAO_CEC_ProxyPushConsumer  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 621 of file CEC_Default_Factory.cpp.

00622 {
00623   delete x;
00624 }

void TAO_CEC_Default_Factory::destroy_proxy_push_consumer_collection ( TAO_CEC_ProxyPushConsumer_Collection  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 861 of file CEC_Default_Factory.cpp.

00862 {
00863   delete x;
00864 }

void TAO_CEC_Default_Factory::destroy_proxy_push_supplier ( TAO_CEC_ProxyPushSupplier  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 577 of file CEC_Default_Factory.cpp.

00578 {
00579   delete x;
00580 }

void TAO_CEC_Default_Factory::destroy_proxy_push_supplier_collection ( TAO_CEC_ProxyPushSupplier_Collection  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1144 of file CEC_Default_Factory.cpp.

01145 {
01146   delete x;
01147 }

void TAO_CEC_Default_Factory::destroy_pulling_strategy ( TAO_CEC_Pulling_Strategy  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 493 of file CEC_Default_Factory.cpp.

00494 {
00495   delete x;
00496 }

void TAO_CEC_Default_Factory::destroy_supplier_admin ( TAO_CEC_SupplierAdmin  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 541 of file CEC_Default_Factory.cpp.

00542 {
00543   delete x;
00544 }

void TAO_CEC_Default_Factory::destroy_supplier_control ( TAO_CEC_SupplierControl  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1373 of file CEC_Default_Factory.cpp.

01374 {
01375   delete x;
01376 }

void TAO_CEC_Default_Factory::destroy_supplier_lock ( ACE_Lock  )  [virtual]

Implements TAO_CEC_Factory.

Definition at line 1273 of file CEC_Default_Factory.cpp.

01274 {
01275   delete x;
01276 }

int TAO_CEC_Default_Factory::fini ( void   )  [virtual]

Reimplemented from ACE_Shared_Object.

Definition at line 433 of file CEC_Default_Factory.cpp.

00434 {
00435   return 0;
00436 }

int TAO_CEC_Default_Factory::init ( int  argc,
ACE_TCHAR argv[] 
) [virtual]

Reimplemented from ACE_Shared_Object.

Definition at line 105 of file CEC_Default_Factory.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), ACE_TEXT_ALWAYS_CHAR, ACE_THR_PRI_OTHER_DEF, ACE_OS::atoi(), ACE_Arg_Shifter_T< CHAR_TYPE >::consume_arg(), consumer_collection_, consumer_control_, consumer_control_period_, consumer_control_timeout_, consumer_lock_, consumer_timeout_, dispatching_, dispatching_threads_, dispatching_threads_flags_, dispatching_threads_priority_, ACE_OS::free(), ACE_Arg_Shifter_T< CHAR_TYPE >::get_current(), ACE_Arg_Shifter_T< CHAR_TYPE >::is_anything_left(), ACE_Arg_Shifter_T< CHAR_TYPE >::is_parameter_next(), LM_DEBUG, LM_ERROR, orbid_dupped_, parse_collection_arg(), proxy_disconnect_retries_, reactive_pulling_period_, ACE_OS::strcasecmp(), ACE_OS::strdup(), ACE_OS::strncmp(), ACE_OS::strtoul(), supplier_collection_, supplier_control_, supplier_control_period_, supplier_control_timeout_, supplier_lock_, supplier_timeout_, THR_BOUND, THR_NEW_LWP, THR_SCHED_DEFAULT, and ACE_Time_Value::usec().

00106 {
00107   ACE_Arg_Shifter arg_shifter (argc, argv);
00108 
00109   this->dispatching_threads_flags_ =
00110     THR_SCHED_DEFAULT|THR_BOUND|THR_NEW_LWP;
00111   this->dispatching_threads_priority_ =
00112     ACE_THR_PRI_OTHER_DEF;
00113 
00114   while (arg_shifter.is_anything_left ())
00115     {
00116       const ACE_TCHAR *arg = arg_shifter.get_current ();
00117 
00118       if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECDispatching")) == 0)
00119         {
00120           arg_shifter.consume_arg ();
00121 
00122           if (arg_shifter.is_parameter_next ())
00123             {
00124               const ACE_TCHAR* opt = arg_shifter.get_current ();
00125               if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00126                 {
00127                   this->dispatching_ = 0;
00128                 }
00129               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
00130                 {
00131                   this->dispatching_ = 1;
00132                 }
00133               else
00134                 {
00135                   ACE_ERROR ((LM_ERROR,
00136                               "CEC_Default_Factory - "
00137                               "unsupported dispatching <%s>\n",
00138                               opt));
00139                 }
00140               arg_shifter.consume_arg ();
00141             }
00142         }
00143 
00144       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECDispatchingThreads")) == 0)
00145         {
00146           arg_shifter.consume_arg ();
00147 
00148           if (arg_shifter.is_parameter_next ())
00149             {
00150               const ACE_TCHAR* opt = arg_shifter.get_current ();
00151               this->dispatching_threads_ = ACE_OS::atoi (opt);
00152               arg_shifter.consume_arg ();
00153             }
00154         }
00155 
00156       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyConsumerCollection")) == 0)
00157         {
00158           arg_shifter.consume_arg ();
00159 
00160           if (arg_shifter.is_parameter_next ())
00161             {
00162               const ACE_TCHAR *current_arg = arg_shifter.get_current ();
00163               ACE_TCHAR *opt = ACE_OS::strdup (current_arg);
00164               this->consumer_collection_ = this->parse_collection_arg (opt);
00165               ACE_OS::free (opt);
00166               arg_shifter.consume_arg ();
00167             }
00168         }
00169 
00170       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxySupplierCollection")) == 0)
00171         {
00172           arg_shifter.consume_arg ();
00173 
00174           if (arg_shifter.is_parameter_next ())
00175             {
00176               const ACE_TCHAR *current_arg = arg_shifter.get_current();
00177               ACE_TCHAR* opt = ACE_OS::strdup(current_arg);
00178               this->supplier_collection_ =
00179                 this->parse_collection_arg (opt);
00180               ACE_OS::free(opt);
00181               arg_shifter.consume_arg ();
00182             }
00183         }
00184 
00185       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyConsumerLock")) == 0)
00186         {
00187           arg_shifter.consume_arg ();
00188 
00189           if (arg_shifter.is_parameter_next ())
00190             {
00191               const ACE_TCHAR* opt = arg_shifter.get_current ();
00192               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00193                 {
00194                   this->consumer_lock_ = 0;
00195                 }
00196               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
00197                 {
00198                   this->consumer_lock_ = 1;
00199                 }
00200               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
00201                 {
00202                   this->consumer_lock_ = 2;
00203                 }
00204               else
00205                 {
00206                   ACE_ERROR ((LM_ERROR,
00207                               "CEC_Default_Factory - "
00208                               "unsupported consumer lock <%s>\n",
00209                               opt));
00210                 }
00211               arg_shifter.consume_arg ();
00212             }
00213         }
00214 
00215       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxySupplierLock")) == 0)
00216         {
00217           arg_shifter.consume_arg ();
00218 
00219           if (arg_shifter.is_parameter_next ())
00220             {
00221               const ACE_TCHAR* opt = arg_shifter.get_current ();
00222               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00223                 {
00224                   this->supplier_lock_ = 0;
00225                 }
00226               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
00227                 {
00228                   this->supplier_lock_ = 1;
00229                 }
00230               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
00231                 {
00232                   this->supplier_lock_ = 2;
00233                 }
00234               else
00235                 {
00236                   ACE_ERROR ((LM_ERROR,
00237                               "CEC_Default_Factory - "
00238                               "unsupported supplier lock <%s>\n",
00239                               opt));
00240                 }
00241               arg_shifter.consume_arg ();
00242             }
00243         }
00244 
00245       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECReactivePullingPeriod")) == 0)
00246         {
00247           arg_shifter.consume_arg ();
00248 
00249           if (arg_shifter.is_parameter_next ())
00250             {
00251               const ACE_TCHAR* opt = arg_shifter.get_current ();
00252               this->reactive_pulling_period_ = ACE_OS::atoi (opt);
00253               arg_shifter.consume_arg ();
00254             }
00255         }
00256 
00257       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECUseORBId")) == 0)
00258         {
00259           arg_shifter.consume_arg ();
00260 
00261           if (arg_shifter.is_parameter_next ())
00262             {
00263               // Copy argument for later use
00264               this->orbid_ = ACE_OS::strdup(ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ()));
00265               orbid_dupped_ = 1;
00266               arg_shifter.consume_arg ();
00267             }
00268         }
00269 
00270       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControl")) == 0)
00271         {
00272           arg_shifter.consume_arg ();
00273 
00274           if (arg_shifter.is_parameter_next ())
00275             {
00276               const ACE_TCHAR* opt = arg_shifter.get_current ();
00277               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00278                 {
00279                   this->consumer_control_ = 0;
00280                 }
00281               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00282                 {
00283                   this->consumer_control_ = 1;
00284                 }
00285               else
00286                 {
00287                   ACE_ERROR ((LM_ERROR,
00288                               "CEC_Default_Factory - "
00289                               "unsupported consumer control <%s>\n",
00290                               opt));
00291                 }
00292               arg_shifter.consume_arg ();
00293             }
00294         }
00295 
00296       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControl")) == 0)
00297         {
00298           arg_shifter.consume_arg ();
00299 
00300           if (arg_shifter.is_parameter_next ())
00301             {
00302               const ACE_TCHAR* opt = arg_shifter.get_current ();
00303               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00304                 {
00305                   this->supplier_control_ = 0;
00306                 }
00307               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00308                 {
00309                   this->supplier_control_ = 1;
00310                 }
00311               else
00312                 {
00313                   ACE_ERROR ((LM_ERROR,
00314                               "CEC_Default_Factory - "
00315                               "unsupported supplier control <%s>\n",
00316                               opt));
00317                 }
00318               arg_shifter.consume_arg ();
00319             }
00320         }
00321 
00322       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlPeriod")) == 0)
00323         {
00324           arg_shifter.consume_arg ();
00325 
00326           if (arg_shifter.is_parameter_next ())
00327             {
00328               const ACE_TCHAR* opt = arg_shifter.get_current ();
00329               this->consumer_control_period_ = ACE_OS::atoi (opt);
00330               arg_shifter.consume_arg ();
00331             }
00332         }
00333 
00334       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlPeriod")) == 0)
00335         {
00336           arg_shifter.consume_arg ();
00337 
00338           if (arg_shifter.is_parameter_next ())
00339             {
00340               const ACE_TCHAR* opt = arg_shifter.get_current ();
00341               this->supplier_control_period_ = ACE_OS::atoi (opt);
00342               arg_shifter.consume_arg ();
00343             }
00344         }
00345 
00346       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlTimeout")) == 0 ||
00347                ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerControlRoundtripTimeout")) == 0)
00348         {
00349           arg_shifter.consume_arg ();
00350 
00351           if (arg_shifter.is_parameter_next ())
00352             {
00353               const ACE_TCHAR* opt = arg_shifter.get_current ();
00354                           unsigned long timeout_ = ACE_OS::strtoul(opt, 0, 10);
00355               this->consumer_control_timeout_.usec(timeout_);
00356               arg_shifter.consume_arg ();
00357             }
00358         }
00359 
00360       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlTimeout")) == 0 ||
00361                ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierControlRoundtripTimeout")) == 0)
00362         {
00363           arg_shifter.consume_arg ();
00364 
00365           if (arg_shifter.is_parameter_next ())
00366             {
00367               const ACE_TCHAR* opt = arg_shifter.get_current ();
00368                           unsigned long timeout_ = ACE_OS::strtoul(opt, 0, 10);
00369               this->supplier_control_timeout_.usec(timeout_);
00370               arg_shifter.consume_arg ();
00371             }
00372         }
00373 
00374       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECConsumerOperationTimeout")) == 0)
00375         {
00376           arg_shifter.consume_arg ();
00377 
00378           if (arg_shifter.is_parameter_next ())
00379             {
00380               const ACE_TCHAR* opt = arg_shifter.get_current ();
00381               unsigned long timeout = ACE_OS::strtoul (opt, 0, 10);
00382               this->consumer_timeout_.usec (timeout);
00383               arg_shifter.consume_arg ();
00384             }
00385         }
00386 
00387       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECSupplierOperationTimeout")) == 0)
00388         {
00389           arg_shifter.consume_arg ();
00390 
00391           if (arg_shifter.is_parameter_next ())
00392             {
00393               const ACE_TCHAR* opt = arg_shifter.get_current ();
00394               unsigned long timeout = ACE_OS::strtoul (opt, 0, 10);
00395               this->supplier_timeout_.usec (timeout);
00396               arg_shifter.consume_arg ();
00397             }
00398         }
00399 
00400       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-CECProxyDisconnectRetries")) == 0)
00401         {
00402           arg_shifter.consume_arg ();
00403 
00404           if (arg_shifter.is_parameter_next ())
00405             {
00406               const ACE_TCHAR* opt = arg_shifter.get_current ();
00407               this->proxy_disconnect_retries_ = ACE_OS::atoi (opt);
00408               arg_shifter.consume_arg ();
00409             }
00410         }
00411 
00412       else if (ACE_OS::strncmp (arg, ACE_TEXT("-CEC"), 3) == 0)
00413         {
00414           arg_shifter.consume_arg ();
00415           ACE_ERROR ((LM_ERROR,
00416                       "CEC_Default_Factory - "
00417                       "unknown option <%s>\n",
00418                       arg));
00419         }
00420       else
00421         {
00422           arg_shifter.consume_arg ();
00423           ACE_DEBUG ((LM_DEBUG,
00424                       "CEC_Default_Factory - "
00425                       "ignoring option <%s>\n",
00426                       arg));
00427         }
00428     }
00429   return 0;
00430 }

int TAO_CEC_Default_Factory::init_svcs ( void   )  [static]

Helper function to register the default factory into the service configurator.

Definition at line 59 of file CEC_Default_Factory.cpp.

References ACE_Service_Gestalt::insert(), and ACE_Service_Config::static_svcs().

00060 {
00061   return
00062     ACE_Service_Config::static_svcs ()->insert (
00063         &ace_svc_desc_TAO_CEC_Default_Factory
00064       );
00065 }

int TAO_CEC_Default_Factory::parse_collection_arg ( ACE_TCHAR opt  )  [private]

Parse an argument to set the type of collections used.

Definition at line 68 of file CEC_Default_Factory.cpp.

References ACE_ERROR, ACE_TEXT(), LM_ERROR, ACE_OS::strcasecmp(), and ACE_OS::strtok_r().

Referenced by init().

00069 {
00070   int collection_type = 0;
00071   int synch_type = 0;
00072   int iteration_type = 0;
00073 
00074   ACE_TCHAR* aux = 0;
00075   for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
00076        arg != 0;
00077        arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
00078     {
00079       if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
00080         synch_type = 0;
00081       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
00082         synch_type = 1;
00083       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
00084         collection_type = 0;
00085       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
00086         collection_type = 1;
00087       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
00088         iteration_type = 0;
00089       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
00090         iteration_type = 1;
00091       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
00092         iteration_type = 2;
00093       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
00094         iteration_type = 3;
00095       else
00096         ACE_ERROR ((LM_ERROR,
00097                     "CEC_Default_Factory - "
00098                     "unknown collection modifier <%s>\n",
00099                     arg));
00100     }
00101   return (synch_type << 8) |(collection_type << 4) | iteration_type;
00102 }


Member Data Documentation

int TAO_CEC_Default_Factory::consumer_collection_ [private]

Definition at line 175 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::consumer_control_ [private]

The consumer and supplier control policies.

Definition at line 198 of file CEC_Default_Factory.h.

Referenced by create_proxy_pull_supplier(), create_proxy_push_supplier(), and init().

int TAO_CEC_Default_Factory::consumer_control_period_ [private]

The consumer and supplier control periods in usecs.

Definition at line 202 of file CEC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_CEC_Default_Factory::consumer_control_timeout_ [private]

The consumer and supplier control timeout in usecs.

Definition at line 206 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::consumer_lock_ [private]

Definition at line 177 of file CEC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_CEC_Default_Factory::consumer_timeout_ [private]

The consumer and supplier operation timeouts. Only in effect if the corresponding "reactive control" is enabled. Applies the given timeout as the round-trip time policy on the object reference.

Definition at line 213 of file CEC_Default_Factory.h.

Referenced by create_proxy_pull_supplier(), create_proxy_push_supplier(), and init().

int TAO_CEC_Default_Factory::dispatching_ [private]

Several flags to control the kind of object created.

Definition at line 173 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::dispatching_threads_ [private]

The MT dispatching priority has several arguments that could be controlled here...

Definition at line 182 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::dispatching_threads_flags_ [private]

Definition at line 183 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::dispatching_threads_force_active_ [private]

Definition at line 185 of file CEC_Default_Factory.h.

int TAO_CEC_Default_Factory::dispatching_threads_priority_ [private]

Definition at line 184 of file CEC_Default_Factory.h.

Referenced by init().

char* TAO_CEC_Default_Factory::orbid_ [private]

Use this ORB to locate global resources.

Definition at line 192 of file CEC_Default_Factory.h.

int TAO_CEC_Default_Factory::orbid_dupped_ [private]

Indicate ORB ID has been duplicated (memory allocated).

Definition at line 195 of file CEC_Default_Factory.h.

Referenced by init().

unsigned int TAO_CEC_Default_Factory::proxy_disconnect_retries_ [private]

The number of retries before disconnecting a proxy.

Definition at line 217 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::pulling_strategy_ [private]

Definition at line 174 of file CEC_Default_Factory.h.

int TAO_CEC_Default_Factory::reactive_pulling_period_ [private]

How often (in microseconds) are the pull suppliers polled by the reactive pulling strategy.

Definition at line 189 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::supplier_collection_ [private]

Definition at line 176 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::supplier_control_ [private]

Definition at line 199 of file CEC_Default_Factory.h.

Referenced by create_proxy_pull_consumer(), create_proxy_push_consumer(), and init().

int TAO_CEC_Default_Factory::supplier_control_period_ [private]

Definition at line 203 of file CEC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_CEC_Default_Factory::supplier_control_timeout_ [private]

Definition at line 207 of file CEC_Default_Factory.h.

Referenced by init().

int TAO_CEC_Default_Factory::supplier_lock_ [private]

Definition at line 178 of file CEC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_CEC_Default_Factory::supplier_timeout_ [private]

Definition at line 214 of file CEC_Default_Factory.h.

Referenced by create_proxy_pull_consumer(), create_proxy_push_consumer(), and init().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:44:57 2010 for TAO_CosEvent by  doxygen 1.4.7