00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CEC_Factory.h 00006 * 00007 * CEC_Factory.h,v 1.18 2006/03/15 07:52:21 jtc Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_CEC_FACTORY_H 00015 #define TAO_CEC_FACTORY_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "orbsvcs/CosEvent/event_serv_export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "ace/Service_Object.h" 00026 00027 #include "tao/Versioned_Namespace.h" 00028 00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00030 class ACE_Lock; 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_CEC_EventChannel; 00036 00037 class TAO_CEC_Dispatching; 00038 class TAO_CEC_Pulling_Strategy; 00039 class TAO_CEC_ConsumerAdmin; 00040 class TAO_CEC_SupplierAdmin; 00041 class TAO_CEC_ProxyPushConsumer; 00042 class TAO_CEC_ProxyPullConsumer; 00043 class TAO_CEC_ProxyPushSupplier; 00044 class TAO_CEC_ProxyPullSupplier; 00045 template<class PROXY> class TAO_ESF_Proxy_Collection; 00046 class TAO_CEC_ConsumerControl; 00047 class TAO_CEC_SupplierControl; 00048 00049 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00050 class TAO_CEC_TypedEventChannel; 00051 class TAO_CEC_TypedProxyPushConsumer; 00052 class TAO_CEC_TypedConsumerAdmin; 00053 class TAO_CEC_TypedSupplierAdmin; 00054 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00055 00056 typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushConsumer> TAO_CEC_ProxyPushConsumer_Collection; 00057 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00058 typedef TAO_ESF_Proxy_Collection<TAO_CEC_TypedProxyPushConsumer> TAO_CEC_TypedProxyPushConsumer_Collection; 00059 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00060 typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullConsumer> TAO_CEC_ProxyPullConsumer_Collection; 00061 typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPushSupplier> TAO_CEC_ProxyPushSupplier_Collection; 00062 typedef TAO_ESF_Proxy_Collection<TAO_CEC_ProxyPullSupplier> TAO_CEC_ProxyPullSupplier_Collection; 00063 00064 /** 00065 * @class TAO_CEC_Factory 00066 * 00067 * @brief Abstract factory for the CosEventChannel components. 00068 * 00069 * The CosEventChannel implementation can be configured at 00070 * initialization time through several strategies and 00071 * components. This class defines the interface of an Abstract 00072 * Factory that creates all such components. 00073 * = MEMORY MANAGMENT 00074 * The objects it creates are owned by this class, the client must 00075 * invoke the corresponding destroy() method to release them. 00076 * Some implementations may require a different instance for the 00077 * CEC_Factory for each instance of a CEC_EventChannel. 00078 */ 00079 class TAO_Event_Serv_Export TAO_CEC_Factory : public ACE_Service_Object 00080 { 00081 public: 00082 /// destructor... 00083 virtual ~TAO_CEC_Factory (void); 00084 00085 /// Create and destroy the dispatching module. 00086 virtual TAO_CEC_Dispatching* 00087 create_dispatching (TAO_CEC_EventChannel*) = 0; 00088 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00089 virtual TAO_CEC_Dispatching* 00090 create_dispatching (TAO_CEC_TypedEventChannel*) = 0; 00091 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00092 virtual void 00093 destroy_dispatching (TAO_CEC_Dispatching*) = 0; 00094 00095 /// Create and destroy the pulling strategy. 00096 virtual TAO_CEC_Pulling_Strategy* 00097 create_pulling_strategy (TAO_CEC_EventChannel*) = 0; 00098 virtual void 00099 destroy_pulling_strategy (TAO_CEC_Pulling_Strategy*) = 0; 00100 00101 /// Create and destroy the consumer admin implementation. 00102 virtual TAO_CEC_ConsumerAdmin* 00103 create_consumer_admin (TAO_CEC_EventChannel*) = 0; 00104 virtual void 00105 destroy_consumer_admin (TAO_CEC_ConsumerAdmin*) = 0; 00106 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00107 virtual TAO_CEC_TypedConsumerAdmin* 00108 create_consumer_admin (TAO_CEC_TypedEventChannel*) = 0; 00109 virtual void 00110 destroy_consumer_admin (TAO_CEC_TypedConsumerAdmin*) = 0; 00111 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00112 00113 /// Create and destroy the supplier admin implementation. 00114 virtual TAO_CEC_SupplierAdmin* 00115 create_supplier_admin (TAO_CEC_EventChannel*) = 0; 00116 virtual void 00117 destroy_supplier_admin (TAO_CEC_SupplierAdmin*) = 0; 00118 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00119 virtual TAO_CEC_TypedSupplierAdmin* 00120 create_supplier_admin (TAO_CEC_TypedEventChannel*) = 0; 00121 virtual void 00122 destroy_supplier_admin (TAO_CEC_TypedSupplierAdmin*) = 0; 00123 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00124 00125 /// Create and destroy a ProxyPushSupplier 00126 virtual TAO_CEC_ProxyPushSupplier* 00127 create_proxy_push_supplier (TAO_CEC_EventChannel*) = 0; 00128 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00129 virtual TAO_CEC_ProxyPushSupplier* 00130 create_proxy_push_supplier (TAO_CEC_TypedEventChannel*) = 0; 00131 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00132 virtual void 00133 destroy_proxy_push_supplier (TAO_CEC_ProxyPushSupplier*) = 0; 00134 00135 /// Create and destroy a ProxyPullSupplier 00136 virtual TAO_CEC_ProxyPullSupplier* 00137 create_proxy_pull_supplier (TAO_CEC_EventChannel*) = 0; 00138 virtual void 00139 destroy_proxy_pull_supplier (TAO_CEC_ProxyPullSupplier*) = 0; 00140 00141 /// Create and destroy a ProxyPushConsumer 00142 virtual TAO_CEC_ProxyPushConsumer* 00143 create_proxy_push_consumer (TAO_CEC_EventChannel*) = 0; 00144 virtual void 00145 destroy_proxy_push_consumer (TAO_CEC_ProxyPushConsumer*) = 0; 00146 00147 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00148 /// Create and destroy a TypedProxyPushConsumer 00149 virtual TAO_CEC_TypedProxyPushConsumer* 00150 create_proxy_push_consumer (TAO_CEC_TypedEventChannel*) = 0; 00151 virtual void 00152 destroy_proxy_push_consumer (TAO_CEC_TypedProxyPushConsumer*) = 0; 00153 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00154 00155 /// Create and destroy a ProxyPullConsumer 00156 virtual TAO_CEC_ProxyPullConsumer* 00157 create_proxy_pull_consumer (TAO_CEC_EventChannel*) = 0; 00158 virtual void 00159 destroy_proxy_pull_consumer (TAO_CEC_ProxyPullConsumer*) = 0; 00160 00161 /// Create and destroy a collection of TAO_CEC_ProxyPushConsumers 00162 virtual TAO_CEC_ProxyPushConsumer_Collection* 00163 create_proxy_push_consumer_collection (TAO_CEC_EventChannel*) = 0; 00164 virtual void 00165 destroy_proxy_push_consumer_collection (TAO_CEC_ProxyPushConsumer_Collection*) = 0; 00166 00167 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00168 /// Create and destroy a collection of TAO_CEC_TypedProxyPushConsumers 00169 virtual TAO_CEC_TypedProxyPushConsumer_Collection* 00170 create_proxy_push_consumer_collection (TAO_CEC_TypedEventChannel*) = 0; 00171 virtual void 00172 destroy_proxy_push_consumer_collection (TAO_CEC_TypedProxyPushConsumer_Collection*) = 0; 00173 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00174 00175 /// Create and destroy a collection of TAO_CEC_ProxyPullConsumers 00176 virtual TAO_CEC_ProxyPullConsumer_Collection* 00177 create_proxy_pull_consumer_collection (TAO_CEC_EventChannel*) = 0; 00178 virtual void 00179 destroy_proxy_pull_consumer_collection (TAO_CEC_ProxyPullConsumer_Collection*) = 0; 00180 00181 /// Create and destroy a collection of TAO_CEC_ProxyPushSuppliers 00182 virtual TAO_CEC_ProxyPushSupplier_Collection* 00183 create_proxy_push_supplier_collection (TAO_CEC_EventChannel*) = 0; 00184 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00185 virtual TAO_CEC_ProxyPushSupplier_Collection* 00186 create_proxy_push_supplier_collection (TAO_CEC_TypedEventChannel*) = 0; 00187 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00188 virtual void 00189 destroy_proxy_push_supplier_collection (TAO_CEC_ProxyPushSupplier_Collection*) = 0; 00190 00191 /// Create and destroy a collection of TAO_CEC_ProxyPullSuppliers 00192 virtual TAO_CEC_ProxyPullSupplier_Collection* 00193 create_proxy_pull_supplier_collection (TAO_CEC_EventChannel*) = 0; 00194 virtual void 00195 destroy_proxy_pull_supplier_collection (TAO_CEC_ProxyPullSupplier_Collection*) = 0; 00196 00197 /// Create and destroy the locking strategies for both 00198 /// ProxyPushConsumers and ProxyPushSuppliers 00199 virtual ACE_Lock* create_consumer_lock (void) = 0; 00200 virtual void destroy_consumer_lock (ACE_Lock*) = 0; 00201 virtual ACE_Lock* create_supplier_lock (void) = 0; 00202 virtual void destroy_supplier_lock (ACE_Lock*) = 0; 00203 00204 /// The ConsumerControl and SupplierControl strategies are used to 00205 /// discard non-existent consumers and suppliers 00206 virtual TAO_CEC_ConsumerControl* 00207 create_consumer_control (TAO_CEC_EventChannel*) = 0; 00208 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00209 virtual TAO_CEC_ConsumerControl* 00210 create_consumer_control (TAO_CEC_TypedEventChannel*) = 0; 00211 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00212 virtual void 00213 destroy_consumer_control (TAO_CEC_ConsumerControl*) = 0; 00214 virtual TAO_CEC_SupplierControl* 00215 create_supplier_control (TAO_CEC_EventChannel*) = 0; 00216 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00217 virtual TAO_CEC_SupplierControl* 00218 create_supplier_control (TAO_CEC_TypedEventChannel*) = 0; 00219 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00220 virtual void 00221 destroy_supplier_control (TAO_CEC_SupplierControl*) = 0; 00222 }; 00223 00224 TAO_END_VERSIONED_NAMESPACE_DECL 00225 00226 #include /**/ "ace/post.h" 00227 #endif /* TAO_CEC_FACTORY_H */