summaryrefslogtreecommitdiff
path: root/CIAO/ciao
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2014-03-23 13:03:26 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2014-03-23 13:03:26 +0000
commit925b545f68197cdd6d7b1ecd07a754be946b3165 (patch)
tree1b7d5d5755e9b63b3a765f07e6755939c2bb1a97 /CIAO/ciao
parent1f9c52974b094c977f08b33445284bf981b6e8ae (diff)
downloadATCD-925b545f68197cdd6d7b1ecd07a754be946b3165.tar.gz
Sun Mar 23 13:04:16 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* ciao/Deployment/Interceptors/Deployment_Interceptors.h: * ciao/Deployment/Interceptors/Deployment_Interceptors.cpp: Remove registration from the naming service in the post remove. Thanks to Michael Frommberger <michael dot frommberger at gmx dot net> for providing this patch * tests/DAnCE/StoreReferences/client.cpp: * tests/DAnCE/StoreReferences/run_test.pl: Small changes to make sure the test runs now perfect with the patch integrated
Diffstat (limited to 'CIAO/ciao')
-rw-r--r--CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp47
-rw-r--r--CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h4
2 files changed, 51 insertions, 0 deletions
diff --git a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
index a5f128de2d4..bf8093254c3 100644
--- a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
+++ b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.cpp
@@ -109,6 +109,53 @@ namespace CIAO
}
}
+ void CIAO_StoreReferences_i::post_remove (const ::Deployment::DeploymentPlan & plan,
+ ::CORBA::ULong instanceRef,
+ const ::CORBA::Any & exception_thrown)
+ {
+ const ::Deployment::InstanceDeploymentDescription &inst = plan.instance[instanceRef];
+
+ CIAO_DEBUG (9, (LM_TRACE, CLINFO
+ "CIAO_StoreReferences_i::post_remove - "
+ "Interceptor post remove for instance %C\n",
+ plan.instance[instanceRef].name.in ()));
+
+ if (exception_thrown.type() != ::CORBA::_tc_null)
+ {
+ std::string result;
+ DAnCE::Utility::stringify_exception_from_any (exception_thrown,
+ result);
+ CIAO_ERROR (3 , (LM_WARNING, CLINFO
+ ACE_TEXT ("CIAO_StoreReferences_i::post_remove - ")
+ ACE_TEXT ("Received exception while unregistering ")
+ ACE_TEXT ("for instance ")
+ ACE_TEXT ("<%C>:<%C>\n"),
+ plan.instance[instanceRef].name.in (),
+ result.c_str ()));
+ return;
+ }
+
+ for (CORBA::ULong i = 0; i < inst.configProperty.length (); ++i)
+ {
+ if (ACE_OS::strcmp (inst.configProperty[i].name.in (),
+ DAnCE::REGISTER_NAMING) == 0)
+ {
+ const char * name = 0;
+ inst.configProperty[i].value >>= CORBA::Any::to_string (name, 0);
+
+ CIAO_DEBUG (9, (LM_TRACE, CLINFO
+ "CIAO_StoreReferences_i::post_remove - "
+ "Unregistering name %C for instance %C\n",
+ name,
+ plan.instance[instanceRef].name.in ()));
+
+ ::CosNaming::NamingContext_var ctx_safe =
+ ::CosNaming::NamingContext::_duplicate (this->ctx_.in ());
+ Name_Utilities::unbind_object (name, ctx_safe.in ());
+ }
+ }
+ }
+
void
CIAO_StoreReferences_i::configure (const ::Deployment::Properties &props )
{
diff --git a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h
index 9d3498624cf..ca63cf8acf2 100644
--- a/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h
+++ b/CIAO/ciao/Deployment/Interceptors/Deployment_Interceptors.h
@@ -39,6 +39,10 @@ namespace CIAO
const ::CORBA::Any & reference,
const ::CORBA::Any & exception_thrown);
+ virtual void post_remove (const ::Deployment::DeploymentPlan & plan,
+ ::CORBA::ULong instanceRef,
+ const ::CORBA::Any & exception_thrown);
+
virtual void configure(const Deployment::Properties&);
CORBA::ORB_var orb_;