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

//==========================================================================
/**
 *  @file    FT_Naming_Service.h
 *
 *    This class provides an override for the Naming_Service class factory
 *    method: create_naming_server ()
 *
 *  @author Kevin Stanley <stanleyk@ociweb.com>
 */
//==========================================================================


#ifndef TAO_FT_NAMING_SERVICE_H
#define TAO_FT_NAMING_SERVICE_H

#include "tao/ORB.h"
#include "orbsvcs/Naming/FaultTolerant/FT_Naming_Server.h"


/**
 * @class TAO_FT_Naming_Service
 *
 * @brief Defines a class that encapsulates the implementation of the
 * Fault Tolerant Naming Service.
 */
class TAO_FT_Naming_Service
{
public:
  /// Default Constructor.
  TAO_FT_Naming_Service (void);

  /// Constructor taking the command-line arguments.
  TAO_FT_Naming_Service (int argc, ACE_TCHAR* argv[]);

  /// Initialize the Naming Service with the arguments.
  virtual int init (int argc, ACE_TCHAR* argv[]);

  /// The opposite of init().
  virtual int fini ();

  /// Run the TAO_Naming_Service.
  virtual int run (void);

  /// Shut down the TAO_Naming_Service; you must still call fini().
  virtual void shutdown (void);

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

protected:

  /// Parse the command line arguments to find
  /// the timeout period.
  int parse_args (int &argc, ACE_TCHAR* argv[]);

  /// The ORB.
  CORBA::ORB_var orb_;

  /// Naming Server instance.
  TAO_FT_Naming_Server my_naming_server_;

  /// After how long the server should stop listening to requests (in
  /// seconds).
  long time_;

  /// Number of threads for running the ORB. Default is 1
  int num_threads_;
};

#endif /* TAO_FT_NAMING_SERVICE_H */