summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-22 23:57:34 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-22 23:57:34 +0000
commita576d4d2528b106287cd5fc7fec8a471d10c521a (patch)
tree3237034e0c0d89b3edeba06a0db95c89fc2de9d1
parent6e2c7a711e6c08c525beb14c6dcadc8c139e1f99 (diff)
downloadATCD-a576d4d2528b106287cd5fc7fec8a471d10c521a.tar.gz
.
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp110
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h18
2 files changed, 125 insertions, 3 deletions
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
index 235f52a7148..606e6ad22b9 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
@@ -733,7 +733,7 @@ add_es_to_map (Deployment::ESInstallationInfos * es_infos,
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "DomainApplicationManager_Impl::add_to_es_table.\n");
+ "DomainApplicationManager_Impl::add_es_to_map.\n");
ACE_RE_THROW;
}
ACE_ENDTRY;
@@ -1219,7 +1219,113 @@ populate_connection_for_binding (
// The initial retv might have something inside
CORBA::ULong len = retv.length ();
- // The modeling tool should make sure there are always 2 ports in a binding
+ const CORBA::ULong binding_len = binding.internalEndpoint.length ();
+
+ if (binding_len == 1)
+ {
+ switch (binding.internalEndpoint[0].kind)
+ {
+ case Deployment::rtecEventPublisher:
+ case Deployment::rtecEventConsumer:
+ return
+ this->handle_es_connection (instname,
+ binding,
+ plan,
+ retv);
+ default:
+ ACE_ERROR ((LM_ERROR,
+ "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -"
+ "CIAO::DomainApplicationManager_Impl::"
+ "populate_connection_for_binding -"
+ "invalid connection specified in deployment plan\n"));
+ return false;
+ }
+ }
+ else if (binding_len == 2)
+ {
+ return this->handle_direct_connection (instname,
+ binding,
+ plan,
+ retv);
+ }
+ else // invalid binding encounted...
+ return false;
+}
+
+bool
+CIAO::DomainApplicationManager_Impl::
+handle_es_connection (
+ const char * instname,
+ const Deployment::PlanConnectionDescription & binding,
+ const Deployment::DeploymentPlan & plan,
+ Deployment::Connections & retv)
+ ACE_THROW_SPEC ((Deployment::StartError))
+{
+ // The initial retv might have something inside
+ CORBA::ULong len = retv.length ();
+
+ const Deployment::PlanSubcomponentPortEndpoint & endpoint =
+ binding.internalEndpoint[0];
+
+ // If the instance name does NOT match one of the names in the binding
+ if (ACE_OS::strcmp (instname,
+ plan.instance[endpoint.instanceRef].name.in ()) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -"
+ "CIAO::DomainApplicationManager_Impl::"
+ "handle_publisher_es_connection -"
+ "invalid connection specified in deployment plan\n"));
+ return false;
+ }
+
+ if (binding.externalReference.length () != 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -"
+ "CIAO::DomainApplicationManager_Impl::"
+ "handle_publisher_es_connection -"
+ "externalReference must have length of 1.\n"));
+ return false;
+ }
+
+ retv[len].instanceName = instname;
+ retv[len].portName = binding.internalEndpoint[0].portName.in ();
+ retv[len].kind = binding.internalEndpoint[0].kind;
+
+ CIAO::CIAO_Event_Service_var es;
+
+ ACE_CString es_id = binding.externalReference[0].location.in ();
+
+ // If we didnt find the objref of the connection ...
+ if (this->es_map_.find (es_id.c_str (), es) != 0)
+ {
+ ACE_CString error ("Creating connections for ");
+ error += instname;
+ error += ": unable to find object reference for connection ";
+ error += binding.name.in ();
+ ACE_THROW_RETURN (Deployment::StartError
+ ("DomainApplicationManager_Impl::create_connections_i",
+ error.c_str ()),
+ false);
+ }
+
+ retv[len].event_service = es._retn ();
+ return true;
+}
+
+bool
+CIAO::DomainApplicationManager_Impl::
+handle_direct_connection (
+ const char * instname,
+ const Deployment::PlanConnectionDescription & binding,
+ const Deployment::DeploymentPlan & plan,
+ Deployment::Connections & retv)
+ ACE_THROW_SPEC ((Deployment::StartError))
+{
+ // The initial retv might have something inside
+ CORBA::ULong len = retv.length ();
+
const CORBA::ULong binding_len = binding.internalEndpoint.length ();
for (CORBA::ULong i = 0; i < binding_len; ++i)
{
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
index 98b911b3387..3c38d573ffe 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
@@ -337,7 +337,23 @@ namespace CIAO
bool
populate_connection_for_binding (
const char * instname,
- const Deployment::PlanConnectionDescription & curr_conn,
+ const Deployment::PlanConnectionDescription & binding,
+ const Deployment::DeploymentPlan & plan,
+ Deployment::Connections & retv)
+ ACE_THROW_SPEC ((Deployment::StartError));
+
+ bool
+ handle_es_connection (
+ const char * instname,
+ const Deployment::PlanConnectionDescription & binding,
+ const Deployment::DeploymentPlan & plan,
+ Deployment::Connections & retv)
+ ACE_THROW_SPEC ((Deployment::StartError));
+
+ bool
+ handle_direct_connection (
+ const char * instname,
+ const Deployment::PlanConnectionDescription & binding,
const Deployment::DeploymentPlan & plan,
Deployment::Connections & retv)
ACE_THROW_SPEC ((Deployment::StartError));