summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2013-04-08 03:32:42 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2013-04-08 03:32:42 +0000
commit8d238fc5b0fcdba9861740f2bdec8f07b0d192f3 (patch)
tree4034c2840798bb6c750a4813c8e2a0faf41643bb
parent730c6af03f97371032580fb3aa4338ce915032b3 (diff)
downloadATCD-8d238fc5b0fcdba9861740f2bdec8f07b0d192f3.tar.gz
Mon Apr 8 03:29:47 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog_Asynch_ImR8
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp53
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h11
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp38
4 files changed, 86 insertions, 24 deletions
diff --git a/TAO/ChangeLog_Asynch_ImR b/TAO/ChangeLog_Asynch_ImR
index d3fe5318b15..96a92e16d36 100644
--- a/TAO/ChangeLog_Asynch_ImR
+++ b/TAO/ChangeLog_Asynch_ImR
@@ -1,3 +1,11 @@
+Mon Apr 8 03:29:47 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/ImplRepo_Service/AsyncAccessManager.h:
+ * orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp:
+ * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp:
+
+ Coveratge for PER_CLIENT activations.
+
Sun Apr 7 13:55:15 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/ImplRepo_Service/Forwarder.cpp:
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
index b9aeab24f1e..d22a3c10ed2 100644
--- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp
@@ -49,6 +49,15 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh)
this->rh_list_.push_back (rh);
}
+ if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT)
+ {
+ if (!this->send_start_request())
+ {
+ this->final_state();
+ }
+ return;
+ }
+
if (this->status_ == AAM_SERVER_READY || this->status_ == AAM_SERVER_STARTED_RUNNING)
{
if (this->locator_.pinger().is_alive (this->info_->name.c_str()))
@@ -59,7 +68,9 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh)
}
}
- if (this->status_ == AAM_INIT || this->status_ == AAM_SERVER_READY || this->status_ == AAM_SERVER_STARTED_RUNNING)
+ if (this->status_ == AAM_INIT ||
+ this->status_ == AAM_SERVER_READY ||
+ this->status_ == AAM_SERVER_STARTED_RUNNING)
{
// This is not a leak. The listener registers with
// the pinger and will delete itself when done.
@@ -172,10 +183,12 @@ AsyncAccessManager::server_is_shutting_down (void)
}
void
-AsyncAccessManager::server_is_running (const char *partial_ior)
+AsyncAccessManager::server_is_running (const char *partial_ior,
+ ImplementationRepository::ServerObject_ptr ref)
{
this->status (AAM_WAIT_FOR_ALIVE);
this->info_->partial_ior = partial_ior;
+ this->info_->server = ImplementationRepository::ServerObject::_duplicate (ref);
if (this->locator_.pinger().is_alive (this->info_->name.c_str()))
{
@@ -186,9 +199,19 @@ AsyncAccessManager::server_is_running (const char *partial_ior)
// This is not a leak. The listener registers with
// the pinger and will delete itself when done.
AsyncLiveListener *l = 0;
- ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(),
- this,
- this->locator_.pinger()));
+ if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT)
+ {
+ ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(),
+ this,
+ this->locator_.pinger(),
+ this->info_->server.in()));
+ }
+ else
+ {
+ ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(),
+ this,
+ this->locator_.pinger()));
+ }
if (!l->start())
{
this->status (AAM_SERVER_DEAD);
@@ -462,7 +485,22 @@ AsyncLiveListener::AsyncLiveListener (const char *server,
:LiveListener (server),
aam_ (aam->add_ref ()),
pinger_ (pinger),
- status_ (LS_UNKNOWN)
+ status_ (LS_UNKNOWN),
+ per_client_ (false),
+ srv_ref_ (ImplementationRepository::ServerObject::_nil())
+{
+}
+
+AsyncLiveListener::AsyncLiveListener (const char *server,
+ AsyncAccessManager *aam,
+ LiveCheck &pinger,
+ ImplementationRepository::ServerObject_ptr ref)
+ :LiveListener (server),
+ aam_ (aam->add_ref ()),
+ pinger_ (pinger),
+ status_ (LS_UNKNOWN),
+ per_client_ (true),
+ srv_ref_ (ImplementationRepository::ServerObject::_duplicate (ref))
{
}
@@ -473,7 +511,8 @@ AsyncLiveListener::~AsyncLiveListener (void)
bool
AsyncLiveListener::start (void)
{
- bool rtn = this->pinger_.add_listener (this);
+ bool rtn = this->per_client_ ? this->pinger_.add_per_client_listener (this,srv_ref_.in())
+ : this->pinger_.add_listener (this);
if (!rtn)
delete this;
return rtn;
diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h
index b89669a3f80..358d4efebbd 100644
--- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h
+++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h
@@ -81,7 +81,8 @@ class AsyncAccessManager
AAM_Status status (void) const;
void activator_replied (bool success);
- void server_is_running (const char *partial_ior);
+ void server_is_running (const char *partial_ior,
+ ImplementationRepository::ServerObject_ptr ref);
void server_is_shutting_down (void);
void ping_replied (LiveStatus server);
@@ -168,7 +169,13 @@ class AsyncLiveListener : public LiveListener
public:
AsyncLiveListener (const char * server,
AsyncAccessManager *aam,
+ LiveCheck &pinger,
+ ImplementationRepository::ServerObject_ptr ref);
+
+ AsyncLiveListener (const char * server,
+ AsyncAccessManager *aam,
LiveCheck &pinger);
+
virtual ~AsyncLiveListener (void);
bool start (void);
@@ -178,6 +185,8 @@ class AsyncLiveListener : public LiveListener
AsyncAccessManager_ptr aam_;
LiveCheck &pinger_;
LiveStatus status_;
+ bool per_client_;
+ ImplementationRepository::ServerObject_var srv_ref_;
};
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
index b566e2df7b3..fcfe1593773 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp
@@ -520,7 +520,7 @@ ImR_Locator_i::activate_server_i (UpdateableServerInfo& info,
AsyncAccessManager *aam_raw;
ACE_NEW (aam_raw, AsyncAccessManager (*info, manual_start, *this));
aam = aam_raw;
- this->aam_set_.insert (aam);
+ this->aam_set_.insert_tail (aam);
}
else
{
@@ -902,8 +902,6 @@ ImR_Locator_i::server_is_running
ImplementationRepository::ServerObject_var s =
ImplementationRepository::ServerObject::_narrow (obj.in());
- this->pinger_.add_server (name.c_str(), s);
-
UpdateableServerInfo info(this->repository_.get(), name);
if (info.null ())
{
@@ -926,7 +924,7 @@ ImR_Locator_i::server_is_running
DEFAULT_START_LIMIT,
partial_ior,
ior.in (),
- ImplementationRepository::ServerObject::_nil ()
+ s.in ()
);
Server_Info_Ptr temp_info = this->repository_->get_server(name);
@@ -943,6 +941,7 @@ ImR_Locator_i::server_is_running
return;
}
+ this->pinger_.add_server (name.c_str(), s);
AsyncAccessManager *aam_raw;
ACE_NEW (aam_raw, AsyncAccessManager (*temp_info, true, *this));
AsyncAccessManager_ptr aam (aam_raw);
@@ -968,18 +967,22 @@ ImR_Locator_i::server_is_running
info.edit ()->server = s;
info.update_repo();
+ this->pinger_.add_server (name.c_str(), s);
}
AsyncAccessManager_ptr aam(this->find_aam (name.c_str()));
if (*aam != 0)
- aam->server_is_running (partial_ior);
+ aam->server_is_running (partial_ior, s);
else
{
- AsyncAccessManager *aam_raw;
- ACE_NEW (aam_raw, AsyncAccessManager (*info, true, *this));
- AsyncAccessManager_ptr aam (aam_raw);
- aam->started_running ();
- this->aam_set_.insert (aam);
+ if (info->activation_mode != ImplementationRepository::PER_CLIENT)
+ {
+ AsyncAccessManager *aam_raw;
+ ACE_NEW (aam_raw, AsyncAccessManager (*info, true, *this));
+ AsyncAccessManager_ptr aam (aam_raw);
+ aam->started_running ();
+ this->aam_set_.insert (aam);
+ }
}
}
_tao_rh->server_is_running ();
@@ -1010,14 +1013,17 @@ ImR_Locator_i::server_is_shutting_down
ACE_TEXT ("ImR: Server <%C> is shutting down.\n"),
server));
- this->pinger_.remove_server (server);
- {
- AsyncAccessManager_ptr aam = this->find_aam (server);
- if (*aam != 0)
+ if (info->activation_mode != ImplementationRepository::PER_CLIENT)
+ {
+ this->pinger_.remove_server (server);
{
- aam->server_is_shutting_down ();
+ AsyncAccessManager_ptr aam = this->find_aam (server);
+ if (*aam != 0)
+ {
+ aam->server_is_shutting_down ();
+ }
}
- }
+ }
info.edit ()->reset ();
_tao_rh->server_is_shutting_down ();
}