00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CEC_ConsumerControl.h 00006 * 00007 * CEC_ConsumerControl.h,v 1.19 2005/11/10 06:47:23 ossama Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@cs.wustl.edu)More details can be found in:http://www.cs.wustl.edu/~coryan/EC/index.html 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_CEC_CONSUMERCONTROL_H 00015 #define TAO_CEC_CONSUMERCONTROL_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 "tao/PortableServer/PortableServer.h" 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class TAO_CEC_EventChannel; 00030 class TAO_CEC_ProxyPushSupplier; 00031 class TAO_CEC_ProxyPullSupplier; 00032 00033 namespace CORBA 00034 { 00035 class SystemException; 00036 } 00037 00038 /** 00039 * @class TAO_CEC_ConsumerControl 00040 * 00041 * @brief ConsumerControl 00042 * 00043 * Defines the interface for the consumer control strategy. 00044 * This strategy handles misbehaving or failing consumers. 00045 * = MEMORY MANAGMENT 00046 * = LOCKING 00047 * = TODO 00048 */ 00049 class TAO_Event_Serv_Export TAO_CEC_ConsumerControl 00050 { 00051 public: 00052 /// Constructor. It does not assume ownership of the <event_channel> 00053 /// parameter. 00054 TAO_CEC_ConsumerControl (void); 00055 00056 /// destructor... 00057 virtual ~TAO_CEC_ConsumerControl (void); 00058 00059 /// Activate any internal threads or timers used to poll the state of 00060 /// the consumers 00061 virtual int activate (void); 00062 virtual int shutdown (void); 00063 00064 /** 00065 * When pushing an event to the consumer a CORBA::OBJECT_NOT_EXIST 00066 * exception was raised. The only interpretation is that the object 00067 * has been destroyed. The strategy has to (at the very least), 00068 * reclaim all the resources attached to that object. 00069 */ 00070 virtual void consumer_not_exist (TAO_CEC_ProxyPushSupplier *proxy 00071 ACE_ENV_ARG_DECL_NOT_USED); 00072 00073 /** 00074 * Invoked by helper classes when they detect that a consumer no 00075 * longer exists (i.e. _non_existent() returns true and/or the 00076 * CORBA::OBJECT_NOT_EXIST exception has been raised). 00077 */ 00078 virtual void consumer_not_exist (TAO_CEC_ProxyPullSupplier *proxy 00079 ACE_ENV_ARG_DECL_NOT_USED); 00080 00081 /// Some system exception was rasied while trying to push an event. 00082 virtual void system_exception (TAO_CEC_ProxyPushSupplier *proxy, 00083 CORBA::SystemException & 00084 ACE_ENV_ARG_DECL_NOT_USED); 00085 00086 /// Do we need to disconnect this supplier? The parameter type for 00087 /// proxy is PortableServer::ServantBase* due to the fact that this 00088 /// method will be used for TAO_CEC_ProxyPushSupplier's and 00089 /// TAO_CEC_ProxyPullSupplier's. 00090 virtual bool need_to_disconnect (PortableServer::ServantBase* proxy); 00091 00092 /// Allow others to inform us when a send or receive was successful. 00093 virtual void successful_transmission (PortableServer::ServantBase* proxy); 00094 }; 00095 00096 TAO_END_VERSIONED_NAMESPACE_DECL 00097 00098 #include /**/ "ace/post.h" 00099 #endif /* TAO_CEC_CONSUMERCONTROL_H */