00001 // -*- C++ -*- 00002 /** 00003 * @file EC_Factory.h 00004 * 00005 * EC_Factory.h,v 1.29 2006/03/15 07:52:21 jtc Exp 00006 * 00007 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00008 * 00009 * Based on previous work by Tim Harrison (harrison@cs.wustl.edu) and 00010 * other members of the DOC group. More details can be found in: 00011 * 00012 * http://doc.ece.uci.edu/~coryan/EC/index.html 00013 */ 00014 00015 #ifndef TAO_EC_FACTORY_H 00016 #define TAO_EC_FACTORY_H 00017 00018 #include /**/ "ace/pre.h" 00019 00020 #include /**/ "orbsvcs/Event/event_serv_export.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 #include "tao/Versioned_Namespace.h" 00027 00028 #include "ace/Service_Object.h" 00029 00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00031 class ACE_Lock; 00032 ACE_END_VERSIONED_NAMESPACE_DECL 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 class TAO_EC_Event_Channel_Base; 00037 00038 class TAO_EC_Dispatching; 00039 class TAO_EC_Filter_Builder; 00040 class TAO_EC_Supplier_Filter_Builder; 00041 class TAO_EC_ConsumerAdmin; 00042 class TAO_EC_SupplierAdmin; 00043 class TAO_EC_ProxyPushConsumer; 00044 class TAO_EC_ProxyPushSupplier; 00045 class TAO_EC_ObserverStrategy; 00046 template<class PROXY> class TAO_ESF_Proxy_Collection; 00047 class TAO_EC_Timeout_Generator; 00048 class TAO_EC_Scheduling_Strategy; 00049 class TAO_EC_ConsumerControl; 00050 class TAO_EC_SupplierControl; 00051 00052 typedef TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushConsumer> TAO_EC_ProxyPushConsumer_Collection; 00053 typedef TAO_ESF_Proxy_Collection<TAO_EC_ProxyPushSupplier> TAO_EC_ProxyPushSupplier_Collection; 00054 00055 /** 00056 * @class TAO_EC_Factory 00057 * 00058 * @brief Abstract base class for the Event Channel components. 00059 * 00060 * Defines the EC_Factory interface. 00061 * 00062 * <H2>Memory Management</H2> 00063 * The objects it creates are owned by this class, the client must 00064 * invoke the corresponding destroy() method to release them. 00065 * Some implementations may require a different instance for the 00066 * EC_Factory for each instance of Event_Channel. 00067 */ 00068 class TAO_RTEvent_Serv_Export TAO_EC_Factory : public ACE_Service_Object 00069 { 00070 public: 00071 /// destructor... 00072 virtual ~TAO_EC_Factory (void); 00073 00074 /// Create and destroy the dispatching module. 00075 virtual TAO_EC_Dispatching* 00076 create_dispatching (TAO_EC_Event_Channel_Base*) = 0; 00077 virtual void 00078 destroy_dispatching (TAO_EC_Dispatching*) = 0; 00079 00080 /// Create and destroy the filter builder. 00081 virtual TAO_EC_Filter_Builder* 00082 create_filter_builder (TAO_EC_Event_Channel_Base*) = 0; 00083 virtual void 00084 destroy_filter_builder (TAO_EC_Filter_Builder*) = 0; 00085 00086 /// Create and destroy the filter builder. 00087 virtual TAO_EC_Supplier_Filter_Builder* 00088 create_supplier_filter_builder (TAO_EC_Event_Channel_Base*) = 0; 00089 virtual void 00090 destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*) = 0; 00091 00092 /// Create and destroy the consumer admin implementation. 00093 virtual TAO_EC_ConsumerAdmin* 00094 create_consumer_admin (TAO_EC_Event_Channel_Base*) = 0; 00095 virtual void 00096 destroy_consumer_admin (TAO_EC_ConsumerAdmin*) = 0; 00097 00098 /// Create and destroy the supplier admin implementation. 00099 virtual TAO_EC_SupplierAdmin* 00100 create_supplier_admin (TAO_EC_Event_Channel_Base*) = 0; 00101 virtual void 00102 destroy_supplier_admin (TAO_EC_SupplierAdmin*) = 0; 00103 00104 /// Create and destroy a ProxyPushSupplier 00105 virtual TAO_EC_ProxyPushSupplier* 00106 create_proxy_push_supplier (TAO_EC_Event_Channel_Base*) = 0; 00107 virtual void 00108 destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*) = 0; 00109 00110 /// Create and destroy a ProxyPushConsumer 00111 virtual TAO_EC_ProxyPushConsumer* 00112 create_proxy_push_consumer (TAO_EC_Event_Channel_Base*) = 0; 00113 virtual void 00114 destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*) = 0; 00115 00116 /// Create and destroy the timer module. 00117 virtual TAO_EC_Timeout_Generator* 00118 create_timeout_generator (TAO_EC_Event_Channel_Base*) = 0; 00119 virtual void 00120 destroy_timeout_generator (TAO_EC_Timeout_Generator*) = 0; 00121 00122 /// Create and destroy the observer strategy. 00123 virtual TAO_EC_ObserverStrategy* 00124 create_observer_strategy (TAO_EC_Event_Channel_Base*) = 0; 00125 virtual void 00126 destroy_observer_strategy (TAO_EC_ObserverStrategy*) = 0; 00127 00128 /// Create and destroy the observer strategy. 00129 virtual TAO_EC_Scheduling_Strategy* 00130 create_scheduling_strategy (TAO_EC_Event_Channel_Base*) = 0; 00131 virtual void 00132 destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*) = 0; 00133 00134 /// Create and destroy a collection of TAO_EC_ProxyPushConsumers 00135 virtual TAO_EC_ProxyPushConsumer_Collection* 00136 create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*) = 0; 00137 virtual void 00138 destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*) = 0; 00139 00140 /// Create and destroy a collection of TAO_EC_ProxyPushSuppliers 00141 virtual TAO_EC_ProxyPushSupplier_Collection* 00142 create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*) = 0; 00143 virtual void 00144 destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*) = 0; 00145 00146 /// Create and destroy the locking strategies for both 00147 /// ProxyPushConsumers and ProxyPushSuppliers 00148 virtual ACE_Lock* create_consumer_lock (void) = 0; 00149 virtual void destroy_consumer_lock (ACE_Lock*) = 0; 00150 virtual ACE_Lock* create_supplier_lock (void) = 0; 00151 virtual void destroy_supplier_lock (ACE_Lock*) = 0; 00152 00153 /// The ConsumerControl and SupplierControl strategies are used to 00154 /// discard non-existent consumers and suppliers 00155 virtual TAO_EC_ConsumerControl* 00156 create_consumer_control (TAO_EC_Event_Channel_Base*) = 0; 00157 virtual void 00158 destroy_consumer_control (TAO_EC_ConsumerControl*) = 0; 00159 virtual TAO_EC_SupplierControl* 00160 create_supplier_control (TAO_EC_Event_Channel_Base*) = 0; 00161 virtual void 00162 destroy_supplier_control (TAO_EC_SupplierControl*) = 0; 00163 }; 00164 00165 TAO_END_VERSIONED_NAMESPACE_DECL 00166 00167 #include /**/ "ace/post.h" 00168 00169 #endif /* TAO_EC_FACTORY_H */