summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
blob: 090eb2bb6035ba60f673b798bbbba9c29e3f2617 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* -*- C++ -*- */

//=============================================================================
/**
 *  @file    Server_Info.h
 *
 *  $Id$
 *
 *  This class implements the Server_Info for the Implementation Repository.
 *
 *
 *  @author Darrell Brunsch <brunsch@cs.wustl.edu>
 *  @author Priyanka Gontla <gontla_p@ociweb.com>
 */
//=============================================================================

#ifndef SERVER_INFO_H
#define SERVER_INFO_H

#include "XML_ContentHandler.h"

#include "tao/PortableServer/ImplRepoC.h"

/**
 * @class Server_Info
 *
 * @brief Information about IMR registered servers.
 *
 * Contains all the necessary information about the server including
 * Information on how to start it up and where it is running.
 */
class Server_Info
{
public:
  // = Constructors

  /// Initialize the command_line and working_dir.
  Server_Info (const ACE_CString POA_name,
               const ACE_CString logical_server_name,
               const ACE_CString startup_command,
               const ImplementationRepository::EnvironmentList
                     environment_vars,
               const ACE_CString working_dir,
               const ImplementationRepository::ActivationMode activation);

  // = Destructors

  /// The only destructor there is.
  ~Server_Info (void);

  /// Updates information that is relevant only when an instance
  /// of the server is running.
  void update_running_info (const ACE_CString location,
                            const ACE_CString server_object_ior);

  /// Returns startup information.
  void get_startup_info (ACE_CString &logical_server_name,
                         ACE_CString &startup_command,
                         ImplementationRepository::EnvironmentList
                            &environment_vars,
                         ACE_CString &working_dir,
                         ImplementationRepository::ActivationMode
                         &activation);

  /// Returns information about a running instance.
  void get_running_info (ACE_CString &location,
                         ACE_CString &server_object_ior);

  // ActivationMode get_activation (void);
  // Get the activation mode.

  // @@ Does this belong here?
  //  int startup ();
  // Starts up the server based on the information.
  // Returns:  0  if successful
  //           -1 if there is no registration command (it has to be manually
  //              restarted)

  /// This is a flag to determine if the process has already been spawned
  /// and we are just waiting for it to start up.
  bool starting_up_;

private:
  /// Which server process this poa is grouped in.
  ACE_CString logical_server_name_;

  /// The name of the POA.
  ACE_CString POA_name_;

  /// The command line startup command (program and arguments).
  ACE_CString startup_command_;

  /// Environment Variables.
  ImplementationRepository::EnvironmentList environment_vars_;

  /// The working directory.
  ACE_CString working_dir_;

  /// Current endpoint used by the server.
  ACE_CString location_;

  /// IOR of the server object in the server.
  ACE_CString server_object_ior_;

  /// The type of activation this supports.
  ImplementationRepository::ActivationMode activation_;

  // No copying allowed.
  void operator= (Server_Info &);
  Server_Info (Server_Info &);
};

#endif /* SERVER_INFO_H */