00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CEC_SupplierControl.h 00006 * 00007 * CEC_SupplierControl.h,v 1.20 2005/11/10 06:47:23 ossama Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00010 * 00011 * More details can be found in: 00012 * 00013 * http://doc.ece.uci.edu/~coryan/EC/ 00014 */ 00015 //============================================================================= 00016 00017 00018 #ifndef TAO_CEC_SUPPLIERCONTROL_H 00019 #define TAO_CEC_SUPPLIERCONTROL_H 00020 00021 #include /**/ "ace/pre.h" 00022 00023 #include "orbsvcs/CosEvent/event_serv_export.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 #include "tao/PortableServer/PortableServer.h" 00030 #include "tao/Basic_Types.h" 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 class TAO_CEC_EventChannel; 00035 class TAO_CEC_ProxyPushConsumer; 00036 class TAO_CEC_ProxyPullConsumer; 00037 00038 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00039 class TAO_CEC_TypedProxyPushConsumer; 00040 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00041 00042 namespace CORBA 00043 { 00044 class SystemException; 00045 } 00046 00047 /** 00048 * @class TAO_CEC_SupplierControl 00049 * 00050 * @brief SupplierControl 00051 * 00052 * Defines the interface for the supplier control strategy. 00053 * This strategy handles misbehaving or failing suppliers. 00054 * = MEMORY MANAGMENT 00055 * = LOCKING 00056 * = TODO 00057 */ 00058 class TAO_Event_Serv_Export TAO_CEC_SupplierControl 00059 { 00060 public: 00061 /// Constructor. It does not assume ownership of the <event_channel> 00062 /// parameter. 00063 TAO_CEC_SupplierControl (void); 00064 00065 /// destructor... 00066 virtual ~TAO_CEC_SupplierControl (void); 00067 00068 /// Activate any internal threads or timers used to poll the state of 00069 /// the suppliers 00070 virtual int activate (void); 00071 virtual int shutdown (void); 00072 00073 /** 00074 * Invoked by helper classes when they detect that a supplier does 00075 * not exists (i.e. _non_existent() returns true and/or the 00076 * CORBA::OBJECT_NOT_EXIST exception has been raised). 00077 */ 00078 virtual void supplier_not_exist (TAO_CEC_ProxyPushConsumer *proxy 00079 ACE_ENV_ARG_DECL_NOT_USED); 00080 00081 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) 00082 virtual void supplier_not_exist (TAO_CEC_TypedProxyPushConsumer *proxy 00083 ACE_ENV_ARG_DECL_NOT_USED); 00084 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ 00085 00086 /** 00087 * Invoked by helper classes when they detect that a supplier does 00088 * not exists (i.e. _non_existent() returns true and/or the 00089 * CORBA::OBJECT_NOT_EXIST exception has been raised). 00090 */ 00091 virtual void supplier_not_exist (TAO_CEC_ProxyPullConsumer *proxy 00092 ACE_ENV_ARG_DECL_NOT_USED); 00093 00094 /// Some system exception was rasied while trying to push an event. 00095 virtual void system_exception (TAO_CEC_ProxyPullConsumer *proxy, 00096 CORBA::SystemException & 00097 ACE_ENV_ARG_DECL_NOT_USED); 00098 00099 /// Do we need to disconnect this supplier? The parameter type for 00100 /// proxy is PortableServer::ServantBase* due to the fact that this 00101 /// method will be used for TAO_CEC_ProxyPushSupplier's and 00102 /// TAO_CEC_ProxyPullSupplier's. 00103 virtual bool need_to_disconnect (PortableServer::ServantBase* proxy); 00104 00105 /// Allow others to inform us when a send or receive was successful. 00106 virtual void successful_transmission (PortableServer::ServantBase* proxy); 00107 }; 00108 00109 TAO_END_VERSIONED_NAMESPACE_DECL 00110 00111 #include /**/ "ace/post.h" 00112 #endif /* TAO_CEC_SUPPLIERCONTROL_H */