📄 lb_loadmanager.h
字号:
// -*- C++ -*-
//=============================================================================
/**
* @file LB_LoadManager.h
*
* LB_LoadManager.h,v 1.9 2003/12/22 05:10:38 wilson_d Exp
*
* @author Ossama Othman <ossama@uci.edu>
*/
//=============================================================================
#ifndef TAO_LB_LOAD_MANAGER_H
#define TAO_LB_LOAD_MANAGER_H
#include /**/ "ace/pre.h"
#include "orbsvcs/CosLoadBalancingS.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "LB_LoadAlertMap.h"
#include "LB_MonitorMap.h"
#include "LB_LoadListMap.h"
#include "LB_Pull_Handler.h"
#include "orbsvcs/PortableGroupC.h"
#include "orbsvcs/PortableGroup/PG_PropertyManager.h"
#include "orbsvcs/PortableGroup/PG_GenericFactory.h"
#include "orbsvcs/PortableGroup/PG_ObjectGroupManager.h"
class TAO_LoadBalancing_Export TAO_LB_LoadManager
: public virtual POA_CosLoadBalancing::LoadManager,
public virtual PortableServer::RefCountServantBase
{
public:
/// Constructor.
TAO_LB_LoadManager (void);
/**
* @name CosLoadBalancing::LoadManager Methods
*
* Methods required by the CosLoadBalancing::LoadManager interface.
*/
//@{
/// For the PUSH load monitoring style.
virtual void push_loads (const PortableGroup::Location & the_location,
const CosLoadBalancing::LoadList & loads
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the raw loads at the given location.
virtual CosLoadBalancing::LoadList * get_loads (
const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LocationNotFound));
/// Inform member at given location of load alert condition.
virtual void enable_alert (const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound));
/// Inform member at given location that load alert condition has
/// passed.
virtual void disable_alert (const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CosLoadBalancing::LoadAlertNotFound));
/// Register a LoadAlert object for the member at the given
/// location.
virtual void register_load_alert (
const PortableGroup::Location & the_location,
CosLoadBalancing::LoadAlert_ptr load_alert
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LoadAlertAlreadyPresent,
CosLoadBalancing::LoadAlertNotAdded));
/// Retrieve the LoadAlert object for the member at the given
/// location.
virtual CosLoadBalancing::LoadAlert_ptr get_load_alert (
const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LoadAlertNotFound));
/// Remove (de-register) the LoadAlert object for the member at the
/// given location.
virtual void remove_load_alert (const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LoadAlertNotFound));
/// Register a load monitor with the load balancer.
virtual void register_load_monitor (
const PortableGroup::Location & the_location,
CosLoadBalancing::LoadMonitor_ptr load_monitor
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::MonitorAlreadyPresent));
/// Return a reference to the load monitor at the given location.
virtual CosLoadBalancing::LoadMonitor_ptr get_load_monitor (
const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LocationNotFound));
/// Remove a load monitor at the given location from the load
/// balancer.
virtual void remove_load_monitor (
const PortableGroup::Location & the_location
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
CosLoadBalancing::LocationNotFound));
//@}
/**
* @name PortableGroup::PropertyManager Methods
*
* Methods required by the PortableGroup::PropertyManager interface.
*/
//@{
/// Set the default properties to be used by all object groups.
virtual void set_default_properties (
const PortableGroup::Properties & props
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::InvalidProperty,
PortableGroup::UnsupportedProperty));
/// Get the default properties used by all object groups.
virtual PortableGroup::Properties * get_default_properties (
ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
/// Remove default properties.
virtual void remove_default_properties (
const PortableGroup::Properties & props
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::InvalidProperty,
PortableGroup::UnsupportedProperty));
/// Set properties associated with a given Replica type. These
/// properties override the default properties.
virtual void set_type_properties (
const char * type_id,
const PortableGroup::Properties & overrides
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::InvalidProperty,
PortableGroup::UnsupportedProperty));
/**
* Return the properties associated with a give Replica type. These
* properties include the type-specific properties in use, in
* addition to the default properties that were not overridden.
*/
virtual PortableGroup::Properties * get_type_properties (
const char * type_id
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
/// Remove the given properties associated with the Replica type ID.
virtual void remove_type_properties (
const char * type_id,
const PortableGroup::Properties & props
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::InvalidProperty,
PortableGroup::UnsupportedProperty));
/**
* Dynamically set the properties associated with a given object
* group as the load balancer and replicas are being executed.
* These properties override the type-specific and default
* properties.
*/
virtual void set_properties_dynamically (
PortableGroup::ObjectGroup_ptr object_group,
const PortableGroup::Properties & overrides
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::ObjectGroupNotFound,
PortableGroup::InvalidProperty,
PortableGroup::UnsupportedProperty));
/**
* Return the properties currently in use by the given object
* group. These properties include those that were set dynamically,
* type-specific properties that weren't overridden, properties that
* were used when the Replica was created, and default properties
* that weren't overridden.
*/
virtual PortableGroup::Properties * get_properties (
PortableGroup::ObjectGroup_ptr object_group
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::ObjectGroupNotFound));
//@}
/**
* @name PortableGroup::ObjectGroupManager methods
*
* Methods required by the PortableGroup::ObjectGroupManager
* interface.
*/
//@{
/// Create a member using the load balancer ObjectGroupManager, and
/// add the created object to the ObjectGroup.
virtual PortableGroup::ObjectGroup_ptr create_member (
PortableGroup::ObjectGroup_ptr object_group,
const PortableGroup::Location & the_location,
const char * type_id,
const PortableGroup::Criteria & the_criteria
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::ObjectGroupNotFound,
PortableGroup::MemberAlreadyPresent,
PortableGroup::NoFactory,
PortableGroup::ObjectNotCreated,
PortableGroup::InvalidCriteria,
PortableGroup::CannotMeetCriteria));
/// Add an existing object to the ObjectGroup.
virtual PortableGroup::ObjectGroup_ptr add_member (
PortableGroup::ObjectGroup_ptr object_group,
const PortableGroup::Location & the_location,
CORBA::Object_ptr member
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableGroup::ObjectGroupNotFound,
PortableGroup::MemberAlreadyPresent,
PortableGroup::ObjectNotAdded));
/**
* Remove an object at a specific location from the given
* ObjectGroup. Deletion of application created objects must be
* deleted by the application. Objects created by the
* infrastructure (load balancer) will be deleted by the
* infrastructure.
*/
virtual PortableGroup::ObjectGroup_ptr remove_member (
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -