Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / ImplRepo_Service / Server_Info.h
blob5132dfa14472a8c9e3709c8f106ea0aca6e31250
1 //=============================================================================
2 /**
3 * @file Server_Info.h
5 * This class implements the Server_Info for the Implementation Repository.
7 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
8 * @author Priyanka Gontla <gontla_p@ociweb.com>
9 */
10 #ifndef SERVER_INFO_H
11 #define SERVER_INFO_H
13 #include "ace/Bound_Ptr.h"
15 #include "ImplRepoC.h"
17 #include "ace/SString.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 struct Server_Info;
24 typedef ACE_Strong_Bound_Ptr<Server_Info, ACE_Null_Mutex> Server_Info_Ptr;
26 /**
27 * @brief Information about IMR registered servers.
29 struct Server_Info
31 Server_Info ();
32 Server_Info (const Server_Info & other);
34 Server_Info (const ACE_CString& fqname,
35 const ACE_CString& aname,
36 const ACE_CString& cmdline,
37 const ImplementationRepository::EnvironmentList& env,
38 const ACE_CString& working_dir,
39 ImplementationRepository::ActivationMode amode,
40 int start_limit,
41 const ACE_CString& partial_ior = ACE_CString(""),
42 const ACE_CString& server_ior = ACE_CString(""),
43 ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil());
45 Server_Info (const ACE_CString& serverId,
46 const ACE_CString& pname,
47 bool jacorb,
48 Server_Info_Ptr alt);
50 Server_Info & operator= (const Server_Info& other);
52 void clear ();
54 /// Convert to the corba type
55 void setImRInfo (ImplementationRepository::ServerInformation* info) const;
56 ImplementationRepository::ServerInformation* createImRServerInfo() const;
58 void reset_runtime ();
60 bool is_server (const char *name) const;
61 bool has_peer (const char *name) const;
62 bool is_mode (ImplementationRepository::ActivationMode m) const;
63 ImplementationRepository::ActivationMode mode () const;
65 bool is_running () const;
66 bool start_allowed ();
67 void started (bool success);
69 // transform the supplied limit to always be at least 1
70 void start_limit (int lim);
72 void update_options (const ImplementationRepository::StartupOptions &options);
73 void set_contact (const char *pior,
74 const char *sior,
75 ImplementationRepository::ServerObject_ptr svrobj);
77 Server_Info *active_info ();
78 const Server_Info *active_info () const;
80 const char * ping_id () const;
82 static bool parse_id (const char * id,
83 ACE_CString& server_id,
84 ACE_CString& poa_name);
86 static void gen_id (const Server_Info *si, ACE_CString& id);
88 static void gen_key (const ACE_CString& server_id,
89 const ACE_CString& poa_name,
90 ACE_CString& key);
92 static void fqname_to_key (const char * fqname, ACE_CString& key);
94 /// The name of the server instance.
95 ACE_CString server_id;
96 /// the name of the poa
97 ACE_CString poa_name;
98 /// true if the server is JacORB
99 bool is_jacorb;
101 /// The fully qualified name of this info, combines the serverID and POA name
102 ACE_CString key_name_;
104 /// The name of the activator in which this server runs
105 ACE_CString activator;
106 /// The command line startup command (program and arguments).
107 ACE_CString cmdline;
108 /// Environment Variables.
109 ImplementationRepository::EnvironmentList env_vars;
110 /// The working directory.
111 ACE_CString dir;
112 /// The type of activation this supports.
113 ImplementationRepository::ActivationMode activation_mode_;
114 /// Limit of retries to start the server
115 int start_limit_;
116 /// Current number of start attempts
117 int start_count_;
118 /// Current endpoint used by the server.
119 ACE_CString partial_ior;
120 /// IOR of the server object in the server.
121 ACE_CString ior;
122 /// The timestamp of the last time we verified the server is alive
123 ACE_Time_Value last_ping;
124 /// The cached server object
125 ImplementationRepository::ServerObject_var server;
126 /// A comma separated list of additional POAs bound to this server
127 CORBA::StringSeq peers;
128 /// Alternate server info for sharing startup info between linked POAs
129 Server_Info_Ptr alt_info_;
131 /// Last known process ID reported by the activator
132 int pid;
133 /// The locator should expect a notification on server death from activator
134 bool death_notify;
137 #endif /* SERVER_INFO_H */