TAO_EC_Default_Factory Class Reference

A generic factory for EC experimentation. More...

#include <EC_Default_Factory.h>

Inheritance diagram for TAO_EC_Default_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Default_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_Default_Factory (void)
 Constructor.

virtual ~TAO_EC_Default_Factory (void)
 destructor...

virtual int init (int argc, ACE_TCHAR *argv[])
virtual int fini (void)
virtual TAO_EC_Dispatchingcreate_dispatching (TAO_EC_Event_Channel_Base *)
 Create and destroy the dispatching module.

virtual void destroy_dispatching (TAO_EC_Dispatching *)
virtual TAO_EC_Filter_Buildercreate_filter_builder (TAO_EC_Event_Channel_Base *)
 Create and destroy the filter builder.

virtual void destroy_filter_builder (TAO_EC_Filter_Builder *)
virtual TAO_EC_Supplier_Filter_Buildercreate_supplier_filter_builder (TAO_EC_Event_Channel_Base *)
 Create and destroy the filter builder.

virtual void destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder *)
virtual TAO_EC_ConsumerAdmincreate_consumer_admin (TAO_EC_Event_Channel_Base *)
 Create and destroy the consumer admin implementation.

virtual void destroy_consumer_admin (TAO_EC_ConsumerAdmin *)
virtual TAO_EC_SupplierAdmincreate_supplier_admin (TAO_EC_Event_Channel_Base *)
 Create and destroy the supplier admin implementation.

virtual void destroy_supplier_admin (TAO_EC_SupplierAdmin *)
virtual TAO_EC_ProxyPushSuppliercreate_proxy_push_supplier (TAO_EC_Event_Channel_Base *)
 Create and destroy a ProxyPushSupplier.

virtual void destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier *)
virtual TAO_EC_ProxyPushConsumercreate_proxy_push_consumer (TAO_EC_Event_Channel_Base *)
 Create and destroy a ProxyPushConsumer.

virtual void destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer *)
virtual TAO_EC_Timeout_Generatorcreate_timeout_generator (TAO_EC_Event_Channel_Base *)
 Create and destroy the timer module.

virtual void destroy_timeout_generator (TAO_EC_Timeout_Generator *)
virtual TAO_EC_ObserverStrategycreate_observer_strategy (TAO_EC_Event_Channel_Base *)
 Create and destroy the observer strategy.

virtual void destroy_observer_strategy (TAO_EC_ObserverStrategy *)
virtual TAO_EC_Scheduling_Strategycreate_scheduling_strategy (TAO_EC_Event_Channel_Base *)
 Create and destroy the observer strategy.

virtual void destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy *)
virtual TAO_EC_ProxyPushConsumer_Collectioncreate_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base *)
 Create and destroy a collection of TAO_EC_ProxyPushConsumers.

virtual void destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection *)
virtual TAO_EC_ProxyPushSupplier_Collectioncreate_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base *)
 Create and destroy a collection of TAO_EC_ProxyPushSuppliers.

virtual void destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_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_EC_ConsumerControlcreate_consumer_control (TAO_EC_Event_Channel_Base *)
virtual void destroy_consumer_control (TAO_EC_ConsumerControl *)
virtual TAO_EC_SupplierControlcreate_supplier_control (TAO_EC_Event_Channel_Base *)
virtual void destroy_supplier_control (TAO_EC_SupplierControl *)
int consumer_collection (void) const
 Accessors to consumer collection flags.

int supplier_collection (void) const
 Accessors to supplier collection flags.

int supplier_filtering (void) const
 Accessors to supplier filtering flags.

const ACE_CStringorb_id (void) const
 Accessor to ORBid.


Static Public Member Functions

int init_svcs (void)

Protected Member Functions

void unsupported_option_value (const char *option_name, const char *option_value)
TAO_EC_Queue_Full_Service_Objectfind_service_object (const char *wanted, const char *fallback)

Protected Attributes

int dispatching_
 Several flags to control the kind of object created.

int filtering_
int supplier_filtering_
int timeout_
int observer_
int scheduling_
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_
ACE_CString queue_full_service_object_name_
ACE_CString orbid_
 Use this ORB to locate global resources.

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 control timeout in usecs.

ACE_Time_Value supplier_control_timeout_
 The supplier control timeout in usecs.

int consumer_validate_connection_
 Validate the connection to consumer on connect.


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.

Definition at line 47 of file EC_Default_Factory.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_EC_Default_Factory::TAO_EC_Default_Factory void   ) 
 

Constructor.

Definition at line 8 of file EC_Default_Factory.i.

References TAO_EC_DEFAULT_CONSUMER_COLLECTION, TAO_EC_DEFAULT_CONSUMER_CONTROL, TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD, TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT, TAO_EC_DEFAULT_CONSUMER_FILTER, TAO_EC_DEFAULT_CONSUMER_LOCK, TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION, TAO_EC_DEFAULT_DISPATCHING, TAO_EC_DEFAULT_DISPATCHING_THREADS, TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS, TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE, TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY, TAO_EC_DEFAULT_OBSERVER, TAO_EC_DEFAULT_ORB_ID, TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME, TAO_EC_DEFAULT_SCHEDULING, TAO_EC_DEFAULT_SUPPLIER_COLLECTION, TAO_EC_DEFAULT_SUPPLIER_CONTROL, TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD, TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT, TAO_EC_DEFAULT_SUPPLIER_FILTER, TAO_EC_DEFAULT_SUPPLIER_LOCK, and TAO_EC_DEFAULT_TIMEOUT.

