summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/LoadBalancing_Strategy.h
blob: 72b580e69190a5fd9b76ec5a7389dd1466e661d2 (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
// -*- C++ -*-

// $Id$

// ============================================================================
//
// = LIBRARY
//    orbsvcs
//
// = FILENAME
//    LoadBalancing_Strategy.h
//
// = AUTHOR
//    Ossama Othman <ossama@uci.edu>
//
// ============================================================================

#ifndef LOAD_BALANCING_STRATEGY_H
#define LOAD_BALANCING_STRATEGY_H

#include "orbsvcs/LoadBalancingS.h"

// @@ Ossama: the general comments on filenames, class names,
// TAO_XXX_Export an other things like that apply.

class ReplicaProxy_Impl;

// The abstract load balancing strategy class.

class Load_Balancing_Strategy
{
  // = TITLE
  //    Load balancing strategy abstract base class.

  // = DESCRIPTION
  //    This abstract base class defines the interface load balancing
  //    strategies should implement.

public:
  virtual ~Load_Balancing_Strategy (void);
  // Destructor

  // @@ The name of the method should be more meaningful, what about:
  //    select_replica(), select_unloaded_replica() or something like
  //    that?
  virtual CORBA::Object_ptr replica (CORBA::Environment &ACE_TRY_ENV)
    ACE_THROW_SPEC ((CORBA::SystemException)) = 0;
  // Return the object reference to the Replica to which requests should
  // be redirected.

  virtual int insert (ReplicaProxy_Impl *) = 0;
  // Insert ReplicaProxy servant into the set of replica proxies upon
  // which the load balancing algorithm is performed.

  virtual int remove (ReplicaProxy_Impl *) = 0;
  // Remove ReplicaProxy servant from the set of replica proxies.

  virtual void load_changed (ReplicaProxy_Impl *impl,
                             CORBA::Environment &ACE_TRY_ENV);
  // The load on one proxy has changed.
  // @@ Ossama: see my comments on LoadBalancing_i about changing the
  // signature of this method.
};

#if !defined (__ACE_INLINE__)
#include "LoadBalancing_Strategy.i"
#endif /* __ACE_INLINE__ */

#endif  /* LOAD_BALANCING_STRATEGY_H */