00001 // -*- C++ -*- 00002 /** 00003 * @file EC_Factory.h 00004 * 00005 * $Id: EC_Factory.h 75279 2006-11-08 19:17:49Z cleeland $ 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 TAO_EC_Factory (void); 00073 virtual ~TAO_EC_Factory (void); 00074 00075 /// Create and destroy the dispatching module. 00076 virtual TAO_EC_Dispatching* 00077 create_dispatching (TAO_EC_Event_Channel_Base*) = 0; 00078 virtual void 00079 destroy_dispatching (TAO_EC_Dispatching*) = 0; 00080 00081 /// Create and destroy the filter builder. 00082 virtual TAO_EC_Filter_Builder* 00083 create_filter_builder (TAO_EC_Event_Channel_Base*) = 0; 00084 virtual void 00085 destroy_filter_builder (TAO_EC_Filter_Builder*) = 0; 00086 00087 /// Create and destroy the filter builder. 00088 virtual TAO_EC_Supplier_Filter_Builder* 00089 create_supplier_filter_builder (TAO_EC_Event_Channel_Base*) = 0; 00090 virtual void 00091 destroy_supplier_filter_builder (TAO_EC_Supplier_Filter_Builder*) = 0; 00092 00093 /// Create and destroy the consumer admin implementation. 00094 virtual TAO_EC_ConsumerAdmin* 00095 create_consumer_admin (TAO_EC_Event_Channel_Base*) = 0; 00096 virtual void 00097 destroy_consumer_admin (TAO_EC_ConsumerAdmin*) = 0; 00098 00099 /// Create and destroy the supplier admin implementation. 00100 virtual TAO_EC_SupplierAdmin* 00101 create_supplier_admin (TAO_EC_Event_Channel_Base*) = 0; 00102 virtual void 00103 destroy_supplier_admin (TAO_EC_SupplierAdmin*) = 0; 00104 00105 /// Create and destroy a ProxyPushSupplier 00106 virtual TAO_EC_ProxyPushSupplier* 00107 create_proxy_push_supplier (TAO_EC_Event_Channel_Base*) = 0; 00108 virtual void 00109 destroy_proxy_push_supplier (TAO_EC_ProxyPushSupplier*) = 0; 00110 00111 /// Create and destroy a ProxyPushConsumer 00112 virtual TAO_EC_ProxyPushConsumer* 00113 create_proxy_push_consumer (TAO_EC_Event_Channel_Base*) = 0; 00114 virtual void 00115 destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer*) = 0; 00116 00117 /// Create and destroy the timer module. 00118 virtual TAO_EC_Timeout_Generator* 00119 create_timeout_generator (TAO_EC_Event_Channel_Base*) = 0; 00120 virtual void 00121 destroy_timeout_generator (TAO_EC_Timeout_Generator*) = 0; 00122 00123 /// Create and destroy the observer strategy. 00124 virtual TAO_EC_ObserverStrategy* 00125 create_observer_strategy (TAO_EC_Event_Channel_Base*) = 0; 00126 virtual void 00127 destroy_observer_strategy (TAO_EC_ObserverStrategy*) = 0; 00128 00129 /// Create and destroy the observer strategy. 00130 virtual TAO_EC_Scheduling_Strategy* 00131 create_scheduling_strategy (TAO_EC_Event_Channel_Base*) = 0; 00132 virtual void 00133 destroy_scheduling_strategy (TAO_EC_Scheduling_Strategy*) = 0; 00134 00135 /// Create and destroy a collection of TAO_EC_ProxyPushConsumers 00136 virtual TAO_EC_ProxyPushConsumer_Collection* 00137 create_proxy_push_consumer_collection (TAO_EC_Event_Channel_Base*) = 0; 00138 virtual void 00139 destroy_proxy_push_consumer_collection (TAO_EC_ProxyPushConsumer_Collection*) = 0; 00140 00141 /// Create and destroy a collection of TAO_EC_ProxyPushSuppliers 00142 virtual TAO_EC_ProxyPushSupplier_Collection* 00143 create_proxy_push_supplier_collection (TAO_EC_Event_Channel_Base*) = 0; 00144 virtual void 00145 destroy_proxy_push_supplier_collection (TAO_EC_ProxyPushSupplier_Collection*) = 0; 00146 00147 /// Create and destroy the locking strategies for both 00148 /// ProxyPushConsumers and ProxyPushSuppliers 00149 virtual ACE_Lock* create_consumer_lock (void) = 0; 00150 virtual void destroy_consumer_lock (ACE_Lock*) = 0; 00151 virtual ACE_Lock* create_supplier_lock (void) = 0; 00152 virtual void destroy_supplier_lock (ACE_Lock*) = 0; 00153 00154 /// The ConsumerControl and SupplierControl strategies are used to 00155 /// discard non-existent consumers and suppliers 00156 virtual TAO_EC_ConsumerControl* 00157 create_consumer_control (TAO_EC_Event_Channel_Base*) = 0; 00158 virtual void 00159 destroy_consumer_control (TAO_EC_ConsumerControl*) = 0; 00160 virtual TAO_EC_SupplierControl* 00161 create_supplier_control (TAO_EC_Event_Channel_Base*) = 0; 00162 virtual void 00163 destroy_supplier_control (TAO_EC_SupplierControl*) = 0; 00164 }; 00165 00166 TAO_RTEvent_Serv_Export extern unsigned short TAO_EC_debug_level; 00167 00168 TAO_END_VERSIONED_NAMESPACE_DECL 00169 00170 #include /**/ "ace/post.h" 00171 00172 #endif /* TAO_EC_FACTORY_H */