summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp')
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp76
1 files changed, 9 insertions, 67 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
index 29630185a29..fd18d93299d 100644
--- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.cpp
@@ -67,8 +67,8 @@ Locator_Repository::report_ior (PortableServer::POA_ptr )
IORTable::Table_var ior_table = IORTable::Table::_narrow (obj.in ());
ACE_ASSERT (! CORBA::is_nil (ior_table.in ()));
- ior_table->rebind ("ImplRepoService", this->imr_ior_.in());
- ior_table->rebind ("ImR", this->imr_ior_.in());
+ ior_table->bind ("ImplRepoService", this->imr_ior_.in());
+ ior_table->bind ("ImR", this->imr_ior_.in());
// Set up multicast support (if enabled)
if (this->opts_.multicast ())
@@ -121,70 +121,6 @@ Locator_Repository::report_ior (PortableServer::POA_ptr )
}
int
-Locator_Repository::recover_ior (void)
-{
- if (this->registered_)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("ERROR: Repository already registered IOR. ")
- ACE_TEXT ("recover_ior should not be called.\n")), -1);
- }
-
- if (this->opts_.debug () > 0)
- {
- ACE_DEBUG ((LM_INFO, ACE_TEXT ("recover_ior <%C>\n"),
- this->opts_.ior_filename ().c_str()));
- }
-
- // Load the IOR from the specified file if it is available.
- const ACE_TString& combined_ior_file = this->opts_.ior_filename ();
-
- // Check if the file exists. If not, then return 1 indicating
- // we cannot recover our state.
- if (ACE_OS::access (combined_ior_file.c_str (), F_OK) != 0)
- return -1;
-
- try {
- ACE_TString combined_ior = "file://" + combined_ior_file;
-
- CORBA::Object_var combined_obj =
- this->orb_->string_to_object (combined_ior.c_str());
-
- if (!CORBA::is_nil (combined_obj.in ()))
- {
- // Convert the object back into an IOR string to store in the
- // imr_ior_ attribute.
- this->imr_ior_ = this->orb_->object_to_string (combined_obj.in ());
- }
- }
- catch (const CORBA::Exception& ex)
- {
- ex._tao_print_exception ("Attempting to read combined_ior for ImR_Locator\n");
- return -1;
- }
-
- // Register the ImR for use with INS
- CORBA::Object_var obj = this->orb_->resolve_initial_references ("IORTable");
- IORTable::Table_var ior_table = IORTable::Table::_narrow (obj.in ());
- ACE_ASSERT (! CORBA::is_nil (ior_table.in ()));
-
- ior_table->bind ("ImplRepoService", this->imr_ior_.in());
- ior_table->bind ("ImR", this->imr_ior_.in());
-
- // Set up multicast support (if enabled)
- if (this->opts_.multicast ())
- {
- ACE_Reactor* reactor = this->orb_->orb_core ()->reactor ();
- if (this->setup_multicast (reactor, this->imr_ior_.in ()) != 0)
- return -1;
- }
-
- registered_ = true;
-
- return 0;
-}
-
-int
Locator_Repository::setup_multicast (ACE_Reactor* reactor, const char* ior)
{
ACE_ASSERT (reactor != 0);
@@ -508,11 +444,17 @@ UpdateableServerInfo::UpdateableServerInfo (
}
UpdateableServerInfo::UpdateableServerInfo (Locator_Repository* repo,
- const Server_Info_Ptr& si)
+ const Server_Info_Ptr& si,
+ bool reset_start_count)
: repo_(repo),
si_(si),
needs_update_(false)
{
+ if (reset_start_count)
+ {
+ needs_update_ = repo_ != 0;
+ si_->start_count = 0;
+ }
}
UpdateableServerInfo::UpdateableServerInfo (const Server_Info& si)