00001
00002 #include "Server_Info.h"
00003
00004 Server_Info::Server_Info
00005 (
00006 const ACE_CString& server_name,
00007 const ACE_CString& aname,
00008 const ACE_CString& cmdline,
00009 const ImplementationRepository::EnvironmentList& env,
00010 const ACE_CString& working_dir,
00011 ImplementationRepository::ActivationMode amode,
00012 int limit,
00013 const ACE_CString& partial_ior,
00014 const ACE_CString& server_ior,
00015 ImplementationRepository::ServerObject_ptr svrobj
00016 )
00017 : name (server_name)
00018 , activator (aname)
00019 , cmdline( cmdline)
00020 , env_vars (env)
00021 , dir (working_dir)
00022 , activation_mode (amode)
00023 , start_limit (limit)
00024 , partial_ior (partial_ior)
00025 , ior (server_ior)
00026 , server(ImplementationRepository::ServerObject::_duplicate (svrobj))
00027 , start_count (0)
00028 , waiting_clients (0)
00029 , starting (false)
00030 {
00031 }
00032
00033 ImplementationRepository::ServerInformation*
00034 Server_Info::createImRServerInfo (ACE_ENV_SINGLE_ARG_DECL)
00035 {
00036 ImplementationRepository::ServerInformation* info;
00037 ACE_NEW_THROW_EX (info, ImplementationRepository::ServerInformation, CORBA::NO_MEMORY ());
00038
00039 info->server = name.c_str ();
00040 info->startup.command_line = cmdline.c_str ();
00041 info->startup.environment = env_vars;
00042 info->startup.working_directory = dir.c_str ();
00043 info->startup.activation = activation_mode;
00044 info->startup.activator = activator.c_str ();
00045 if (start_count >= start_limit)
00046 {
00047 info->startup.start_limit = -start_limit;
00048 }
00049 else
00050 {
00051 info->startup.start_limit = start_limit;
00052 }
00053 info->partial_ior = partial_ior.c_str();
00054
00055 return info;
00056 }
00057
00058 void
00059 Server_Info::reset (void)
00060 {
00061 ior = "";
00062 partial_ior = "";
00063 last_ping = ACE_Time_Value::zero;
00064 server = ImplementationRepository::ServerObject::_nil ();
00065
00066 }