00009   :  dispatching_ (TAO_EC_DEFAULT_DISPATCHING),
00010      filtering_ (TAO_EC_DEFAULT_CONSUMER_FILTER),
00011      supplier_filtering_ (TAO_EC_DEFAULT_SUPPLIER_FILTER),
00012      timeout_ (TAO_EC_DEFAULT_TIMEOUT),
00013      observer_ (TAO_EC_DEFAULT_OBSERVER),
00014      scheduling_ (TAO_EC_DEFAULT_SCHEDULING),
00015      consumer_collection_ (TAO_EC_DEFAULT_CONSUMER_COLLECTION),
00016      supplier_collection_ (TAO_EC_DEFAULT_SUPPLIER_COLLECTION),
00017      consumer_lock_ (TAO_EC_DEFAULT_CONSUMER_LOCK),
00018      supplier_lock_ (TAO_EC_DEFAULT_SUPPLIER_LOCK),
00019      dispatching_threads_ (TAO_EC_DEFAULT_DISPATCHING_THREADS),
00020      dispatching_threads_flags_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_FLAGS),
00021      dispatching_threads_priority_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_PRIORITY),
00022      dispatching_threads_force_active_ (TAO_EC_DEFAULT_DISPATCHING_THREADS_FORCE_ACTIVE),
00023      queue_full_service_object_name_ (TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME),
00024      orbid_ (TAO_EC_DEFAULT_ORB_ID),
00025      consumer_control_ (TAO_EC_DEFAULT_CONSUMER_CONTROL),
00026      supplier_control_ (TAO_EC_DEFAULT_SUPPLIER_CONTROL),
00027      consumer_control_period_ (TAO_EC_DEFAULT_CONSUMER_CONTROL_PERIOD),
00028      supplier_control_period_ (TAO_EC_DEFAULT_SUPPLIER_CONTROL_PERIOD),
00029      consumer_control_timeout_ (0, TAO_EC_DEFAULT_CONSUMER_CONTROL_TIMEOUT),
00030      supplier_control_timeout_ (0, TAO_EC_DEFAULT_SUPPLIER_CONTROL_TIMEOUT),
00031      consumer_validate_connection_ (TAO_EC_DEFAULT_CONSUMER_VALIDATE_CONNECTION)
00032 {
00033 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Default_Factory::~TAO_EC_Default_Factory void   )  [virtual]
 

destructor...

Definition at line 45 of file EC_Default_Factory.cpp.

00046 {
00047 }


Member Function Documentation

ACE_INLINE int TAO_EC_Default_Factory::consumer_collection void   )  const
 

Accessors to consumer collection flags.

Definition at line 36 of file EC_Default_Factory.i.

References consumer_collection_.

00037 {
00038   return this->consumer_collection_;
00039 }

TAO_EC_ConsumerAdmin * TAO_EC_Default_Factory::create_consumer_admin TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the consumer admin implementation.

Implements TAO_EC_Factory.

Definition at line 590 of file EC_Default_Factory.cpp.

00591 {
00592   return new TAO_EC_ConsumerAdmin (ec);
00593 }

TAO_EC_ConsumerControl * TAO_EC_Default_Factory::create_consumer_control TAO_EC_Event_Channel_Base  )  [virtual]
 

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

Implements TAO_EC_Factory.

Definition at line 946 of file EC_Default_Factory.cpp.

References consumer_control_, consumer_control_timeout_, and CORBA::ORB_init().

00947 {
00948   if (this->consumer_control_ == 0)
00949     return new TAO_EC_ConsumerControl ();
00950   else if (this->consumer_control_ == 1)
00951     {
00952       int argc = 0;
00953       char **argv = 0;
00954       CORBA::ORB_var orb =
00955         CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
00956 
00957       ACE_Time_Value rate (0, this->consumer_control_period_);
00958       return new TAO_EC_Reactive_ConsumerControl (rate, consumer_control_timeout_, ec, orb.in ());
00959     }
00960   return 0;
00961 }

ACE_Lock * TAO_EC_Default_Factory::create_consumer_lock void   )  [virtual]
 

Create and destroy the locking strategies for both ProxyPushConsumers and ProxyPushSuppliers

Implements TAO_EC_Factory.

Definition at line 910 of file EC_Default_Factory.cpp.

References consumer_lock_.

00911 {
00912   if (this->consumer_lock_ == 0)
00913     return new ACE_Lock_Adapter<ACE_Null_Mutex>;
00914   else if (this->consumer_lock_ == 1)
00915     return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
00916   else if (this->consumer_lock_ == 2)
00917     return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
00918   return 0;
00919 }

TAO_EC_Dispatching * TAO_EC_Default_Factory::create_dispatching TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the dispatching module.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_Kokyu_Factory, TAO_EC_Sched_Factory, and TAO_EC_TPC_Factory.

Definition at line 531 of file EC_Default_Factory.cpp.

References dispatching_, find_service_object(), and TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME.

Referenced by TAO_EC_Sched_Factory::create_dispatching(), and TAO_EC_Kokyu_Factory::create_dispatching().

00532 {
00533   if (this->dispatching_ == 0)
00534     return new TAO_EC_Reactive_Dispatching ();
00535   else if (this->dispatching_ == 1)
00536     {
00537       TAO_EC_Queue_Full_Service_Object* so =
00538         this->find_service_object (this->queue_full_service_object_name_.fast_rep(),
00539                                    TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME);
00540       return new TAO_EC_MT_Dispatching (this->dispatching_threads_,
00541                                         this->dispatching_threads_flags_,
00542                                         this->dispatching_threads_priority_,
00543                                         this->dispatching_threads_force_active_,
00544                                         so);
00545     }
00546   return 0;
00547 }

TAO_EC_Filter_Builder * TAO_EC_Default_Factory::create_filter_builder TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the filter builder.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_Sched_Factory.

Definition at line 556 of file EC_Default_Factory.cpp.

References filtering_.

Referenced by TAO_EC_Sched_Factory::create_filter_builder(), and TAO_EC_Kokyu_Factory::create_filter_builder().

00557 {
00558   if (this->filtering_ == 0)
00559     return new TAO_EC_Null_Filter_Builder ();
00560   else if (this->filtering_ == 1)
00561     return new TAO_EC_Basic_Filter_Builder (ec);
00562   else if (this->filtering_ == 2)
00563     return new TAO_EC_Prefix_Filter_Builder (ec);
00564   return 0;
00565 }

TAO_EC_ObserverStrategy * TAO_EC_Default_Factory::create_observer_strategy TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the observer strategy.

Implements TAO_EC_Factory.

Definition at line 665 of file EC_Default_Factory.cpp.

References ACE_NEW_RETURN, and observer_.

00666 {
00667   if (this->observer_ == 0)
00668     return new TAO_EC_Null_ObserverStrategy;
00669   else if (this->observer_ == 1)
00670     {
00671       // @@ The lock should also be under control of the user...
00672       ACE_Lock* lock = 0;
00673       ACE_NEW_RETURN (lock, ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 0);
00674       return new TAO_EC_Basic_ObserverStrategy (ec, lock);
00675     }
00676   else if (this->observer_ == 2)
00677     {
00678       // @@ The lock should also be under control of the user...
00679       ACE_Lock* lock = 0;
00680       ACE_NEW_RETURN (lock, ACE_Lock_Adapter<TAO_SYNCH_MUTEX>, 0);
00681       return new TAO_EC_Reactive_ObserverStrategy (ec, lock);
00682     }
00683   return 0;
00684 }

TAO_EC_ProxyPushConsumer * TAO_EC_Default_Factory::create_proxy_push_consumer TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy a ProxyPushConsumer.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_TPC_Factory.

Definition at line 626 of file EC_Default_Factory.cpp.

00627 {
00628   return new TAO_EC_Default_ProxyPushConsumer (ec);
00629 }

TAO_EC_ProxyPushConsumer_Collection * TAO_EC_Default_Factory::create_proxy_push_consumer_collection TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy a collection of TAO_EC_ProxyPushConsumers.

Implements TAO_EC_Factory.

Definition at line 724 of file EC_Default_Factory.cpp.

References ACE_SYNCH, consumer_collection_, TAO_EC_Consumer_List_Iterator, TAO_EC_Consumer_RB_Tree_Iterator, TAO_EC_ProxyPushConsumer, and TAO_SYNCH_MUTEX.

00725 {
00726   if (this->consumer_collection_ == 0x000)
00727     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
00728       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00729       TAO_EC_Consumer_List_Iterator,
00730       TAO_SYNCH_MUTEX> ();
00731   else if (this->consumer_collection_ == 0x001)
00732     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
00733       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00734       TAO_EC_Consumer_List_Iterator,
00735       TAO_SYNCH_MUTEX> ();
00736   else if (this->consumer_collection_ == 0x002)
00737     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
00738       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00739       TAO_EC_Consumer_List_Iterator,
00740       ACE_SYNCH> ();
00741   else if (this->consumer_collection_ == 0x003)
00742     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
00743       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00744       TAO_EC_Consumer_List_Iterator,
00745       ACE_SYNCH> ();
00746   else if (this->consumer_collection_ == 0x010)
00747     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
00748       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00749       TAO_EC_Consumer_RB_Tree_Iterator,
00750       TAO_SYNCH_MUTEX> ();
00751   else if (this->consumer_collection_ == 0x011)
00752     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
00753       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00754       TAO_EC_Consumer_RB_Tree_Iterator,
00755       TAO_SYNCH_MUTEX> ();
00756   else if (this->consumer_collection_ == 0x012)
00757     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
00758       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00759       TAO_EC_Consumer_RB_Tree_Iterator,
00760       ACE_SYNCH> ();
00761   else if (this->consumer_collection_ == 0x013)
00762     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
00763       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00764       TAO_EC_Consumer_RB_Tree_Iterator,
00765       ACE_SYNCH> ();
00766   else if (this->consumer_collection_ == 0x100)
00767     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
00768       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00769       TAO_EC_Consumer_List_Iterator,
00770       ACE_Null_Mutex> ();
00771   else if (this->consumer_collection_ == 0x101)
00772     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
00773       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00774       TAO_EC_Consumer_List_Iterator,
00775       ACE_Null_Mutex> ();
00776   else if (this->consumer_collection_ == 0x102)
00777     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
00778       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00779       TAO_EC_Consumer_List_Iterator,
00780       ACE_NULL_SYNCH> ();
00781   else if (this->consumer_collection_ == 0x103)
00782     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
00783       TAO_ESF_Proxy_List<TAO_EC_ProxyPushConsumer>,
00784       TAO_EC_Consumer_List_Iterator,
00785       ACE_NULL_SYNCH> ();
00786   else if (this->consumer_collection_ == 0x110)
00787     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushConsumer,
00788       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00789       TAO_EC_Consumer_RB_Tree_Iterator,
00790       ACE_Null_Mutex> ();
00791   else if (this->consumer_collection_ == 0x111)
00792     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushConsumer,
00793       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00794       TAO_EC_Consumer_RB_Tree_Iterator,
00795       ACE_Null_Mutex> ();
00796   else if (this->consumer_collection_ == 0x112)
00797     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushConsumer,
00798       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00799       TAO_EC_Consumer_RB_Tree_Iterator,
00800       ACE_NULL_SYNCH> ();
00801   else if (this->consumer_collection_ == 0x113)
00802     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushConsumer,
00803       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushConsumer>,
00804       TAO_EC_Consumer_RB_Tree_Iterator,
00805       ACE_NULL_SYNCH> ();
00806 
00807   return 0;
00808 }

TAO_EC_ProxyPushSupplier * TAO_EC_Default_Factory::create_proxy_push_supplier TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy a ProxyPushSupplier.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_TPC_Factory.

Definition at line 614 of file EC_Default_Factory.cpp.

References consumer_validate_connection_.

00615 {
00616   return new TAO_EC_Default_ProxyPushSupplier (ec, consumer_validate_connection_);
00617 }

TAO_EC_ProxyPushSupplier_Collection * TAO_EC_Default_Factory::create_proxy_push_supplier_collection TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy a collection of TAO_EC_ProxyPushSuppliers.

Implements TAO_EC_Factory.

Definition at line 817 of file EC_Default_Factory.cpp.

References ACE_SYNCH, supplier_collection_, TAO_EC_ProxyPushSupplier, TAO_EC_Supplier_List_Iterator, TAO_EC_Supplier_RB_Tree_Iterator, and TAO_SYNCH_MUTEX.

