1 //=============================================================================
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>
13 #include "ace/Bound_Ptr.h"
15 #include "ImplRepoC.h"
17 #include "ace/SString.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 typedef ACE_Strong_Bound_Ptr
<Server_Info
, ACE_Null_Mutex
> Server_Info_Ptr
;
27 * @brief Information about IMR registered servers.
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
,
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
,
50 Server_Info
& operator= (const Server_Info
& other
);
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
,
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
,
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
98 /// true if the server 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).
108 /// Environment Variables.
109 ImplementationRepository::EnvironmentList env_vars
;
110 /// The working directory.
112 /// The type of activation this supports.
113 ImplementationRepository::ActivationMode activation_mode_
;
114 /// Limit of retries to start the server
116 /// Current number of start attempts
118 /// Current endpoint used by the server.
119 ACE_CString partial_ior
;
120 /// IOR of the server object in the server.
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
133 /// The locator should expect a notification on server death from activator
137 #endif /* SERVER_INFO_H */