summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert.h
blob: bec59e2725fb7ad0207318d240c1bb799a077817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// -*- C++ -*-

//=============================================================================
/**
 * @file   LB_LoadAlert.h
 *
 * $Id$
 *
 * @author Ossama Othman <ossama@uci.edu>
 */
//=============================================================================


#ifndef TAO_LB_LOAD_ALERT_H
#define TAO_LB_LOAD_ALERT_H

#include /**/ "ace/pre.h"

#include "orbsvcs/orbsvcs/CosLoadBalancingS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "orbsvcs/orbsvcs/PortableGroupC.h"


class TAO_LoadBalancing_Export TAO_LB_LoadAlert
  : public virtual POA_CosLoadBalancing::LoadAlert
{
public:

  /// Constructor.
  TAO_LB_LoadAlert (void);

  /**
   * @name CosLoadBalancing::LoadAlert Methods
   *
   * Methods required by the CosLoadBalancing::LoadAlert interface.
   */
  //@{

  /// Forward requests back to the load manager via the object group
  /// reference.
  virtual void enable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));

  /// Stop forwarding requests, and begin accepting them again.
  virtual void disable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));

  //@}

  /// Has this LoadAlert servant been alerted of a high load condition
  /// by the LoadManager.
  CORBA::Boolean alerted (void) const;

protected:


  /// Destructor.
  /**
   * Protected destructor to enforce correct memory management via
   * reference counting.
   */
  //~TAO_LB_LoadAlert (void);

private:

  /// Has this LoadAlert servant been alerted of a high load condition
  /// by the LoadManager?
  CORBA::Boolean alerted_;

  /// Lock used to synchronized access to the LoadAlert state.
  mutable TAO_SYNCH_MUTEX lock_;

};


#if defined (__ACE_INLINE__)
# include "LB_LoadAlert.inl"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"

#endif  /* TAO_LB_LOAD_ALERT_H */