00818 {
00819   if (this->supplier_collection_ == 0x000)
00820     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
00821       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00822       TAO_EC_Supplier_List_Iterator,
00823       TAO_SYNCH_MUTEX> ();
00824   else if (this->supplier_collection_ == 0x001)
00825     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
00826       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00827       TAO_EC_Supplier_List_Iterator,
00828       TAO_SYNCH_MUTEX> ();
00829   else if (this->supplier_collection_ == 0x002)
00830     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
00831       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00832       TAO_EC_Supplier_List_Iterator,
00833       ACE_SYNCH> ();
00834   else if (this->supplier_collection_ == 0x003)
00835     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
00836       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00837       TAO_EC_Supplier_List_Iterator,
00838       ACE_SYNCH> ();
00839   else if (this->supplier_collection_ == 0x010)
00840     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
00841       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00842       TAO_EC_Supplier_RB_Tree_Iterator,
00843       TAO_SYNCH_MUTEX> ();
00844   else if (this->supplier_collection_ == 0x011)
00845     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
00846       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00847       TAO_EC_Supplier_RB_Tree_Iterator,
00848       TAO_SYNCH_MUTEX> ();
00849   else if (this->supplier_collection_ == 0x012)
00850     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
00851       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00852       TAO_EC_Supplier_RB_Tree_Iterator,
00853       ACE_SYNCH> ();
00854   else if (this->supplier_collection_ == 0x013)
00855     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
00856       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00857       TAO_EC_Supplier_RB_Tree_Iterator,
00858       ACE_SYNCH> ();
00859   else if (this->supplier_collection_ == 0x100)
00860     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
00861       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00862       TAO_EC_Supplier_List_Iterator,
00863       ACE_Null_Mutex> ();
00864   else if (this->supplier_collection_ == 0x101)
00865     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
00866       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00867       TAO_EC_Supplier_List_Iterator,
00868       ACE_Null_Mutex> ();
00869   else if (this->supplier_collection_ == 0x102)
00870     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
00871       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00872       TAO_EC_Supplier_List_Iterator,
00873       ACE_NULL_SYNCH> ();
00874   else if (this->supplier_collection_ == 0x103)
00875     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
00876       TAO_ESF_Proxy_List<TAO_EC_ProxyPushSupplier>,
00877       TAO_EC_Supplier_List_Iterator,
00878       ACE_NULL_SYNCH> ();
00879   else if (this->supplier_collection_ == 0x110)
00880     return new TAO_ESF_Immediate_Changes<TAO_EC_ProxyPushSupplier,
00881       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00882       TAO_EC_Supplier_RB_Tree_Iterator,
00883       ACE_Null_Mutex> ();
00884   else if (this->supplier_collection_ == 0x111)
00885     return new TAO_ESF_Copy_On_Read<TAO_EC_ProxyPushSupplier,
00886       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00887       TAO_EC_Supplier_RB_Tree_Iterator,
00888       ACE_Null_Mutex> ();
00889   else if (this->supplier_collection_ == 0x112)
00890     return new TAO_ESF_Copy_On_Write<TAO_EC_ProxyPushSupplier,
00891       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00892       TAO_EC_Supplier_RB_Tree_Iterator,
00893       ACE_NULL_SYNCH> ();
00894   else if (this->supplier_collection_ == 0x113)
00895     return new TAO_ESF_Delayed_Changes<TAO_EC_ProxyPushSupplier,
00896       TAO_ESF_Proxy_RB_Tree<TAO_EC_ProxyPushSupplier>,
00897       TAO_EC_Supplier_RB_Tree_Iterator,
00898       ACE_NULL_SYNCH> ();
00899 
00900   return 0;
00901 }

TAO_EC_Scheduling_Strategy * TAO_EC_Default_Factory::create_scheduling_strategy TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the observer strategy.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_Sched_Factory.

Definition at line 693 of file EC_Default_Factory.cpp.

References scheduling_.

Referenced by TAO_EC_Kokyu_Factory::create_scheduling_strategy().

00694 {
00695   if (this->scheduling_ == 0)
00696     return new TAO_EC_Null_Scheduling;
00697   else if (this->scheduling_ == 1)
00698     return new TAO_EC_Group_Scheduling;
00699   return 0;
00700 }

TAO_EC_SupplierAdmin * TAO_EC_Default_Factory::create_supplier_admin TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the supplier admin implementation.

Implements TAO_EC_Factory.

Definition at line 602 of file EC_Default_Factory.cpp.

00603 {
00604   return new TAO_EC_SupplierAdmin (ec);
00605 }

TAO_EC_SupplierControl * TAO_EC_Default_Factory::create_supplier_control TAO_EC_Event_Channel_Base  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 970 of file EC_Default_Factory.cpp.

References CORBA::ORB_init(), supplier_control_, and supplier_control_timeout_.

00971 {
00972   if (this->supplier_control_ == 0)
00973     return new TAO_EC_SupplierControl ();
00974   else if (this->supplier_control_ == 1)
00975     {
00976       int argc = 0;
00977       char **argv = 0;
00978       CORBA::ORB_var orb =
00979         CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
00980 
00981       ACE_Time_Value rate (0, this->supplier_control_period_);
00982       return new TAO_EC_Reactive_SupplierControl (rate, supplier_control_timeout_, ec, orb.in ());
00983     }
00984   return 0;
00985 }

TAO_EC_Supplier_Filter_Builder * TAO_EC_Default_Factory::create_supplier_filter_builder TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the filter builder.

Implements TAO_EC_Factory.

Definition at line 574 of file EC_Default_Factory.cpp.

References supplier_filtering_.

00575 {
00576   if (this->supplier_filtering_ == 0)
00577     return new TAO_EC_Trivial_Supplier_Filter_Builder (ec);
00578   else if (this->supplier_filtering_ == 1)
00579     return new TAO_EC_Per_Supplier_Filter_Builder (ec);
00580   return 0;
00581 }

ACE_Lock * TAO_EC_Default_Factory::create_supplier_lock void   )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 928 of file EC_Default_Factory.cpp.

References supplier_lock_.

00929 {
00930   if (this->supplier_lock_ == 0)
00931     return new ACE_Lock_Adapter<ACE_Null_Mutex>;
00932   else if (this->supplier_lock_ == 1)
00933     return new ACE_Lock_Adapter<TAO_SYNCH_MUTEX> ();
00934   else if (this->supplier_lock_ == 2)
00935     return new ACE_Lock_Adapter<TAO_SYNCH_RECURSIVE_MUTEX> ();
00936   return 0;
00937 }

TAO_EC_Timeout_Generator * TAO_EC_Default_Factory::create_timeout_generator TAO_EC_Event_Channel_Base  )  [virtual]
 

Create and destroy the timer module.

Implements TAO_EC_Factory.

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_Sched_Factory.

Definition at line 638 of file EC_Default_Factory.cpp.

References CORBA::ORB_init().

Referenced by TAO_EC_Sched_Factory::create_timeout_generator(), and TAO_EC_Kokyu_Factory::create_timeout_generator().

00639 {
00640   if (this->timeout_ == 0)
00641     {
00642       int argc = 0;
00643       char **argv = 0;
00644       CORBA::ORB_var orb =
00645         CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
00646 
00647       ACE_Reactor *reactor = orb->orb_core ()->reactor ();
00648       return new TAO_EC_Reactive_Timeout_Generator (reactor);
00649     }
00650 #if 0
00651   else if (this->timeout_ == 1)
00652     {
00653     }
00654 #endif
00655   return 0;
00656 }

void TAO_EC_Default_Factory::destroy_consumer_admin TAO_EC_ConsumerAdmin  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 596 of file EC_Default_Factory.cpp.

00597 {
00598   delete x;
00599 }

void TAO_EC_Default_Factory::destroy_consumer_control TAO_EC_ConsumerControl  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 964 of file EC_Default_Factory.cpp.

00965 {
00966   delete x;
00967 }

void TAO_EC_Default_Factory::destroy_consumer_lock ACE_Lock  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 922 of file EC_Default_Factory.cpp.

00923 {
00924   delete x;
00925 }

void TAO_EC_Default_Factory::destroy_dispatching TAO_EC_Dispatching  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 550 of file EC_Default_Factory.cpp.

00551 {
00552   delete x;
00553 }

void TAO_EC_Default_Factory::destroy_filter_builder TAO_EC_Filter_Builder  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 568 of file EC_Default_Factory.cpp.

00569 {
00570   delete x;
00571 }

void TAO_EC_Default_Factory::destroy_observer_strategy TAO_EC_ObserverStrategy  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 687 of file EC_Default_Factory.cpp.

00688 {
00689   delete x;
00690 }

void TAO_EC_Default_Factory::destroy_proxy_push_consumer TAO_EC_ProxyPushConsumer  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 632 of file EC_Default_Factory.cpp.

00633 {
00634   delete x;
00635 }

void TAO_EC_Default_Factory::destroy_proxy_push_consumer_collection TAO_EC_ProxyPushConsumer_Collection  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 811 of file EC_Default_Factory.cpp.

References TAO_EC_ProxyPushConsumer_Collection.

00812 {
00813   delete x;
00814 }

void TAO_EC_Default_Factory::destroy_proxy_push_supplier TAO_EC_ProxyPushSupplier  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 620 of file EC_Default_Factory.cpp.

00621 {
00622   delete x;
00623 }

void TAO_EC_Default_Factory::destroy_proxy_push_supplier_collection TAO_EC_ProxyPushSupplier_Collection  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 904 of file EC_Default_Factory.cpp.

References TAO_EC_ProxyPushSupplier_Collection.

00905 {
00906   delete x;
00907 }

void TAO_EC_Default_Factory::destroy_scheduling_strategy TAO_EC_Scheduling_Strategy  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 703 of file EC_Default_Factory.cpp.

00704 {
00705   delete x;
00706 }

void TAO_EC_Default_Factory::destroy_supplier_admin TAO_EC_SupplierAdmin  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 608 of file EC_Default_Factory.cpp.

00609 {
00610   delete x;
00611 }

void TAO_EC_Default_Factory::destroy_supplier_control TAO_EC_SupplierControl  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 988 of file EC_Default_Factory.cpp.

00989 {
00990   delete x;
00991 }

void TAO_EC_Default_Factory::destroy_supplier_filter_builder TAO_EC_Supplier_Filter_Builder  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 584 of file EC_Default_Factory.cpp.

00585 {
00586   delete x;
00587 }

void TAO_EC_Default_Factory::destroy_supplier_lock ACE_Lock  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 940 of file EC_Default_Factory.cpp.

00941 {
00942   delete x;
00943 }

void TAO_EC_Default_Factory::destroy_timeout_generator TAO_EC_Timeout_Generator  )  [virtual]
 

Implements TAO_EC_Factory.

Definition at line 659 of file EC_Default_Factory.cpp.

00660 {
00661   delete x;
00662 }

TAO_EC_Queue_Full_Service_Object * TAO_EC_Default_Factory::find_service_object const char *  wanted,
const char *  fallback
[protected]
 

Definition at line 502 of file EC_Default_Factory.cpp.

References ACE_OS::abort(), ACE_ERROR, ACE_Dynamic_Service< TYPE >::instance(), and LM_ERROR.

Referenced by TAO_EC_TPC_Factory::create_dispatching(), and create_dispatching().

00504 {
00505   TAO_EC_Queue_Full_Service_Object* so = 0;
00506   so = ACE_Dynamic_Service<TAO_EC_Queue_Full_Service_Object>::instance (wanted);
00507   if (so != 0)
00508     return so;
00509 
00510   ACE_ERROR ((LM_ERROR,
00511               "EC (%P|%t) EC_Default_Factory::create_dispatching "
00512               "unable to find queue full service object '%s'; "
00513               "using '%s' instead\n",
00514               wanted,
00515               fallback));
00516 
00517   so = ACE_Dynamic_Service<TAO_EC_Queue_Full_Service_Object>::instance (fallback);
00518   if (so != 0)
00519     return so;
00520 
00521   ACE_ERROR ((LM_ERROR,
00522               "EC (%P|%t) EC_Default_Factory::create_dispatching "
00523                       "unable find default queue full service object '%s'; "
00524                       "aborting.\n",
00525                       fallback));
00526   ACE_OS::abort ();
00527   return 0; // superfluous return to de-warn; we should never reach here
00528 }

int TAO_EC_Default_Factory::fini void   )  [virtual]
 

Reimplemented from ACE_Shared_Object.

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_Sched_Factory.

Definition at line 494 of file EC_Default_Factory.cpp.

00495 {
00496   return 0;
00497 }

int TAO_EC_Default_Factory::init int  argc,
ACE_TCHAR argv[]
[virtual]
 

Reimplemented from ACE_Shared_Object.

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_Sched_Factory.

Definition at line 70 of file EC_Default_Factory.cpp.

References ACE_Arg_Shifter, ACE_DEBUG, ACE_ERROR, ACE_SCHED_FIFO, ACE_TCHAR, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, ACE_OS::atoi(), consumer_collection_, consumer_control_, consumer_control_period_, consumer_control_timeout_, consumer_lock_, consumer_validate_connection_, dispatching_, dispatching_threads_, dispatching_threads_priority_, filtering_, ACE_OS::free(), LM_DEBUG, LM_ERROR, ACE_Sched_Params::next_priority(), observer_, ACE_Sched_Params::priority_max(), ACE_Sched_Params::priority_min(), queue_full_service_object_name_, scheduling_, ACE_OS::strcasecmp(), ACE_OS::strdup(), ACE_OS::strncmp(), ACE_OS::strtok_r(), ACE_OS::strtoul(), supplier_collection_, supplier_control_, supplier_control_period_, supplier_control_timeout_, supplier_filtering_, supplier_lock_, unsupported_option_value(), and ACE_Time_Value::usec().

Referenced by TAO_EC_TPC_Factory::init(), TAO_EC_Sched_Factory::init(), and TAO_EC_Kokyu_Factory::init().

