summaryrefslogtreecommitdiff
path: root/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/ciao/Deployment/Handlers/Component_Handler.cpp')
-rw-r--r--CIAO/ciao/Deployment/Handlers/Component_Handler.cpp52
1 files changed, 37 insertions, 15 deletions
diff --git a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
index 7cbe68f9c02..6973ffac406 100644
--- a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
+++ b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp
@@ -24,6 +24,10 @@ namespace CIAO
void
Component_Handler_i::close (void)
{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
+ guard,
+ this->instances_mutex_,
+ CORBA::NO_RESOURCES ());
this->instances_.clear ();
}
@@ -45,7 +49,7 @@ namespace CIAO
Component_Handler_i::instance_type (void)
{
CIAO_TRACE ("Component_Handler_i::instance_type");
- return CORBA::string_dup ("edu.dre.vanderbilt.dre.CCM.Component");
+ return CORBA::string_dup (CIAO::Deployment::CCM_COMPONENT);
}
void
@@ -257,7 +261,13 @@ namespace CIAO
"Container provided nil object reference");
}
- this->instances_[idd.name.in ()] = info;
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
+ guard,
+ this->instances_mutex_,
+ CORBA::NO_RESOURCES ());
+ this->instances_[idd.name.in ()] = info;
+ }
DEPLOYMENT_STATE::instance ()->add_component (idd.name.in (),
cont_id,
@@ -400,18 +410,24 @@ namespace CIAO
CIAO_TRACE ("Component_Handler_i::remove_instance");
const char *name = plan.instance[instanceRef].name.in ();
- Deployment_Common::INSTANCES::iterator instance
- = this->instances_.find (name);
-
- if (instance == this->instances_.end ())
- {
- CIAO_ERROR (1, (LM_ERROR, CLINFO
- "Component_Handler_i::remove_instance - "
- "Instructed to remove unknown component instance <%C>\n",
- name));
- throw ::Deployment::StopError (name,
- "Wrong instance handler for component instance\n");
- }
+ Deployment_Common::INSTANCES::iterator instance;
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
+ guard,
+ this->instances_mutex_,
+ CORBA::NO_RESOURCES ());
+ instance = this->instances_.find (name);
+
+ if (instance == this->instances_.end ())
+ {
+ CIAO_ERROR (1, (LM_ERROR, CLINFO
+ "Component_Handler_i::remove_instance - "
+ "Instructed to remove unknown component instance <%C>\n",
+ name));
+ throw ::Deployment::StopError (name,
+ "Wrong instance handler for component instance\n");
+ }
+ }
CIAO_DEBUG (8, (LM_DEBUG, CLINFO
"Component_Handler_i::remove_instance - "
@@ -477,7 +493,13 @@ namespace CIAO
"Unknown C++ exception\n");
}
- this->instances_.erase (instance);
+ {
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX,
+ guard,
+ this->instances_mutex_,
+ CORBA::NO_RESOURCES ());
+ this->instances_.erase (instance);
+ }
DEPLOYMENT_STATE::instance ()->remove_component (name);
CIAO_DEBUG (4, (LM_INFO, CLINFO