summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Endpoint_Selector_Factory.h
blob: 8d2af50731e00db23d288784a608e57a261aabf9 (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
// This may look like C, but it's really -*- C++ -*-

//=============================================================================
/**
 *  @file   FT_Endpoint_Selector_Factory.h
 *
 *  $Id$
 *
 *  @author Balachandran Natarajan <bala@cs.wustl.edu>
 *
 */
//=============================================================================
#ifndef TAO_FT_ENDPOINT_SELECTOR_FACTORY_H
#define TAO_FT_ENDPOINT_SELECTOR_FACTORY_H

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

#include "fault_tol_export.h"

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

#include "tao/Endpoint_Selector_Factory.h"
#include "tao/Basic_Types.h"
#include "tao/orbconf.h"

#include "ace/Service_Config.h"

class TAO_FT_Invocation_Endpoint_Selector;
/**
 * @class TAO_FT_Endpoint_Selector_Factory
 *
 * @brief Factory for initializing <Endpoint_Selection_State> and
 * obtaining appropriate <Invocation_Endpoint_Selector>.
 *
 * This class is specifically for the FT_Service in TAO to return the
 * right factory
 */

class TAO_FT_Export TAO_FT_Endpoint_Selector_Factory
  : public TAO_Endpoint_Selector_Factory
{
public:

  /// Constructor.
  TAO_FT_Endpoint_Selector_Factory (void);

  /// Destructor.
  virtual ~TAO_FT_Endpoint_Selector_Factory (void);

  /// Get an Invocation's endpoint selection strategy and
  /// initialize the endpoint selection state instance.
  virtual TAO_Invocation_Endpoint_Selector *get_selector (
      ACE_ENV_SINGLE_ARG_DECL);

private:

  /// The possible endpoint selector strategies that can be
  /// returned by this factory
  TAO_FT_Invocation_Endpoint_Selector *ft_endpoint_selector_;

  /// Mutex to prevent multiple initializations
  TAO_SYNCH_MUTEX mutex_;
};

//extern TAO_FT_Export ACE_Static_Svc_Descriptor ace_svc_desc_TAO_FT_Endpoint_Selector_Factory;
ACE_STATIC_SVC_DECLARE_EXPORT (TAO_FT, TAO_FT_Endpoint_Selector_Factory)
ACE_FACTORY_DECLARE (TAO_FT, TAO_FT_Endpoint_Selector_Factory)

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

#endif  /* TAO_DEFAULT_ENDPOINT_SELECTOR_FACTORY_H */