00071 {
00072   ACE_Arg_Shifter arg_shifter (argc, argv);
00073 
00074   int priority =
00075     (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) +
00076      ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
00077   this->dispatching_threads_priority_ =
00078     ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, priority);
00079 
00080   while (arg_shifter.is_anything_left ())
00081     {
00082       const ACE_TCHAR *arg = arg_shifter.get_current ();
00083 
00084       if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0)
00085         {
00086           arg_shifter.consume_arg ();
00087 
00088           if (arg_shifter.is_parameter_next ())
00089             {
00090               const ACE_TCHAR* opt = arg_shifter.get_current ();
00091               if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00092                 this->dispatching_ = 0;
00093               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0)
00094                 this->dispatching_ = 1;
00095               else
00096                   this->unsupported_option_value ("-ECDispatching", opt);
00097               arg_shifter.consume_arg ();
00098             }
00099         }
00100 
00101       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatchingThreads")) == 0)
00102         {
00103           arg_shifter.consume_arg ();
00104 
00105           if (arg_shifter.is_parameter_next ())
00106             {
00107               const ACE_TCHAR* opt = arg_shifter.get_current ();
00108               this->dispatching_threads_ = ACE_OS::atoi (opt);
00109               arg_shifter.consume_arg ();
00110             }
00111         }
00112 
00113       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0)
00114         {
00115           arg_shifter.consume_arg ();
00116 
00117           if (arg_shifter.is_parameter_next ())
00118             {
00119               const ACE_TCHAR* opt = arg_shifter.get_current ();
00120               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00121                 this->filtering_ = 0;
00122               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
00123                 this->filtering_ = 1;
00124               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0)
00125                 this->filtering_ = 2;
00126               else
00127                   this->unsupported_option_value ("-ECFiltering", opt);
00128               arg_shifter.consume_arg ();
00129             }
00130         }
00131 
00132       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierFilter")) == 0
00133                // @@ TODO remove, only for backwards compatibility
00134                || ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierFiltering")) == 0)
00135         {
00136           arg_shifter.consume_arg ();
00137 
00138           if (arg_shifter.is_parameter_next ())
00139             {
00140               const ACE_TCHAR* opt = arg_shifter.get_current ();
00141               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00142                 this->supplier_filtering_ = 0;
00143               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("per-supplier")) == 0)
00144                 this->supplier_filtering_ = 1;
00145               else
00146                   this->unsupported_option_value ("-ECSupplierFilter", opt);
00147               arg_shifter.consume_arg ();
00148             }
00149         }
00150 
00151       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECTimeout")) == 0)
00152         {
00153           arg_shifter.consume_arg ();
00154 
00155           if (arg_shifter.is_parameter_next ())
00156             {
00157               const ACE_TCHAR* opt = arg_shifter.get_current ();
00158               if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00159                 this->timeout_ = 0;
00160               else
00161                   this->unsupported_option_value ("-ECTimeout", opt);
00162               arg_shifter.consume_arg ();
00163             }
00164         }
00165 
00166       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECObserver")) == 0)
00167         {
00168           arg_shifter.consume_arg ();
00169 
00170           if (arg_shifter.is_parameter_next ())
00171             {
00172               const ACE_TCHAR* opt = arg_shifter.get_current ();
00173               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00174                 this->observer_ = 0;
00175               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0)
00176                 this->observer_ = 1;
00177               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00178                 this->observer_ = 2;
00179               else
00180                   this->unsupported_option_value ("-ECObserver", opt);
00181               arg_shifter.consume_arg ();
00182             }
00183         }
00184 
00185       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECScheduling")) == 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                 this->scheduling_ = 0;
00194               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("group")) == 0)
00195                 this->scheduling_ = 1;
00196               else
00197                   this->unsupported_option_value ("-ECScheduling", opt);
00198               arg_shifter.consume_arg ();
00199             }
00200         }
00201 
00202       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyPushConsumerCollection")) == 0)
00203         {
00204           arg_shifter.consume_arg ();
00205 
00206           if (arg_shifter.is_parameter_next ())
00207             {
00208               const ACE_TCHAR *current_arg = arg_shifter.get_current ();
00209               ACE_TCHAR *opt = ACE_OS::strdup (current_arg);
00210               int collection_type = 0;
00211               int synch_type = 0;
00212               int iteration_type = 0;
00213 
00214               ACE_TCHAR* aux;
00215               for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
00216                    arg != 0;
00217                    arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
00218                 {
00219                   if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
00220                     synch_type = 0;
00221                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
00222                     synch_type = 1;
00223                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
00224                     collection_type = 0;
00225                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
00226                     collection_type = 1;
00227                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
00228                     iteration_type = 0;
00229                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
00230                     iteration_type = 1;
00231                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
00232                     iteration_type = 2;
00233                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
00234                     iteration_type = 3;
00235                   else
00236                     ACE_ERROR ((LM_ERROR,
00237                                 "EC_Default_Factory - "
00238                                 "Unknown consumer collection modifier <%s>.\n", arg));
00239                 }
00240               ACE_OS::free (opt);
00241               this->consumer_collection_ =
00242                  (synch_type << 8) |(collection_type << 4) | iteration_type;
00243               arg_shifter.consume_arg ();
00244             }
00245         }
00246 
00247       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyPushSupplierCollection")) == 0)
00248         {
00249           arg_shifter.consume_arg ();
00250 
00251           if (arg_shifter.is_parameter_next ())
00252             {
00253               const ACE_TCHAR* current_arg = arg_shifter.get_current();
00254               ACE_TCHAR* opt = ACE_OS::strdup(current_arg);
00255               int collection_type = 0;
00256               int synch_type = 0;
00257               int iteration_type = 0;
00258 
00259               ACE_TCHAR* aux;
00260               for (ACE_TCHAR* arg = ACE_OS::strtok_r (opt, ACE_TEXT(":"), &aux);
00261                    arg != 0;
00262                    arg = ACE_OS::strtok_r (0, ACE_TEXT(":"), &aux))
00263                 {
00264                   if (ACE_OS::strcasecmp (arg, ACE_TEXT("mt")) == 0)
00265                     synch_type = 0;
00266                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("st")) == 0)
00267                     synch_type = 1;
00268                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("list")) == 0)
00269                     collection_type = 0;
00270                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("rb_tree")) == 0)
00271                     collection_type = 1;
00272                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("immediate")) == 0)
00273                     iteration_type = 0;
00274                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_read")) == 0)
00275                     iteration_type = 1;
00276                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("copy_on_write")) == 0)
00277                     iteration_type = 2;
00278                   else if (ACE_OS::strcasecmp (arg, ACE_TEXT("delayed")) == 0)
00279                     iteration_type = 3;
00280                   else
00281                     ACE_ERROR ((LM_ERROR,
00282                                 "EC_Default_Factory - "
00283                                 "Unknown supplier collection modifier <%s>.\n", arg));
00284                 }
00285               ACE_OS::free(opt);
00286               this->supplier_collection_ =
00287                 (synch_type << 8) | (collection_type << 4) | iteration_type;
00288               arg_shifter.consume_arg ();
00289             }
00290         }
00291 
00292       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxyConsumerLock")) == 0)
00293         {
00294           arg_shifter.consume_arg ();
00295 
00296           if (arg_shifter.is_parameter_next ())
00297             {
00298               const ACE_TCHAR* opt = arg_shifter.get_current ();
00299               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00300                 this->consumer_lock_ = 0;
00301               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
00302                 this->consumer_lock_ = 1;
00303               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
00304                 this->consumer_lock_ = 2;
00305               else
00306                 this->unsupported_option_value ("-ECProxyConsumerLock", opt);
00307               arg_shifter.consume_arg ();
00308             }
00309         }
00310 
00311       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECProxySupplierLock")) == 0)
00312         {
00313           arg_shifter.consume_arg ();
00314 
00315           if (arg_shifter.is_parameter_next ())
00316             {
00317               const ACE_TCHAR* opt = arg_shifter.get_current ();
00318               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00319                 this->supplier_lock_ = 0;
00320               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("thread")) == 0)
00321                 this->supplier_lock_ = 1;
00322               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("recursive")) == 0)
00323                 this->supplier_lock_ = 2;
00324               else
00325                 this->unsupported_option_value ("-ECProxySupplierLock", opt);
00326               arg_shifter.consume_arg ();
00327             }
00328         }
00329 
00330       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECUseORBId")) == 0)
00331         {
00332           arg_shifter.consume_arg ();
00333 
00334           if (arg_shifter.is_parameter_next ())
00335             {
00336               // Save argument for later use
00337               this->orbid_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
00338               arg_shifter.consume_arg ();
00339             }
00340         }
00341 
00342       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControl")) == 0)
00343         {
00344           arg_shifter.consume_arg ();
00345 
00346           if (arg_shifter.is_parameter_next ())
00347             {
00348               const ACE_TCHAR* opt = arg_shifter.get_current ();
00349               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00350                 this->consumer_control_ = 0;
00351               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00352                 this->consumer_control_ = 1;
00353               else
00354                 this->unsupported_option_value ("-ECConsumerControl", opt);
00355               arg_shifter.consume_arg ();
00356             }
00357         }
00358 
00359       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControl")) == 0)
00360         {
00361           arg_shifter.consume_arg ();
00362 
00363           if (arg_shifter.is_parameter_next ())
00364             {
00365               const ACE_TCHAR* opt = arg_shifter.get_current ();
00366               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00367                 this->supplier_control_ = 0;
00368               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00369                 this->supplier_control_ = 1;
00370               else
00371                 this->unsupported_option_value ("-ECSupplierControl", opt);
00372               arg_shifter.consume_arg ();
00373             }
00374         }
00375 
00376       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControlPeriod")) == 0)
00377         {
00378           arg_shifter.consume_arg ();
00379 
00380           if (arg_shifter.is_parameter_next ())
00381             {
00382               const ACE_TCHAR* opt = arg_shifter.get_current ();
00383               this->consumer_control_period_ = ACE_OS::atoi (opt);
00384               arg_shifter.consume_arg ();
00385             }
00386         }
00387 
00388       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControlPeriod")) == 0)
00389         {
00390           arg_shifter.consume_arg ();
00391 
00392           if (arg_shifter.is_parameter_next ())
00393             {
00394               const ACE_TCHAR* opt = arg_shifter.get_current ();
00395               this->supplier_control_period_ = ACE_OS::atoi (opt);
00396               arg_shifter.consume_arg ();
00397             }
00398         }
00399 
00400       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerControlTimeout")) == 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               unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
00408               this->consumer_control_timeout_.usec(timeout);
00409               arg_shifter.consume_arg ();
00410             }
00411         }
00412 
00413       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierControlTimeout")) == 0)
00414         {
00415           arg_shifter.consume_arg ();
00416 
00417           if (arg_shifter.is_parameter_next ())
00418             {
00419               const ACE_TCHAR* opt = arg_shifter.get_current ();
00420               unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
00421               this->supplier_control_timeout_.usec(timeout);
00422               arg_shifter.consume_arg ();
00423             }
00424         }
00425 
00426       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerValidateConnection")) == 0)
00427         {
00428           arg_shifter.consume_arg ();
00429 
00430           if (arg_shifter.is_parameter_next ())
00431             {
00432               const ACE_TCHAR* opt = arg_shifter.get_current ();
00433               this->consumer_validate_connection_ = ACE_OS::atoi (opt);
00434               arg_shifter.consume_arg ();
00435             }
00436         }
00437 
00438       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECPushSupplierSet")) == 0)
00439         {
00440           ACE_ERROR ((LM_ERROR,
00441                       "EC_Default_Factory - "
00442                       "obsolete option <%s>, ignored\n", arg));
00443           arg_shifter.consume_arg ();
00444         }
00445 
00446       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECQueueFullServiceObject")) == 0)
00447         {
00448           arg_shifter.consume_arg ();
00449           if (arg_shifter.is_parameter_next ())
00450             {
00451               const char* opt = arg_shifter.get_current ();
00452               this->queue_full_service_object_name_.set(opt);
00453               arg_shifter.consume_arg ();
00454             }
00455         }
00456 
00457       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECConsumerAdminLock")) == 0)
00458         {
00459           ACE_ERROR ((LM_ERROR,
00460                       "EC_Default_Factory - "
00461                       "obsolete option <%s>, ignored\n", arg));
00462           arg_shifter.consume_arg ();
00463         }
00464 
00465       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECSupplierAdminLock")) == 0)
00466         {
00467           ACE_ERROR ((LM_ERROR,
00468                       "EC_Default_Factory - "
00469                       "obsolete option <%s>, ignored\n", arg));
00470           arg_shifter.consume_arg ();
00471         }
00472 
00473       else if (ACE_OS::strncmp (arg, ACE_TEXT("-EC"), 3) == 0)
00474         {
00475           arg_shifter.consume_arg ();
00476           ACE_ERROR ((LM_ERROR,
00477                       "EC_Default_Factory - "
00478                       "unknown option <%s>\n",
00479                       arg));
00480         }
00481       else
00482         {
00483           arg_shifter.consume_arg ();
00484           ACE_DEBUG ((LM_DEBUG,
00485                       "EC_Default_Factory - "
00486                       "ignoring option <%s>\n",
00487                       arg));
00488         }
00489     }
00490   return 0;
00491 }

int TAO_EC_Default_Factory::init_svcs void   )  [static]
 

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

Reimplemented in TAO_EC_Kokyu_Factory, and TAO_EC_TPC_Factory.

Definition at line 50 of file EC_Default_Factory.cpp.

References TAO_EC_Simple_Queue_Full_Action::init_svcs(), and ACE_Service_Config::static_svcs().

00051 {
00052   TAO_EC_Simple_Queue_Full_Action::init_svcs();
00053   return ACE_Service_Config::static_svcs ()->
00054     insert (&ace_svc_desc_TAO_EC_Default_Factory);
00055 }

ACE_INLINE const ACE_CString & TAO_EC_Default_Factory::orb_id void   )  const
 

Accessor to ORBid.

Definition at line 54 of file EC_Default_Factory.i.

00055 {
00056   return this->orbid_;
00057 }

ACE_INLINE int TAO_EC_Default_Factory::supplier_collection void   )  const
 

Accessors to supplier collection flags.

Definition at line 42 of file EC_Default_Factory.i.

References supplier_collection_.

00043 {
00044   return this->supplier_collection_;
00045 }

ACE_INLINE int TAO_EC_Default_Factory::supplier_filtering void   )  const
 

Accessors to supplier filtering flags.

Definition at line 48 of file EC_Default_Factory.i.

