summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog20
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp47
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp40
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp104
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp76
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h2
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp17
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp158
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Server_Info.h48
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp31
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp5
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp12
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl28
14 files changed, 352 insertions, 238 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 3f5bc42a6b5..9aa183afe1f 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,23 @@
+Thu Feb 6 23:11:57 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp:
+ * orbsvcs/ImplRepo_Service/AsyncListManager.cpp:
+ * orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp:
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp:
+ * orbsvcs/ImplRepo_Service/Locator_Repository.h:
+ * orbsvcs/ImplRepo_Service/Locator_Repository.cpp:
+ * orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp:
+ * orbsvcs/ImplRepo_Service/Server_Info.h:
+ * orbsvcs/ImplRepo_Service/Server_Info.cpp:
+ * orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp:
+ * orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp:
+ * orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp:
+ More refactoring of Server_Info interactions to ensure linked infos
+ present the correct information for server access vs poa access.
+
+ * orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl:
+ enhance the debug output to help resolve runtime error.
+
Thu Feb 6 14:52:09 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/ImplRepo_Service/Shared_Backing_Store.h:
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
index e9a5dd32cb7..f867d074b92 100644
--- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
@@ -27,9 +27,8 @@ AsyncAccessManager::AsyncAccessManager (const Server_Info &info,
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) AsyncAccessManager::ctor server = %s\n"),
- this->info_->key_name.c_str()));
+ this->info_->ping_id ()));
}
-
}
AsyncAccessManager::~AsyncAccessManager (void)
@@ -46,7 +45,7 @@ AsyncAccessManager::started_running (void)
bool
AsyncAccessManager::has_server (const char *s)
{
- return this->info_->is_server(s) || this->info_->has_peer (s);
+ return ACE_OS::strcmp (this->info_->ping_id(), s);
}
void
@@ -64,7 +63,7 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh)
}
- if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT)
+ if (this->info_->is_mode (ImplementationRepository::PER_CLIENT))
{
if (!this->send_start_request())
{
@@ -75,7 +74,7 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh)
if (this->status_ == AAM_SERVER_READY || this->status_ == AAM_SERVER_STARTED_RUNNING)
{
- if (this->locator_.pinger().is_alive (this->info_->key_name.c_str()) == LS_ALIVE)
+ if (this->locator_.pinger().is_alive (this->info_->ping_id()) == LS_ALIVE)
{
this->status_ = AAM_SERVER_READY;
this->final_state();
@@ -90,7 +89,7 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh)
// This is not a leak. The listener registers with
// the pinger and will delete itself when done.
AccessLiveListener *l = 0;
- ACE_NEW (l, AccessLiveListener (this->info_->key_name.c_str(),
+ ACE_NEW (l, AccessLiveListener (this->info_->ping_id(),
this,
this->locator_.pinger()));
LiveListener_ptr llp(l);
@@ -155,7 +154,7 @@ AsyncAccessManager::final_state (void)
}
}
this->rh_list_.clear ();
- if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT ||
+ if (this->info_->is_mode (ImplementationRepository::PER_CLIENT) ||
this->status_ != AAM_SERVER_READY)
{
AsyncAccessManager_ptr aam (this);
@@ -212,25 +211,25 @@ AsyncAccessManager::server_is_running (const char *partial_ior,
this->info_->partial_ior = partial_ior;
this->info_->server = ImplementationRepository::ServerObject::_duplicate (ref);
- if (this->locator_.pinger().is_alive (this->info_->key_name.c_str()) == LS_ALIVE)
+ if (this->locator_.pinger().is_alive (this->info_->ping_id()) == LS_ALIVE)
{
this->status (AAM_SERVER_READY);
this->final_state ();
}
AccessLiveListener *l = 0;
- if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT)
+ if (this->info_->is_mode (ImplementationRepository::PER_CLIENT))
{
- ACE_NEW (l, AccessLiveListener (this->info_->key_name.c_str(),
- this,
- this->locator_.pinger(),
- this->info_->server.in()));
+ ACE_NEW (l, AccessLiveListener (this->info_->ping_id(),
+ this,
+ this->locator_.pinger(),
+ this->info_->active_info()->server.in()));
}
else
{
- ACE_NEW (l, AccessLiveListener (this->info_->key_name.c_str(),
- this,
- this->locator_.pinger()));
+ ACE_NEW (l, AccessLiveListener (this->info_->ping_id(),
+ this,
+ this->locator_.pinger()));
}
LiveListener_ptr llp(l);
@@ -301,21 +300,23 @@ AsyncAccessManager::send_start_request (void)
ACE_TEXT ("(%P|%t) AsyncAccessManager::send_start_request\n")));
}
- if (this->info_->activation_mode == ImplementationRepository::MANUAL &&
+ if (this->info_->is_mode (ImplementationRepository::MANUAL) &&
!this->manual_start_)
{
this->status (AAM_NOT_MANUAL);
return false;
}
- if (this->info_->cmdline.length () == 0)
+ Server_Info *startup = this->info_->active_info ();
+
+ if (startup->cmdline.length () == 0)
{
this->status (AAM_NO_COMMANDLINE);
return false;
}
Activator_Info_Ptr ainfo =
- this->locator_.get_activator (this->info_->activator);
+ this->locator_.get_activator (startup->activator);
if (ainfo.null () || CORBA::is_nil (ainfo->activator.in ()))
{
@@ -331,10 +332,10 @@ AsyncAccessManager::send_start_request (void)
ImplementationRepository::AMI_ActivatorHandler::_narrow (obj.in());
ainfo->activator->sendc_start_server (cb.in(),
- this->info_->key_name.c_str (),
- this->info_->cmdline.c_str (),
- this->info_->dir.c_str (),
- this->info_->env_vars);
+ startup->key_name_.c_str (),
+ startup->cmdline.c_str (),
+ startup->dir.c_str (),
+ startup->env_vars);
this->status (AAM_ACTIVATION_SENT);
return true;
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp
index 0c74b77afa2..70f45dc13d8 100644
--- a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp
@@ -166,7 +166,7 @@ AsyncListManager::list_i (CORBA::ULong start, CORBA::ULong how_many)
if (this->pinger_ != 0)
{
ListLiveListener *l = 0;
- ACE_NEW (l, ListLiveListener (info->key_name.c_str (),
+ ACE_NEW (l, ListLiveListener (info->ping_id (),
i,
this,
*this->pinger_));
diff --git a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
index bb10c3bebdc..0a3af3f164b 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Config_Backing_Store.cpp
@@ -90,8 +90,13 @@ Config_Backing_Store::loadServers ()
while (config_.enumerate_sections (root, index, name) == 0)
{
- ACE_NEW (si, Server_Info);
- si->key_name = name;
+ Server_Info_Ptr info;
+ if (this->servers ().find (name, info) != 0)
+ {
+ ACE_NEW (si, Server_Info);
+ info.reset (si);
+ si->key_name_ = name;
+ }
ACE_Configuration_Section_Key key;
@@ -99,7 +104,7 @@ Config_Backing_Store::loadServers ()
config_.open_section (root, name.c_str(), 0, key);
if (!config_.get_string_value (key, POA, si->poa_name))
{
- si->poa_name = si->key_name;
+ si->poa_name = si->key_name_;
}
// Ignore any missing values. Server name is enough on its own.
@@ -112,7 +117,7 @@ Config_Backing_Store::loadServers ()
config_.get_string_value (key, ENVIRONMENT, tmp);
ImR_Utils::stringToEnvList (tmp, si->env_vars);
config_.get_integer_value (key, ACTIVATION, tmp_int);
- si->activation_mode =
+ si->activation_mode_ =
static_cast <ImplementationRepository::ActivationMode> (tmp_int);
config_.get_string_value (key, PARTIAL_IOR, si->partial_ior);
config_.get_string_value (key, IOR, si->ior);
@@ -120,12 +125,20 @@ Config_Backing_Store::loadServers ()
si->start_limit_ = tmp_int;
config_.get_integer_value (key, PID, tmp_int);
si->pid = tmp_int;
- config_.get_string_value (key, ALTKEY, si->alt_key);
+ if (config_.get_string_value (key, ALTKEY, tmp))
+ {
+ if (this->servers ().find (tmp, si->alt_info_) != 0)
+ {
+ Server_Info *base_si = 0;
+ ACE_NEW (base_si, Server_Info);
+ base_si->key_name_ = tmp;
+ si->alt_info_.reset (base_si);
+ this->servers ().bind (tmp, si->alt_info_);
+ }
+ }
config_.get_string_value (key, PEERS, tmp);
ImR_Utils::stringToPeerList (tmp, si->peers);
-
- Server_Info_Ptr info (si);
- servers ().bind (name, info);
+ this->servers ().bind (name, info);
si = 0;
++index;
}
@@ -183,11 +196,11 @@ int
Config_Backing_Store::persistent_update (const Server_Info_Ptr& info, bool )
{
ACE_Configuration_Section_Key key;
- int err = get_key(this->config_, info->key_name, SERVERS_ROOT_KEY, key);
+ int err = get_key(this->config_, info->key_name_, SERVERS_ROOT_KEY, key);
if (err != 0)
{
ORBSVCS_ERROR((LM_ERROR, ACE_TEXT ("ERROR: could not get key for %C\n"),
- info->key_name.c_str ()));
+ info->key_name_.c_str ()));
return err;
}
@@ -205,13 +218,14 @@ Config_Backing_Store::persistent_update (const Server_Info_Ptr& info, bool )
this->config_.set_string_value (key, STARTUP_COMMAND, info->cmdline);
this->config_.set_string_value (key, WORKING_DIR, info->dir);
this->config_.set_string_value (key, ENVIRONMENT, envstr);
- this->config_.set_integer_value (key, ACTIVATION, info->activation_mode);
+ this->config_.set_integer_value (key, ACTIVATION, info->activation_mode_);
this->config_.set_integer_value (key, START_LIMIT, info->start_limit_);
this->config_.set_string_value (key, PARTIAL_IOR, info->partial_ior);
this->config_.set_string_value (key, IOR, info->ior);
this->config_.set_integer_value (key, PID, info->pid);
- this->config_.get_string_value (key, ALTKEY, info->alt_key);
- this->config_.get_string_value (key, PEERS, peerstr);
+ this->config_.set_string_value (key, ALTKEY,
+ info->alt_info_.null () ? "" : info->alt_info_->key_name_);
+ this->config_.set_string_value (key, PEERS, peerstr);
return 0;
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
index bb7de882046..4e4b80f0e59 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
@@ -179,13 +179,14 @@ ImR_Locator_i::init_with_orb (CORBA::ORB_ptr orb, Options& opts)
for (;it.next (entry) != 0; it.advance ())
{
const Server_Info& info = *(entry->int_id_);
-
- if (!CORBA::is_nil (info.server.in()) &&
- !this->pinger_.has_server (info.key_name.c_str()))
+ ImplementationRepository::ServerObject_var svrobj =
+ info.alt_info_.null () ? info.server : info.alt_info_->server;
+ if (!CORBA::is_nil (svrobj.in()) &&
+ !this->pinger_.has_server (info.ping_id()))
{
- this->pinger_.add_server (info.key_name.c_str(),
+ this->pinger_.add_server (info.ping_id(),
this->ping_external_,
- info.server.in());
+ svrobj.in());
}
}
}
@@ -423,7 +424,7 @@ ImR_Locator_i::notify_child_death
UpdateableServerInfo info (this->repository_.get(), name);
if (! info.null ())
{
- info.edit()->reset_runtime ();
+ info.edit ()->reset_runtime ();
}
else
{
@@ -475,7 +476,7 @@ ImR_Locator_i::spawn_pid
UpdateableServerInfo info(this->repository_.get(), name);
if (! info.null ())
{
- info.edit()->pid = pid;
+ info.edit ()->active_info ()->pid = pid;
}
else
{
@@ -589,7 +590,7 @@ ImR_Locator_i::activate_server_i (UpdateableServerInfo& info,
ImR_ResponseHandler *rh)
{
AsyncAccessManager_ptr aam;
- if (info->activation_mode == ImplementationRepository::PER_CLIENT)
+ if (info->is_mode(ImplementationRepository::PER_CLIENT))
{
AsyncAccessManager *aam_raw;
ACE_NEW (aam_raw, AsyncAccessManager (*info, manual_start, *this));
@@ -598,7 +599,7 @@ ImR_Locator_i::activate_server_i (UpdateableServerInfo& info,
}
else
{
- aam = this->find_aam (info->key_name.c_str());
+ aam = this->find_aam (info->ping_id ());
if (aam.is_nil())
{
AsyncAccessManager *aam_raw;
@@ -688,14 +689,7 @@ ImR_Locator_i::add_or_update_server
ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("ImR: Updating server <%C>.\n"),
server));
- info.edit ()->activator = options.activator.in ();
- info.edit ()->cmdline = options.command_line.in ();
- info.edit ()->env_vars = options.environment;
- info.edit ()->dir = options.working_directory.in ();
- info.edit ()->activation_mode = options.activation;
- info.edit ()->start_limit (options.start_limit);
- info.edit ()->start_count = 0;
-
+ info.edit ()->update_options (options);
info.update_repo();
}
@@ -741,7 +735,7 @@ ImR_Locator_i::link_servers
_tao_rh->link_servers_excep (&h);
return;
}
- else if (root_si->alt_key.length () > 0)
+ else if (!root_si->alt_info_.null())
{
ACE_CString errstr = name;
errstr += " is not a base POA";
@@ -791,8 +785,13 @@ ImR_Locator_i::kill_server
return;
}
+ if (!si->alt_info_.null ())
+ {
+ si = si->alt_info_;
+ }
+
UpdateableServerInfo info (this->repository_.get(), si, true);
- if (info->activation_mode == ImplementationRepository::PER_CLIENT)
+ if (info->is_mode(ImplementationRepository::PER_CLIENT))
{
CORBA::Exception *ex =
new ImplementationRepository::CannotComplete ("per-client server");
@@ -1001,13 +1000,13 @@ ImR_Locator_i::server_is_running
ACE_TEXT ("ImR: Server %C is running at %C.\n"),
id, partial_ior));
}
- CORBA::String_var ior = orb_->object_to_string (server_object);
+ CORBA::String_var sior = orb_->object_to_string (server_object);
if (debug_ > 1)
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("ImR: Server %C callback at %C.\n"),
- id, ior.in ()));
+ id, sior.in ()));
}
if (this->unregister_if_address_reused_)
@@ -1017,7 +1016,9 @@ ImR_Locator_i::server_is_running
ImplementationRepository::ServerObject_var srvobj =
ImplementationRepository::ServerObject::_narrow (obj.in());
- UpdateableServerInfo info(this->repository_.get(), id);
+ Server_Info_Ptr sip = this->repository_->get_info (id);
+
+ UpdateableServerInfo info(this->repository_.get(), sip);
if (info.null ())
{
if (debug_ > 0)
@@ -1028,7 +1029,7 @@ ImR_Locator_i::server_is_running
}
Server_Info_Ptr si;
- if (this->repository_->add_server (id, partial_ior, ior.in (), srvobj.in ()) == 0)
+ if (this->repository_->add_server (id, partial_ior, sior.in (), srvobj.in ()) == 0)
{
si = this->repository_->get_active_server (id);
}
@@ -1046,7 +1047,7 @@ ImR_Locator_i::server_is_running
_tao_rh->server_is_running_excep (&h);
return;
}
- this->pinger_.add_server (si->key_name.c_str(), this->ping_external_, srvobj.in());
+ this->pinger_.add_server (si->ping_id (), this->ping_external_, srvobj.in());
AsyncAccessManager *aam_raw;
ACE_NEW (aam_raw, AsyncAccessManager (*si, true, *this));
AsyncAccessManager_ptr aam (aam_raw);
@@ -1055,17 +1056,15 @@ ImR_Locator_i::server_is_running
}
else
{
- if (info->activation_mode != ImplementationRepository::PER_CLIENT)
+ if (!info->is_mode(ImplementationRepository::PER_CLIENT))
{
- info.edit ()->ior = ior.in ();
- info.edit ()->partial_ior = partial_ior;
- info.edit ()->server = srvobj;
+ info.edit ()->set_contact (partial_ior, sior.in(), srvobj.in());
info.update_repo();
this->pinger_.add_server (id, true, srvobj.in());
}
- AsyncAccessManager_ptr aam(this->find_aam (info->key_name.c_str()));
+ AsyncAccessManager_ptr aam(this->find_aam (info->ping_id ()));
if (!aam.is_nil())
{
if (ImR_Locator_i::debug () > 4)
@@ -1082,7 +1081,7 @@ ImR_Locator_i::server_is_running
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) ImR_Locator_i::send_start_request aam is nil\n")));
}
- if (info->activation_mode != ImplementationRepository::PER_CLIENT)
+ if (!info->is_mode(ImplementationRepository::PER_CLIENT))
{
AsyncAccessManager *aam_raw;
ACE_NEW (aam_raw, AsyncAccessManager (*info, true, *this));
@@ -1119,11 +1118,11 @@ ImR_Locator_i::server_is_shutting_down
ACE_TEXT ("ImR: Server <%C> is shutting down.\n"),
fqname));
- if (info->activation_mode != ImplementationRepository::PER_CLIENT)
+ if (!info->is_mode(ImplementationRepository::PER_CLIENT))
{
- this->pinger_.remove_server (info->key_name.c_str());
+ this->pinger_.remove_server (info->ping_id());
{
- AsyncAccessManager_ptr aam = this->find_aam (info->key_name.c_str());
+ AsyncAccessManager_ptr aam = this->find_aam (info->ping_id ());
if (!aam.is_nil())
{
aam->server_is_shutting_down ();
@@ -1269,8 +1268,8 @@ ImR_Locator_i::auto_start_servers (void)
try
{
- if (info->activation_mode == ImplementationRepository::AUTO_START
- && info->cmdline.length () > 0)
+ if (info->is_mode (ImplementationRepository::AUTO_START)
+ && info->active_info()->cmdline.length () > 0)
{
ImR_ResponseHandler rh;
this->activate_server_i (info, true, &rh);
@@ -1293,57 +1292,58 @@ ImR_Locator_i::auto_start_servers (void)
void
ImR_Locator_i::connect_server (UpdateableServerInfo& info)
{
- if (! CORBA::is_nil (info->server.in ()))
+ Server_Info *sip = info.edit ()->active_info ();
+ if (! CORBA::is_nil (sip->server.in ()))
{
- if (!this->pinger_.has_server (info->key_name.c_str()))
+ if (!this->pinger_.has_server (sip->key_name_.c_str()))
{
- this->pinger_.add_server (info->key_name.c_str(),
+ this->pinger_.add_server (sip->key_name_.c_str(),
this->ping_external_,
- info->server.in());
+ sip->server.in());
}
return; // already connected
}
- if (info->ior.length () == 0)
+ if (sip->ior.length () == 0)
{
- info.edit ()->reset_runtime ();
+ sip->reset_runtime ();
return; // can't connect
}
try
{
- CORBA::Object_var obj = orb_->string_to_object (info->ior.c_str ());
+ CORBA::Object_var obj = orb_->string_to_object (sip->ior.c_str ());
if (CORBA::is_nil (obj.in ()))
{
- info.edit ()->reset_runtime ();
+ sip->reset_runtime ();
return;
}
obj = this->set_timeout_policy (obj.in (), DEFAULT_SERVER_TIMEOUT);
- info.edit ()->server =
+ sip->server =
ImplementationRepository::ServerObject::_unchecked_narrow (obj.in ());
- if (CORBA::is_nil (info->server.in ()))
+ if (CORBA::is_nil (sip->server.in ()))
{
- info.edit ()->reset_runtime ();
+ sip->reset_runtime ();
return;
}
if (debug_ > 1)
ORBSVCS_DEBUG ((LM_DEBUG,
- ACE_TEXT ("ImR: Connected to server <%C>\n"),
- info->key_name.c_str ()));
- this->pinger_.add_server (info->key_name.c_str(),
+ ACE_TEXT ("ImR: Connected to server <%C>\n"),
+ sip->key_name_.c_str ()));
+ this->pinger_.add_server (sip->key_name_.c_str(),
this->ping_external_,
- info->server.in());
+ sip->server.in());
}
catch (CORBA::Exception&)
{
- info.edit ()->reset_runtime ();
+ sip->reset_runtime ();
}
}
@@ -1353,7 +1353,7 @@ ImR_Locator_i::is_alive (UpdateableServerInfo& info)
this->connect_server (info);
SyncListener *listener = 0;
ACE_NEW_RETURN (listener,
- SyncListener (info->key_name.c_str(),
+ SyncListener (info->ping_id(),
this->orb_.in(),
this->pinger_),
false);
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
index 071de237160..c78dd60d901 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
@@ -285,8 +285,9 @@ Locator_Repository::unregister_if_address_reused (const ACE_CString& fqname,
partial_ior));
}
- ACE_CString key_name;
- Server_Info::fqname_to_key (fqname.c_str(), key_name);
+ ACE_CString poa_name;
+ ACE_CString server_id;
+ Server_Info::parse_id (fqname.c_str(), server_id, poa_name);
ACE_Vector<ACE_CString> srvs;
@@ -300,11 +301,11 @@ Locator_Repository::unregister_if_address_reused (const ACE_CString& fqname,
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t)ImR: iterating - registered server")
- ACE_TEXT ("\"%C %C\" ior \"%C\"\n"), info->server_id.c_str(),
- info->poa_name.c_str (), info->partial_ior.c_str ()));
+ ACE_TEXT ("\"%C:%C\" key = <%C> ior \"%C\"\n"), info->server_id.c_str(),
+ info->poa_name.c_str (), info->key_name_.c_str(), info->partial_ior.c_str ()));
}
- if (info->partial_ior == partial_ior && info->key_name != key_name)
+ if (info->partial_ior == partial_ior && info->server_id != server_id)
{
if (this->opts_.debug() > 0)
{
@@ -312,9 +313,9 @@ Locator_Repository::unregister_if_address_reused (const ACE_CString& fqname,
ACE_TEXT ("(%P|%t)ImR: reuse address %C so remove server %C \n"),
info->partial_ior.c_str (), info->poa_name.c_str ()));
}
- if (! info->key_name.empty ())
+ if (! info->key_name_.empty ())
{
- srvs.push_back (info->key_name);
+ srvs.push_back (info->key_name_);
}
}
}
@@ -378,7 +379,7 @@ Locator_Repository::add_server_i (Server_Info *si)
return err;
}
- err = servers ().bind (si->key_name, info);
+ err = servers ().bind (si->key_name_, info);
if (err != 0)
{
return err;
@@ -424,17 +425,38 @@ Locator_Repository::update_activator (const Activator_Info_Ptr& info)
}
Server_Info_Ptr
+Locator_Repository::find_by_poa (const ACE_CString & name)
+{
+ Locator_Repository::SIMap::ENTRY* sientry = 0;
+ Locator_Repository::SIMap::ITERATOR siit (servers ());
+ for (; siit.next (sientry); siit.advance() )
+ {
+ Server_Info_Ptr& info = sientry->int_id_;
+ if (info->poa_name == name)
+ {
+ return info;
+ }
+ }
+ return Server_Info_Ptr();
+}
+
+Server_Info_Ptr
Locator_Repository::get_active_server (const ACE_CString& name, int pid)
{
sync_load ();
Server_Info_Ptr si;
servers ().find (name, si);
- if (si.get () != 0 && si->alt_key.length () != 0)
+ if (si.null())
{
- servers ().find (si->alt_key, si);
+ if (this->opts_.debug() > 5)
+ {
+ ORBSVCS_DEBUG ((LM_DEBUG, "get_active_server could not find %C\n", name.c_str()));
+ }
+ return find_by_poa (name);
}
- if (pid != 0 && si.get () != 0 && si->pid != pid)
+
+ if (pid != 0 && si->pid != pid)
{
si.reset ();
}
@@ -467,28 +489,23 @@ Locator_Repository::remove_server (const ACE_CString& name)
return ret;
}
- if (si->alt_key.length() > 0)
+ if (!si->alt_info_.null ())
{
// name is a peer to another an must be removed from other list
- ACE_CString pname = si->poa_name;
- this->servers().find (si->alt_key, si);
- if (!si.null ())
+ bool found = false;
+ for (size_t i = 0; i < si->alt_info_->peers.length(); i++)
{
- bool found = false;
- for (size_t i = 0; i < si->peers.length(); i++)
+ if (!found && si->poa_name == si->alt_info_->peers[i])
+ {
+ found = true;
+ continue;
+ }
+ if (found)
{
- if (!found && pname == si->peers[i])
- {
- found = true;
- continue;
- }
- if (found)
- {
- si->peers[i-1] = si->peers[i];
- }
+ si->alt_info_->peers[i-1] = si->alt_info_->peers[i];
}
- si->peers.length (si->peers.length() - 1);
}
+ si->alt_info_->peers.length (si->alt_info_->peers.length() - 1);
}
else if (si->peers.length () > 0)
{
@@ -498,6 +515,7 @@ Locator_Repository::remove_server (const ACE_CString& name)
ACE_CString peer (si->peers[i]);
Server_Info::gen_key (si->server_id, peer, key);
this->servers ().unbind (key);
+ this->persistent_remove (key, false);
}
}
return persistent_remove (name, false);
@@ -516,10 +534,10 @@ Locator_Repository::link_peers (Server_Info_Ptr base,
Server_Info *si;
ACE_CString peer(p[i]);
ACE_NEW_RETURN (si,
- Server_Info (base->server_id, peer, base->is_jacorb, base->poa_name),
+ Server_Info (base->server_id, peer, base->is_jacorb, base),
-1);
Server_Info_Ptr sip(si);
- servers ().bind (si->key_name, sip);
+ servers ().bind (si->key_name_, sip);
this->persistent_update (sip, true);
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
index cdf34513522..1ad295f2f3c 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h
@@ -162,6 +162,8 @@ protected:
CORBA::String_var imr_ior_;
private:
+ Server_Info_Ptr find_by_poa (const ACE_CString &name);
+
bool registered_;
/// The in-memory list of the server information.
SIMap server_infos_;
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
index 88787b03616..5d4c4f25a97 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_XMLHandler.cpp
@@ -78,7 +78,7 @@ Locator_XMLHandler::startElement (const ACEXML_Char*,
this->si_->activator = attrs->getValue (index++);
this->si_->cmdline = attrs->getValue (index++);
this->si_->dir = attrs->getValue (index++);
- this->si_->activation_mode =
+ this->si_->activation_mode_ =
ImR_Utils::stringToActivationMode (attrs->getValue (index++));
this->si_->start_limit_ = ACE_OS::atoi (attrs->getValue (index++));
this->si_->partial_ior = attrs->getValue (index++);
@@ -101,11 +101,18 @@ Locator_XMLHandler::startElement (const ACEXML_Char*,
ACE_CString value (attrs->getValue (index));
if (name == KEYNAME_TAG)
{
- this->si_->key_name = value;
+ this->si_->key_name_ = value;
}
else if (name == ALTKEY_TAG)
{
- this->si_->alt_key = value;
+ if (this->repo_.servers ().find (value, this->si_->alt_info_) != 0)
+ {
+ Server_Info *base_si = 0;
+ ACE_NEW (base_si, Server_Info);
+ base_si->key_name_ = value;
+ this->si_->alt_info_.reset (base_si);
+ this->repo_.servers ().bind (value, this->si_->alt_info_);
+ }
}
else if (name == PID_TAG)
{
@@ -167,11 +174,11 @@ Locator_XMLHandler::endElement (const ACEXML_Char*,
{
if (ACE_OS::strcasecmp (qName, SERVER_INFO_TAG) == 0)
{
- if (this->si_->key_name.length () == 0)
+ if (this->si_->key_name_.length () == 0)
{
Server_Info::gen_key (this->si_->server_id,
this->si_->poa_name,
- this->si_->key_name);
+ this->si_->key_name_);
}
convertEnvList (this->env_vars_, this->si_->env_vars);
convertPeerList (this->peer_list_, this->si_->peers);
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
index 83da19a3723..25a0fb1242d 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.cpp
@@ -8,39 +8,35 @@ Server_Info::Server_Info (void)
Server_Info::Server_Info (const Server_Info &other)
{
+ *this = other;
+}
+
+Server_Info&
+Server_Info::operator= (const Server_Info &other)
+{
server_id = other.server_id;
poa_name = other.poa_name;
is_jacorb = other.is_jacorb;
- key_name = other.key_name;
+ key_name_ = other.key_name_;
activator = other.activator;
cmdline = other.cmdline;
dir = other.dir;
- activation_mode = other.activation_mode;
+ activation_mode_ = other.activation_mode_;
start_limit_ = other.start_limit_;
partial_ior = other.partial_ior;
ior = other.ior;
last_ping = other.last_ping;
server = other.server;
- alt_key = other.alt_key;
+ alt_info_ = other.alt_info_;
start_count = other.start_count;
waiting_clients = other.waiting_clients;
starting = other.starting;
pid = other.pid;
- peers.length (other.peers.length());
- for (size_t i = 0; i < other.peers.length(); i++)
- {
- peers[i] = other.peers[i];
- }
- env_vars.length (other.env_vars.length());
- for (size_t i = 0; i < other.env_vars.length(); i++)
- {
- env_vars[i].name = other.env_vars[i].name;
- env_vars[i].value = other.env_vars[i].value;
- }
-
+ peers = other.peers;
+ env_vars = other.env_vars;
+ return *this;
}
-
Server_Info::Server_Info (const ACE_CString& fqname,
const ACE_CString& aname,
const ACE_CString& cmdline,
@@ -54,24 +50,24 @@ Server_Info::Server_Info (const ACE_CString& fqname,
: server_id ()
, poa_name ()
, is_jacorb (false)
- , key_name ()
+ , key_name_ ()
, activator (aname)
, cmdline( cmdline)
, env_vars (env)
, dir (working_dir)
- , activation_mode (amode)
+ , activation_mode_ (amode)
, partial_ior (partial_ior)
, ior (server_ior)
, server(ImplementationRepository::ServerObject::_duplicate (svrobj))
, peers ()
- , alt_key ()
+ , alt_info_ ()
, start_count (0)
, waiting_clients (0)
, starting (false)
, pid (0)
{
this->is_jacorb = parse_id (fqname.c_str(), this->server_id, this->poa_name);
- Server_Info::gen_key (this->server_id, this->poa_name, this->key_name);
+ Server_Info::gen_key (this->server_id, this->poa_name, this->key_name_);
this->start_limit (limit);
}
@@ -79,35 +75,52 @@ Server_Info::Server_Info (const ACE_CString& fqname,
Server_Info::Server_Info (const ACE_CString& serverId,
const ACE_CString& pname,
bool jacorb,
- const ACE_CString& alt)
+ Server_Info_Ptr alt)
: server_id (serverId)
, poa_name (pname)
, is_jacorb (jacorb)
- , key_name ()
+ , key_name_ ()
, activator ("")
, cmdline ("")
, env_vars ()
, dir ("")
- , activation_mode (ImplementationRepository::NORMAL)
+ , activation_mode_ (ImplementationRepository::NORMAL)
, start_limit_ (1)
, partial_ior ("")
, ior ("")
, server (ImplementationRepository::ServerObject::_nil())
, peers ()
- , alt_key (alt)
+ , alt_info_ (alt)
, start_count (0)
, waiting_clients (0)
, starting (false)
, pid (0)
{
- Server_Info::gen_key (this->server_id, this->poa_name, this->key_name);
+ Server_Info::gen_key (this->server_id, this->poa_name, this->key_name_);
+}
+
+Server_Info *
+Server_Info::active_info (void)
+{
+ return this->alt_info_.null() ? this : this->alt_info_.get();
+}
+
+const Server_Info *
+Server_Info::active_info (void) const
+{
+ return this->alt_info_.null() ? this : this->alt_info_.get();
}
void
Server_Info::start_limit (int lim)
{
- this->start_limit_ =
- lim < 0 ? -lim : (lim == 0 ? 1 : lim);
+ this->active_info ()->start_limit_ = lim < 0 ? -lim : (lim == 0 ? 1 : lim);
+}
+
+bool
+Server_Info::is_mode (ImplementationRepository::ActivationMode m) const
+{
+ return this->active_info ()->activation_mode_ == m;
}
bool
@@ -142,6 +155,23 @@ Server_Info::parse_id (const char* id,
}
void
+Server_Info::gen_id (const Server_Info * si, ACE_CString &id)
+{
+ char sep = ':';
+ id = "";
+ if (si->is_jacorb)
+ {
+ id = "JACORB:";
+ sep = '/';
+ }
+ if (si->server_id.length() > 0)
+ {
+ id += si->server_id + sep;
+ }
+ id += si->poa_name;
+}
+
+void
Server_Info::gen_key (const ACE_CString& serverId,
const ACE_CString& poa_name,
ACE_CString &key)
@@ -169,7 +199,7 @@ Server_Info::fqname_to_key (const char * fqname, ACE_CString& key)
bool
Server_Info::has_peer (const char *name)
{
- return (this->key_name == name || this->poa_name == name);
+ return (this->key_name_ == name || this->poa_name == name);
}
bool
@@ -186,22 +216,17 @@ Server_Info::is_server (const char *name)
void
Server_Info::setImRInfo (ImplementationRepository::ServerInformation* info) const
{
- info->startup.command_line = cmdline.c_str ();
- if (this->is_jacorb)
- {
- ACE_CString jacorb_name (ACE_TEXT ("JACORB:") + poa_name);
- info->server = jacorb_name.c_str();
- }
- else
- info->server = this->poa_name.c_str();
-
- info->startup.command_line = cmdline.c_str ();
- info->startup.environment = env_vars;
- info->startup.working_directory = dir.c_str ();
- info->startup.activation = activation_mode;
- info->startup.activator = activator.c_str ();
+ ACE_CString id;
+ Server_Info::gen_id (this, id);
+ info->server = id.c_str();
+ const Server_Info *startup = this->active_info ();
+ info->startup.command_line = startup->cmdline.c_str ();
+ info->startup.environment = startup->env_vars;
+ info->startup.working_directory = startup->dir.c_str ();
+ info->startup.activation = startup->activation_mode_;
+ info->startup.activator = startup->activator.c_str ();
info->startup.start_limit =
- start_count >= start_limit_ ? -start_limit_ : start_limit_;
+ startup->start_count >= startup->start_limit_ ? -startup->start_limit_ : startup->start_limit_;
info->partial_ior = partial_ior.c_str();
info->activeStatus = ImplementationRepository::ACTIVE_MAYBE;
}
@@ -224,19 +249,19 @@ Server_Info::clear (void)
server_id = "";
poa_name = "";
is_jacorb = false;
- key_name = "";
+ key_name_ = "";
activator = "";
cmdline = "";
env_vars.length (0);
dir = "";
- activation_mode = ImplementationRepository::NORMAL;
+ activation_mode_ = ImplementationRepository::NORMAL;
start_limit_ = 0;
partial_ior = "";
ior = "";
last_ping = ACE_Time_Value::zero;
server = ImplementationRepository::ServerObject::_nil ();
peers.length (0);
- alt_key = "";
+ alt_info_.reset ();
start_count = 0;
waiting_clients = 0;
starting = false;
@@ -246,11 +271,40 @@ Server_Info::clear (void)
void
Server_Info::reset_runtime (void)
{
- this->ior = "";
this->partial_ior = "";
- this->pid = 0;
- this->last_ping = ACE_Time_Value::zero;
- this->server = ImplementationRepository::ServerObject::_nil ();
- // start_count = 0; Note : We can't do this, because it would
- // be reset during startup.
+ Server_Info *startup = this->active_info ();
+ startup->ior = "";
+ startup->pid = 0;
+ startup->last_ping = ACE_Time_Value::zero;
+ startup->server = ImplementationRepository::ServerObject::_nil ();
+}
+
+void
+Server_Info::update_options (const ImplementationRepository::StartupOptions &options)
+{
+ Server_Info *startup = this->active_info ();
+ startup->activator = options.activator.in ();
+ startup->cmdline = options.command_line.in ();
+ startup->env_vars = options.environment;
+ startup->dir = options.working_directory.in ();
+ startup->activation_mode_ = options.activation;
+ startup->start_limit (options.start_limit);
+ startup->start_count = 0;
+}
+
+const char *
+Server_Info::ping_id (void) const
+{
+ return this->active_info ()->key_name_.c_str();
+}
+
+void
+Server_Info::set_contact (const char *partial_ior,
+ const char *srv_ior,
+ ImplementationRepository::ServerObject_ptr svrobj)
+{
+ this->partial_ior = partial_ior;
+ Server_Info *startup = this->active_info ();
+ startup->ior = srv_ior;
+ startup->server = ImplementationRepository::ServerObject::_duplicate (svrobj);
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
index 0dad378bf45..408e112fc7f 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
+++ b/TAO/orbsvcs/ImplRepo_Service/Server_Info.h
@@ -23,27 +23,14 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+struct Server_Info;
+typedef ACE_Strong_Bound_Ptr<Server_Info, ACE_Null_Mutex> Server_Info_Ptr;
+
/**
* @brief Information about IMR registered servers.
*/
struct Server_Info
{
-#if 0
- Server_Info (const ACE_CString& serverId,
- const ACE_CString& pname,
- bool jacorbs,
- const ACE_CString& aname,
- const ACE_CString& cmdline,
- const ImplementationRepository::EnvironmentList& env,
- const ACE_CString& working_dir,
- ImplementationRepository::ActivationMode amode,
- int start_limit,
- const ACE_CString& partial_ior = ACE_CString(""),
- const ACE_CString& server_ior = ACE_CString(""),
- ImplementationRepository::ServerObject_ptr svrobj = ImplementationRepository::ServerObject::_nil()
- );
-#endif
-
Server_Info (void);
Server_Info (const Server_Info & other);
@@ -62,7 +49,9 @@ struct Server_Info
Server_Info (const ACE_CString& serverId,
const ACE_CString& pname,
bool jacorb,
- const ACE_CString& alt);
+ Server_Info_Ptr alt);
+
+ Server_Info & operator= (const Server_Info& other);
void clear (void);
@@ -74,14 +63,27 @@ struct Server_Info
bool is_server (const char *name);
bool has_peer (const char *name);
+ bool is_mode (ImplementationRepository::ActivationMode m) const;
// transform the supplied limit to always be at least 1
void start_limit (int lim);
+ void update_options (const ImplementationRepository::StartupOptions &options);
+ void set_contact (const char *pior,
+ const char *sior,
+ ImplementationRepository::ServerObject_ptr svrobj);
+
+ Server_Info *active_info (void);
+ const Server_Info *active_info (void) const;
+
+ const char * ping_id (void) const;
+
static bool parse_id (const char * id,
ACE_CString& server_id,
ACE_CString& poa_name);
+ static void gen_id (const Server_Info *si, ACE_CString& id);
+
static void gen_key (const ACE_CString& server_id,
const ACE_CString& poa_name,
ACE_CString& key);
@@ -96,7 +98,7 @@ struct Server_Info
bool is_jacorb;
/// The fully qualified name of this info, combines the serverID and POA name
- ACE_CString key_name;
+ ACE_CString key_name_;
/// The name of the activator in which this server runs
ACE_CString activator;
@@ -107,7 +109,7 @@ struct Server_Info
/// The working directory.
ACE_CString dir;
/// The type of activation this supports.
- ImplementationRepository::ActivationMode activation_mode;
+ ImplementationRepository::ActivationMode activation_mode_;
/// Limit of retries to start the server
int start_limit_;
/// Current endpoint used by the server.
@@ -120,16 +122,14 @@ struct Server_Info
ImplementationRepository::ServerObject_var server;
/// A comma separated list of additional POAs bound to this server
CORBA::StringSeq peers;
- /// The key used to look up the full server entry. Linked POAs have
- /// the same key
- ACE_CString alt_key;
+ /// Alternate server info for sharing startup info between linked POAs
+ Server_Info_Ptr alt_info_;
int start_count;
int waiting_clients;
bool starting;
int pid;
-};
-typedef ACE_Strong_Bound_Ptr<Server_Info, ACE_Null_Mutex> Server_Info_Ptr;
+};
#endif /* SERVER_INFO_H */
diff --git a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp
index f86d4dcc435..5d0e4e3482e 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp
@@ -470,16 +470,16 @@ Shared_Backing_Store::persistent_update (const Server_Info_Ptr& info, bool add)
}
}
- ACE_CString name = ACEXML_escape_string (info->key_name);
+ ACE_CString name = ACEXML_escape_string (info->key_name_);
UniqueId uid;
- this->find_unique_id (info->key_name, this->server_uids_, uid);
+ this->find_unique_id (info->key_name_, this->server_uids_, uid);
const ACE_TString fname = this->filename_ + uid.unique_filename;
if (this->opts_.debug() > 9)
{
ORBSVCS_DEBUG((LM_INFO, ACE_TEXT ("Persisting server to %s(%C)\n"),
- fname.c_str(), info->key_name.c_str()));
+ fname.c_str(), info->key_name_.c_str()));
}
Lockable_File server_file (fname, O_WRONLY);
const ACE_TString bfname = fname.c_str() + ACE_TString(".bak");
@@ -511,7 +511,7 @@ Shared_Backing_Store::persistent_update (const Server_Info_Ptr& info, bool add)
ImplementationRepository::repo_add :
ImplementationRepository::repo_update;
replicate<ImplementationRepository::ServerUpdate> (peer_replica_.in (),
- info->key_name, uid, type,
+ info->key_name_, uid, type,
++seq_num_);
return 0;
}
@@ -894,7 +894,7 @@ Shared_Backing_Store::write_listing (FILE* list)
const Server_Info_Ptr& info = sientry->int_id_;
find_unique_id (sientry->ext_id_, this->server_uids_, uid);
- ACE_CString listing_name = ACEXML_escape_string (info->key_name);
+ ACE_CString listing_name = ACEXML_escape_string (info->key_name_);
write_listing_item (list, uid.unique_filename, listing_name,
Locator_XMLHandler::SERVER_INFO_TAG);
}
@@ -1017,31 +1017,18 @@ Shared_Backing_Store::load_server (Server_Info *info,
const NameValues& extra_params)
{
// ensure there is an entry for this server
- this->verify_unique_id (info->key_name,
+ this->verify_unique_id (info->key_name_,
extra_params,
this->server_uids_);
Server_Info_Ptr si;
- if (this->servers ().find (info->key_name, si) != 0)
+ if (this->servers ().find (info->key_name_, si) != 0)
{
// create new or replace the existing entry
XML_Backing_Store::load_server (info, server_started, extra_params);
return;
}
- si->ior = info->ior;
- si->poa_name = info->poa_name;
- si->server_id = info->server_id;
- si->is_jacorb = info->is_jacorb;
- si->activator = info->activator;
- si->cmdline = info->cmdline;
- si->env_vars = info->env_vars;
- si->dir = info->dir;
- si->activation_mode = info->activation_mode;
- si->start_limit_ = info->start_limit_;
- si->partial_ior = info->partial_ior;
- si->peers = info->peers;
- si->key_name = info->key_name;
- si->alt_key = info->alt_key;
+ *si.get() = *info;
if (!server_started)
si->server = ImplementationRepository::ServerObject::_nil();
@@ -1330,7 +1317,7 @@ Shared_Backing_Store::LocatorListings_XMLHandler::remove_unmatched(
{
ORBSVCS_ERROR((LM_ERROR,
ACE_TEXT ("ERROR: could not remove server: %s\n"),
- sientry->int_id_->key_name.c_str()));
+ sientry->int_id_->key_name_.c_str()));
}
}
diff --git a/TAO/orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp b/TAO/orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp
index 6468687509c..d84a482850d 100644
--- a/TAO/orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/UpdateableServerInfo.cpp
@@ -47,8 +47,11 @@ UpdateableServerInfo::update_repo ()
needs_update_ = false;
int err = repo_->update_server (si_);
+ if (err == 0 && !si_->alt_info_.null ())
+ {
+ err = repo_->update_server (si_->alt_info_);
+ }
ACE_ASSERT (err == 0);
- ACE_UNUSED_ARG (err);
}
const Server_Info*
diff --git a/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp
index 6c54ddced77..25d603912ae 100644
--- a/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/XML_Backing_Store.cpp
@@ -95,8 +95,12 @@ XML_Backing_Store::persist (FILE* fp,
{
ACE_CString server_id = ACEXML_escape_string (info.server_id);
ACE_CString pname = ACEXML_escape_string (info.poa_name);
- ACE_CString keyname = ACEXML_escape_string (info.key_name);
- ACE_CString altkey = ACEXML_escape_string (info.alt_key);
+ ACE_CString keyname = ACEXML_escape_string (info.key_name_);
+ ACE_CString altkey = "";
+ if (!info.alt_info_.null())
+ {
+ altkey = ACEXML_escape_string (info.alt_info_->key_name_);
+ }
ACE_CString activator = ACEXML_escape_string (info.activator);
ACE_CString cmdline = ACEXML_escape_string (info.cmdline);
@@ -104,7 +108,7 @@ XML_Backing_Store::persist (FILE* fp,
ACE_CString partial_ior = ACEXML_escape_string (info.partial_ior);
ACE_CString ior = ACEXML_escape_string (info.ior);
ACE_CString amodestr =
- ImR_Utils::activationModeToString (info.activation_mode);
+ ImR_Utils::activationModeToString (info.activation_mode_);
ACE_OS::fprintf (fp,"%s<%s", tag_prepend,
Locator_XMLHandler::SERVER_INFO_TAG);
@@ -281,7 +285,7 @@ XML_Backing_Store::load_server (Server_Info *info,
{
Server_Info_Ptr si (info);
- this->servers().rebind (info->key_name, si);
+ this->servers().rebind (info->key_name_, si);
create_server (server_started, si);
}
diff --git a/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl
index 20b6c6a5dec..cce335e5e85 100755
--- a/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl
@@ -30,10 +30,17 @@ my $srv_b_id = "BBB";
my $client_duration = 30;
my $ping_ext = '';
+my $imr_debug = "";
+my $srva_debug = "";
+my $srvb_debug = "";
+my $clt_debug = "";
+
foreach my $i (@ARGV) {
if ($i eq '-debug') {
- $debug_level = '10';
- $imr_debug_level = '3';
+ $imr_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile imr.log -d 10 ";
+ $srva_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile srva.log ";
+ $srvb_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile srvb.log ";
+ $clt_debug = "-ORBDebugLevel 10 -ORBVerboseLogging 1 -ORBLogFile clt.log ";
}
if ($i eq '-forwardalways') {
$delay = '5';
@@ -75,28 +82,25 @@ $cli->DeleteFile ($srvaiorfile);
$IMR = $imr->CreateProcess ("../../../ImplRepo_Service/tao_imr_locator",
"-ORBEndpoint "."$protocol"."://:".$port." ".
- "-UnregisterIfAddressReused ".
- "-d $imr_debug_level ".
+ "-UnregisterIfAddressReused $imr_debug".
"$ping_ext ".
"-o $imr_imriorfile ");
-# "-p $imr_imrdbfile");
+
$SRV_A = $srva->CreateProcess ("serverA",
- "_ORBDebugLevel = $debug_level ".
- "-ORBEndpoint " . "$protocol" . "://:" . "$srv_port_base/portspan=20 ".
+ "-ORBEndpoint " . $protocol . "://:" ."$srv_port_base/portspan=20 ".
"-ORBInitRef ImplRepoService=file://$srva_imriorfile ".
- "-ORBServerId $srv_a_id ".
+ "-ORBServerId $srv_a_id $srva_debug".
"-ORBUseIMR 1 ".
"-o $srva_srvaiorfile");
$SRV_B = $srvb->CreateProcess ("serverB",
- "_ORBDebugLevel = $debug_level ".
- "-ORBEndpoint " . "$protocol" . "://:" . "$srv_port_base/portspan=20 ".
+ "-ORBEndpoint " . $protocol . "://:" . "$srv_port_base/portspan=20 ".
"-ORBInitRef ImplRepoService=file://$srvb_imriorfile ".
- "-ORBServerId $srv_b_id ".
+ "-ORBServerId $srv_b_id $srvb_debug".
"-ORBUseIMR 1 ".
"-o $srvb_srvbiorfile");
$CLI = $cli->CreateProcess ("client",
"$forward_opt -i file://$cli_srvaiorfile ".
- "-t $client_duration ".
+ "-t $client_duration $clt_debug".
"-e $got_object_not_exist_exception ");