diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/LB_RPMS_Monitor.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LB_RPMS_Monitor.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/LB_RPMS_Monitor.h b/TAO/orbsvcs/orbsvcs/LB_RPMS_Monitor.h new file mode 100644 index 00000000000..31f6a2705e6 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/LB_RPMS_Monitor.h @@ -0,0 +1,88 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LB_RPMS_Monitor.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +//============================================================================= + + +#ifndef TAO_LB_RPMS_MONITOR_H +#define TAO_LB_RPMS_MONITOR_H + +#include "ace/pre.h" + +#include "LoadBalancing_export.h" + +# if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +# endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "orbsvcs/LoadBalancingS.h" + +#include "LB_RPMS_Monitor_Interceptor.h" + + +/** + * @class TAO_LB_RPMS_Monitor + * + * @brief LoadMonitor implementation that returns monitor the number + * of requests per second a given location receives. + * + * Since interceptors are locality-constrained, the Load Balancer + * actually makes feedback and control invocations methods through + * this LoadMonitor exposed by this LoadMonitor. This LoadMonitor + * basically delegates all of its work on to its underlying + * ServerRequestInterceptor. + */ +class TAO_LoadBalancing_Export TAO_LB_RPMS_Monitor + : public virtual POA_LoadBalancing::LoadMonitor +{ +public: + + /// Constructor + TAO_LB_RPMS_Monitor (void); + + /** + * @name LoadBalancing::LoadMonitor Methods + */ + //@{ + + /// Return the number of requests per second arriving at the + /// location this load monitor resides. + virtual LoadBalancing::LoadList *current_load ( + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Force redirection of requests for targets with the given + /// RepositoryId to the target pointed to by the given object + /// reference. + virtual void register_redirect ( + const char *type_id, + CORBA::Object_ptr redirect_to, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Remove the redirect for targets of the given RepositoryId. + virtual void remove_redirect ( + const char *type_id, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + + //@} + +private: + + /// Interceptor responsible for keeping track of the number of + /// requests arriving per second. + TAO_LB_RPMS_Monitor_Interceptor_var interceptor_; + +}; + +#include "ace/post.h" + +#endif /* TAO_LB_RPMS_MONITOR_H */ |