References supplier_filtering_.

00049 {
00050   return this->supplier_filtering_;
00051 }

void TAO_EC_Default_Factory::unsupported_option_value const char *  option_name,
const char *  option_value
[protected]
 

Helper for agrument parsing. Prints out an error message about unsupported option value.

Definition at line 58 of file EC_Default_Factory.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by init().

00060 {
00061   ACE_ERROR ((LM_ERROR,
00062               "EC_Default_Factory - "
00063               "Unsupported <%s> option value: <%s>. "
00064               "Ignoring this option - using defaults instead.\n",
00065               option_name,
00066               option_value));
00067 }


Member Data Documentation

int TAO_EC_Default_Factory::consumer_collection_ [protected]
 

Definition at line 154 of file EC_Default_Factory.h.

Referenced by consumer_collection(), create_proxy_push_consumer_collection(), and init().

int TAO_EC_Default_Factory::consumer_control_ [protected]
 

The consumer and supplier control policies.

Definition at line 173 of file EC_Default_Factory.h.

Referenced by create_consumer_control(), and init().

int TAO_EC_Default_Factory::consumer_control_period_ [protected]
 

The consumer and supplier control periods in usecs.

Definition at line 177 of file EC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_EC_Default_Factory::consumer_control_timeout_ [protected]
 

The consumer control timeout in usecs.

Definition at line 181 of file EC_Default_Factory.h.

Referenced by create_consumer_control(), and init().

int TAO_EC_Default_Factory::consumer_lock_ [protected]
 

Definition at line 156 of file EC_Default_Factory.h.

Referenced by create_consumer_lock(), and init().

int TAO_EC_Default_Factory::consumer_validate_connection_ [protected]
 

Validate the connection to consumer on connect.

Definition at line 187 of file EC_Default_Factory.h.

Referenced by create_proxy_push_supplier(), and init().

int TAO_EC_Default_Factory::dispatching_ [protected]
 

Several flags to control the kind of object created.

Definition at line 148 of file EC_Default_Factory.h.

Referenced by create_dispatching(), and init().

int TAO_EC_Default_Factory::dispatching_threads_ [protected]
 

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

Definition at line 161 of file EC_Default_Factory.h.

Referenced by init().

int TAO_EC_Default_Factory::dispatching_threads_flags_ [protected]
 

Definition at line 162 of file EC_Default_Factory.h.

int TAO_EC_Default_Factory::dispatching_threads_force_active_ [protected]
 

Definition at line 164 of file EC_Default_Factory.h.

int TAO_EC_Default_Factory::dispatching_threads_priority_ [protected]
 

Definition at line 163 of file EC_Default_Factory.h.

Referenced by init().

int TAO_EC_Default_Factory::filtering_ [protected]
 

Definition at line 149 of file EC_Default_Factory.h.

Referenced by create_filter_builder(), and init().

int TAO_EC_Default_Factory::observer_ [protected]
 

Definition at line 152 of file EC_Default_Factory.h.

Referenced by create_observer_strategy(), and init().

ACE_CString TAO_EC_Default_Factory::orbid_ [protected]
 

Use this ORB to locate global resources.

Definition at line 170 of file EC_Default_Factory.h.

ACE_CString TAO_EC_Default_Factory::queue_full_service_object_name_ [protected]
 

Definition at line 165 of file EC_Default_Factory.h.

Referenced by init().

int TAO_EC_Default_Factory::scheduling_ [protected]
 

Definition at line 153 of file EC_Default_Factory.h.

Referenced by create_scheduling_strategy(), and init().

int TAO_EC_Default_Factory::supplier_collection_ [protected]
 

Definition at line 155 of file EC_Default_Factory.h.

Referenced by create_proxy_push_supplier_collection(), init(), and supplier_collection().

int TAO_EC_Default_Factory::supplier_control_ [protected]
 

Definition at line 174 of file EC_Default_Factory.h.

Referenced by create_supplier_control(), and init().

int TAO_EC_Default_Factory::supplier_control_period_ [protected]
 

Definition at line 178 of file EC_Default_Factory.h.

Referenced by init().

ACE_Time_Value TAO_EC_Default_Factory::supplier_control_timeout_ [protected]
 

The supplier control timeout in usecs.

Definition at line 184 of file EC_Default_Factory.h.

Referenced by create_supplier_control(), and init().

int TAO_EC_Default_Factory::supplier_filtering_ [protected]
 

Definition at line 150 of file EC_Default_Factory.h.

Referenced by create_supplier_filter_builder(), init(), and supplier_filtering().

int TAO_EC_Default_Factory::supplier_lock_ [protected]
 

Definition at line 157 of file EC_Default_Factory.h.

Referenced by create_supplier_lock(), and init().

int TAO_EC_Default_Factory::timeout_ [protected]
 

Definition at line 151 of file EC_Default_Factory.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:14:32 2006 for TAO_RTEvent by doxygen 1.3.6