summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-10 19:52:23 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-10 19:52:23 +0000
commit3ba5d5a64c93de55bdf0fae5edc595d55ff9e2f4 (patch)
tree65540a8f1b0d84b2a7f50f21b88b354226d16364
parentf7888ab0569c46cd368af7182cfc5bfbedcbd488 (diff)
downloadATCD-3ba5d5a64c93de55bdf0fae5edc595d55ff9e2f4.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/Deployment.xsd9
-rw-r--r--TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp18
-rw-r--r--TAO/CIAO/DAnCE/ciao/CCM_Component.idl2
-rw-r--r--TAO/CIAO/DAnCE/ciao/Deployment_Core.idl14
-rw-r--r--TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp153
-rw-r--r--TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h29
-rw-r--r--TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp2
7 files changed, 214 insertions, 13 deletions
diff --git a/TAO/CIAO/DAnCE/Deployment.xsd b/TAO/CIAO/DAnCE/Deployment.xsd
index c8a6399730b..7d30f3ffd9b 100644
--- a/TAO/CIAO/DAnCE/Deployment.xsd
+++ b/TAO/CIAO/DAnCE/Deployment.xsd
@@ -761,6 +761,15 @@
<xsd:enumeration value="EventEmitter"/>
<xsd:enumeration value="EventPublisher"/>
<xsd:enumeration value="EventConsumer"/>
+ <xsd:enumeration value="cosEventEmitter"/>
+ <xsd:enumeration value="cosEventPublisher"/>
+ <xsd:enumeration value="cosEventConsumer"/>
+ <xsd:enumeration value="rtEventEmitter"/>
+ <xsd:enumeration value="rtEventPublisher"/>
+ <xsd:enumeration value="rtEventConsumer"/>
+ <xsd:enumeration value="nsEventEmitter"/>
+ <xsd:enumeration value="nsEventPublisher"/>
+ <xsd:enumeration value="nsEventConsumer"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="SatisfierPropertyKind">
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
index 2e143c1c045..3ee108c434a 100644
--- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
@@ -699,8 +699,24 @@ get_outgoing_connections_i (const char * instname,
retv.length (len+1);
retv[len].instanceName = instname;
retv[len].portName = endpoint.portName.in ();
- retv[len].kind = endpoint.kind;
+ retv[len].kind = endpoint.kind; // either emitter/publisher or receptacle.
retv[len].endpoint = CORBA::Object::_duplicate(curr_rev_conn.endpoint.in ());
+
+ // CIAO-specific fields below
+ // If the component port type needs to use CIAO specific publish/subscribe
+ // service, then we also need to set up the "consumer side component name"
+ // and "consumer side port name".
+ if (retv[len].kind == Deployment::rtecEventPublisher ||
+ retv[len].kind == Deployment::rtecEventEmitter ||
+ retv[len].kind == Deployment::cosEventPublisher ||
+ retv[len].kind == Deployment::cosEventEmitter ||
+ retv[len].kind == Deployment::nsEventPublisher ||
+ retv[len].kind == Deployment::nsEventEmitter)
+ {
+ retv[len].consumerCompName = name.c_str ();
+ retv[len].consumerPortName = port_name.c_str ();
+ }
+
++len;
found = true;
break; // Since we know there is only 2 endpoints in a connection.
diff --git a/TAO/CIAO/DAnCE/ciao/CCM_Component.idl b/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
index 55daac21be5..c24bf884d7b 100644
--- a/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
+++ b/TAO/CIAO/DAnCE/ciao/CCM_Component.idl
@@ -132,7 +132,7 @@ module Components
ComponentPortDescription get_all_ports ();
- //attribute UUID component_UUID;
+ attribute UUID component_UUID;
};
// @@ Enumeration and DefaultEnumeration are only for EJB to CCM
diff --git a/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl b/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl
index 51e86625c59..6844cacd46a 100644
--- a/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl
+++ b/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl
@@ -46,7 +46,16 @@ module Deployment
MultiplexReceptacle,
EventEmitter,
EventPublisher,
- EventConsumer
+ EventConsumer,
+ cosEventEmitter,
+ cosEventPublisher,
+ cosEventConsumer,
+ rtecEventEmitter,
+ rtecEventPublisher,
+ rtecEventConsumer,
+ nsEventEmitter,
+ nsEventPublisher,
+ nsEventConsumer
};
// To avoid the connection info in the plan being passed to the
@@ -57,6 +66,9 @@ module Deployment
string portName;
CCMComponentPortKind kind;
+ string consumerCompName; // CIAO specific extension
+ string consumerPortName; // CIAO specific extension
+
// the endpoints member is change to endpoint.
// Since we will not have more than 1 objref in there.
Object endpoint;
diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
index 39ce2039c06..7e9d632b5c0 100644
--- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
+++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.cpp
@@ -48,9 +48,9 @@ CIAO::NodeApplication_Impl::finishLaunch (
break;
case Deployment::MultiplexReceptacle:
- comp->connect(providedReference[i].portName.in (),
- providedReference[i].endpoint.in ()
- ACE_ENV_ARG_PARAMETER);
+ comp->connect (providedReference[i].portName.in (),
+ providedReference[i].endpoint.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
break;
@@ -80,9 +80,9 @@ CIAO::NodeApplication_Impl::finishLaunch (
ACE_TRY_CHECK;
if (CORBA::is_nil (consumer.in ()))
- {
- ACE_THROW (Deployment::InvalidConnection ());
- }
+ {
+ ACE_THROW (Deployment::InvalidConnection ());
+ }
comp->subscribe (providedReference[i].portName.in (),
consumer.in ()
@@ -90,8 +90,15 @@ CIAO::NodeApplication_Impl::finishLaunch (
ACE_TRY_CHECK;
break;
- default:
- ACE_TRY_THROW (Deployment::InvalidConnection ());
+ case Deployment::rtecEventEmitter:
+ case Deployment::rtecEventPublisher:
+
+ ACE_DEBUG ((LM_DEBUG, "case CIAO::Assembly_Connection::PUBLISHER_CONSUMER:!!!!\n"));
+ this->build_rtec_connection (providedReference[i]);
+ break;
+
+ default:
+ ACE_TRY_THROW (Deployment::InvalidConnection ());
}
}
if (start)
@@ -543,3 +550,133 @@ parse_config_values (const ::Deployment::Properties & properties,
// the modeling tool will ensure the complete info to presented in the properties.
}
*/
+
+void
+CIAO::NodeApplication_Impl::build_rtec_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "CIAO::NodeApplication_Impl::build_rtec_connection ()!!!\n"));
+
+ // Get the consumer port object reference and put into "consumer"
+ Components::EventConsumerBase_var consumer =
+ Components::EventConsumerBase::_narrow (connection.endpoint.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (consumer.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG, "Nil consumer port object reference\n"));
+ ACE_THROW (Deployment::InvalidConnection ());
+ }
+
+ // Get the consumer component object reference.
+ ACE_CString consumer_comp_name = connection.consumerCompName.in ();
+ Components::CCMObject_ptr sink_objref;
+
+ if (this->component_map_.find (consumer_comp_name, sink_objref) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Nil sink component object reference\n"));
+ ACE_THROW (Deployment::InvalidConnection ());
+ }
+
+ // Get the supplier component object reference.
+ ACE_CString supplier_comp_name = connection.instanceName.in ();
+ Components::CCMObject_ptr source_objref;
+
+ if (this->component_map_.find (supplier_comp_name, source_objref) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Nil source component object reference\n"));
+ ACE_THROW (Deployment::InvalidConnection ());
+ }
+
+ // Get the container event service
+ CIAO::ContainerEventService_var event_service =
+ this->get_event_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (event_service.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG, "Nil event_service\n"));
+ ACE_THROW (Deployment::InvalidConnection ());
+ }
+
+ // Set the event service type.
+ CIAO::EventServiceType type = CIAO::RTEC;
+
+ // supplier ID
+ ACE_CString sid = source_objref->component_UUID (ACE_ENV_SINGLE_ARG_DECL);
+ ACE_CHECK;
+
+ sid += "_";
+ sid += connection.portName.in ();
+ sid += "_publisher";
+
+ // consumer ID
+ ACE_CString cid = sink_objref->component_UUID (ACE_ENV_SINGLE_ARG_DECL);
+ ACE_CHECK;
+
+ cid += "_";
+ cid += connection.consumerPortName.in ();
+ cid += "_consumer";
+
+ ACE_DEBUG ((LM_DEBUG, "Publisher: %s\n", sid.c_str ()));
+ ACE_DEBUG ((LM_DEBUG, "Subscriber: %s\n", cid.c_str ()));
+
+ if (this->connected_publishers_.find (sid) == -1)
+ {
+ CIAO::Supplier_Config_var supplier_config =
+ event_service->create_supplier_config (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_config->supplier_id (sid.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_service->connect_event_supplier (supplier_config.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connected_publishers_.insert (sid);
+
+ supplier_config->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ CIAO::Consumer_Config_var consumer_config =
+ event_service->create_consumer_config (type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_config->supplier_id (sid.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_config->consumer_id (cid.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_config->consumer (consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_service->connect_event_consumer (consumer_config.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_config->destroy (ACE_ENV_SINGLE_ARG_DECL);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "CIAO::NodeApplication_Impl::build_rtec_connection () completed!!!!\n"));
+}
+
+void
+CIAO::NodeApplication_Impl::build_ec_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Deployment::InvalidConnection,
+ CORBA::SystemException))
+{
+
+}
+
+void
+CIAO::NodeApplication_Impl::build_ns_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((Deployment::InvalidConnection,
+ CORBA::SystemException))
+{
+
+}
diff --git a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
index fbd77f8031e..7298437ee63 100644
--- a/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
+++ b/TAO/CIAO/DAnCE/ciao/NodeApplication_Impl.h
@@ -6,7 +6,8 @@
* @Brief This file contains the implementation of
* the NodeApplication interface.
*
- * @auther Tao Lu <lu@dre.vanderbilt.edu>
+ * @author Tao Lu <lu@dre.vanderbilt.edu>
+ * @author Gan Deng <gan.deng@vanderbilt.edu>
*========================================================*/
#ifndef NODEAPPLICATION_IMPL_H
@@ -202,6 +203,29 @@ namespace CIAO
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError));
+ /*------- CIAO helper functions for building event channel connections ------/*
+ *
+ *---------------------------------------------------------------------------*/
+
+ void build_rtec_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((Deployment::InvalidConnection,
+ CORBA::SystemException));
+
+ void build_ec_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((Deployment::InvalidConnection,
+ CORBA::SystemException));
+
+ void build_ns_connection (const Deployment::Connection & connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((Deployment::InvalidConnection,
+ CORBA::SystemException));
+
+ /*---------------------- member varialbe definition -------------------------/*
+ *
+ /*---------------------------------------------------------------------------*/
+
// To store all created CCMHome object
typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
Components::CCMHome_ptr,
@@ -235,6 +259,9 @@ namespace CIAO
// And a reference to the NodeApplicationManager that created us.
::CORBA::Object_var node_app_manager_;
+ // Store the connected publishers.
+ ACE_Unbounded_Set<ACE_CString> connected_publishers_;
+
// Synchronize access to the object set.
// This will be needed in the case when component/home run in different thread
// TAO_SYNCH_MUTEX lock_;
diff --git a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
index 19748b17ed0..a8b6533caf2 100644
--- a/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
+++ b/TAO/CIAO/DAnCE/ciao/Servant_Impl_Base.cpp
@@ -35,7 +35,7 @@ namespace CIAO
safe._retn ();
}
}
-
+
CORBA::Object_ptr
Servant_Impl_Base::lookup_facet (const char *port_name)
{