summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-10-11 03:00:39 +0000
committerdengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-10-11 03:00:39 +0000
commitb7fc7ff2a014d18787e1088cd5918746f71852fc (patch)
treeb879486c5467a5373b5744bd7806329afde91672
parent0f03d1c15caca953f26943fe12d3caea1c89820e (diff)
downloadATCD-b7fc7ff2a014d18787e1088cd5918746f71852fc.tar.gz
Enhanced NodeApplication to support EC federation.
Refactored several IDL files to reuse the EventServiceType defined in the CIAO_Events.idl.
-rw-r--r--DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp18
-rw-r--r--DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h2
-rw-r--r--DAnCE/NodeApplication/NodeApplication_Impl.cpp40
-rw-r--r--DAnCE/NodeApplication/NodeApplication_Impl.h4
-rw-r--r--ciao/Deployment_Core.idl7
-rw-r--r--ciao/Deployment_Events.idl12
-rw-r--r--ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl1
-rw-r--r--ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl2
-rw-r--r--ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp33
-rw-r--r--ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h26
10 files changed, 110 insertions, 35 deletions
diff --git a/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
index 00b5431faec..db82a68dfcd 100644
--- a/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
+++ b/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp
@@ -670,16 +670,6 @@ install_all_es (void)
{
for (CORBA::ULong j = 0; j < this->esd_->length (); ++j)
{
- // Construct the ESInstallationInfos data
- Deployment::ESInstallationInfos_var es_infos;
- ACE_NEW (es_infos,
- Deployment::ESInstallationInfos);
-
- es_infos->length (1);
- (*es_infos)[0].id = this->esd_[j].name.in ();
- (*es_infos)[0].type = CIAO::RTEC; //only RTEC is supported so far
- (*es_infos)[0].svcconf = this->esd_[j].svc_cfg_file.in ();
-
// Find NA, and then invoke operation on it
ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0;
@@ -708,10 +698,10 @@ install_all_es (void)
(entry->int_id_).node_application_.in ();
::Deployment::CIAO_Event_Services_var event_services =
- my_na->install_es (es_infos);
+ my_na->install_es (this->esd_.in ());
// Add these returned ES objects into the cached map
- this->add_es_to_map (es_infos, event_services);
+ this->add_es_to_map (this->esd_, event_services);
}
}
ACE_CATCHANY
@@ -727,7 +717,7 @@ install_all_es (void)
void
CIAO::DomainApplicationManager_Impl::
-add_es_to_map (Deployment::ESInstallationInfos * es_infos,
+add_es_to_map (DAnCE::EventServiceDeploymentDescriptions * es_infos,
Deployment::CIAO_Event_Services * event_services)
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError))
@@ -739,7 +729,7 @@ add_es_to_map (Deployment::ESInstallationInfos * es_infos,
for (CORBA::ULong i = 0; i < es_length; ++i)
{
this->es_map_.bind (
- (*es_infos)[i].id.in (),
+ (*es_infos)[i].name.in (),
CIAO::CIAO_Event_Service::_duplicate ((*event_services)[i]));
}
}
diff --git a/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
index ee2ae518e86..96e11649c46 100644
--- a/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
+++ b/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h
@@ -398,7 +398,7 @@ namespace CIAO
* Add all CIAO_Event_Service objects into the cached map.
*/
virtual void
- add_es_to_map (Deployment::ESInstallationInfos * es_infos,
+ add_es_to_map (DAnCE::EventServiceDeploymentDescriptions * es_infos,
Deployment::CIAO_Event_Services * event_services)
ACE_THROW_SPEC ((CORBA::SystemException,
Deployment::StartError));
diff --git a/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/DAnCE/NodeApplication/NodeApplication_Impl.cpp
index db02fbf40f5..be10f420434 100644
--- a/DAnCE/NodeApplication/NodeApplication_Impl.cpp
+++ b/DAnCE/NodeApplication/NodeApplication_Impl.cpp
@@ -4,6 +4,7 @@
#include "ace/SString.h"
#include "Container_Impl.h"
#include "Deployment_EventsC.h"
+#include "ciaosvcs/Events/CIAO_RTEC/CIAO_RTEventC.h"
#if !defined (__ACE_INLINE__)
# include "NodeApplication_Impl.inl"
@@ -611,7 +612,7 @@ CIAO::NodeApplication_Impl::get_containers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
::Deployment::CIAO_Event_Services *
CIAO::NodeApplication_Impl::
-install_es (const ::Deployment::ESInstallationInfos & es_infos
+install_es (const ::CIAO::DAnCE::EventServiceDeploymentDescriptions & es_infos
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((::CORBA::SystemException,
::Deployment::InstallationFailure))
@@ -621,18 +622,47 @@ ACE_THROW_SPEC ((::CORBA::SystemException,
Deployment::CIAO_Event_Services,
0);
- CORBA::ULong total_lenth = es_infos.length ();
+ CORBA::ULong es_len = es_infos.length ();
- for (CORBA::ULong i = 0; i < total_lenth; ++i)
+ for (CORBA::ULong i = 0; i < es_len; ++i)
{
- CIAO_Event_Service_var temp =
+ CIAO_Event_Service_var ciao_es =
es_factory_.create (es_infos[i].type);
+ // Set up the event channel federation configurations
+ if (es_infos[i].type == CIAO::RTEC)
+ {
+ // Narrow the event service to CIAO_RT_Event_Service
+ ::CIAO::CIAO_RT_Event_Service_var ciao_rtes =
+ ::CIAO::CIAO_RT_Event_Service::_narrow (ciao_es);
+
+ if (CORBA::is_nil (ciao_rtes.in ()))
+ ACE_THROW ((::Deployment::InstallationFailure ()));
+
+ // Set up the event channel federations
+ for (CORBA::ULong j = 0; j < es_infos[i].addr_srvs.length (); ++j)
+ ciao_rtes->create_addr_serv (
+ es_infos[i].addr_srvs[j].name.in (),
+ es_infos[i].addr_srvs[j].port,
+ es_infos[i].addr_srvs[j].address);
+
+ for (CORBA::ULong j = 0; j < es_infos[i].senders.length (); ++j)
+ ciao_rtes->create_sender (
+ es_infos[i].senders[j].addr_serv_id.in ());
+
+ for (CORBA::ULong j = 0; j < es_infos[i].receivers.length (); ++j)
+ ciao_rtes->create_receiver (
+ es_infos[i].receivers[j].addr_serv_id.in (),
+ es_infos[i].receivers[j].is_multicast,
+ es_infos[i].receivers[j].listen_port);
+
+ }
+
CORBA::ULong curr_len = retv->length ();
retv->length (curr_len + 1);
retv[curr_len] =
- CIAO::CIAO_Event_Service::_duplicate (temp.in ());
+ CIAO::CIAO_Event_Service::_duplicate (ciao_es.in ());
}
return retv._retn ();
}
diff --git a/DAnCE/NodeApplication/NodeApplication_Impl.h b/DAnCE/NodeApplication/NodeApplication_Impl.h
index ee1878ff07d..b91beeecbc3 100644
--- a/DAnCE/NodeApplication/NodeApplication_Impl.h
+++ b/DAnCE/NodeApplication/NodeApplication_Impl.h
@@ -158,7 +158,7 @@ namespace CIAO
/// Install a number of CIAO_Event_Service objects within the NA
virtual ::Deployment::CIAO_Event_Services *
- install_es (const ::Deployment::ESInstallationInfos & es_infos
+ install_es (const ::CIAO::DAnCE::EventServiceDeploymentDescriptions & es_infos
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((::CORBA::SystemException,
::Deployment::InstallationFailure));
@@ -375,7 +375,7 @@ namespace CIAO
/// Cache the (NA specific) installation info of all the
/// CIAO_Event_Services
typedef ACE_Hash_Map_Manager_Ex<ACE_CString,
- ::Deployment::ESInstallationInfos_var,
+ DAnCE::EventServiceDeploymentDescriptions_var,
ACE_Hash<ACE_CString>,
ACE_Equal_To<ACE_CString>,
ACE_Null_Mutex> ES_Installation_Map;
diff --git a/ciao/Deployment_Core.idl b/ciao/Deployment_Core.idl
index 56e1c7aceea..c859de1e24b 100644
--- a/ciao/Deployment_Core.idl
+++ b/ciao/Deployment_Core.idl
@@ -4,7 +4,7 @@
#define DEPLOYMENT_CORE_IDL
#include "CCM_Component.idl"
-#include <ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl>
+#include "Deployment_Events.idl"
// *************** Packaging and Deployment ***************
module Deployment
@@ -207,6 +207,7 @@ module Deployment
typedef sequence<Container> Containers;
typedef sequence<CIAO::CIAO_Event_Service> CIAO_Event_Services;
+ /*
/// CIAO specific extension
/// This struct captures the installation information of a particular
/// CIAO_Event_Service, as defined in <ciaosvcs/Events/CIAO_Events.idl>
@@ -220,6 +221,7 @@ module Deployment
/// CIAO specific extension
typedef sequence<ESInstallationInfo> ESInstallationInfos;
+ */
interface NodeApplication : Application
{
@@ -246,7 +248,8 @@ module Deployment
/// This operation will create one or more CIAO_Event_Service objects
/// within the NodeApplication, which will be used to mediate the
/// communication of CCM events
- CIAO_Event_Services install_es (in ESInstallationInfos es_infos)
+ CIAO_Event_Services install_es (
+ in CIAO::DAnCE::EventServiceDeploymentDescriptions es_infos)
raises (InstallationFailure);
/// CIAO specific extensions
diff --git a/ciao/Deployment_Events.idl b/ciao/Deployment_Events.idl
index de5e5a6a646..37aa6d6e58e 100644
--- a/ciao/Deployment_Events.idl
+++ b/ciao/Deployment_Events.idl
@@ -13,19 +13,13 @@
#include <orb.idl>
+// EventServiceType definition
+#include <ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl>
+
module CIAO
{
module DAnCE
{
- /// CIAO specific extension to describe pub/sub services in the deployment
- enum EventServiceType
- {
- EC,
- RTEC,
- NOTIFY,
- RTNOTIFY
- };
-
/// Each element in the EventSourceSet denotes a event source id
typedef string EventSourceId;
diff --git a/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl b/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl
index 20f540b69ed..49393ede7a4 100644
--- a/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl
+++ b/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events.idl
@@ -18,7 +18,6 @@ module CIAO
enum EventServiceType
{
- DIRECT,
EC,
RTEC,
NOTIFY,
diff --git a/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl b/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl
index a3c5d3c5eca..8cf3fcb5947 100644
--- a/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl
+++ b/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.idl
@@ -35,7 +35,7 @@ module CIAO
readonly attribute RtecEventChannelAdmin::SupplierQOS rt_event_qos;
};
- interface CIAO_RT_Evnet_Service :
+ interface CIAO_RT_Event_Service :
CIAO_Event_Service
{
boolean create_addr_serv (in string name,
diff --git a/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp b/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp
new file mode 100644
index 00000000000..b514413d982
--- /dev/null
+++ b/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.cpp
@@ -0,0 +1,33 @@
+// SimpleAddressServer.cpp
+
+#include "SimpleAddressServer.h"
+#include <ace/INET_Addr.h>
+#include <ace/OS_NS_string.h>
+
+SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) {
+ this->address_.ipaddr = address.get_ip_address ();
+ this->address_.port = address.get_port_number ();
+}
+
+void
+SimpleAddressServer::get_addr (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Addr& address)
+ throw (CORBA::SystemException) {
+ address = this->address_;
+}
+/*
+void
+SimpleAddressServer::get_ip_address (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_IP_Address_out address
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException) {
+ address = new RtecUDPAdmin::UDP_IP_Address;
+
+ ACE_INET_Addr x (this->address_.port,
+ static_cast<ACE_UINT32>(this->address_.ipaddr));
+ address->length (x.get_addr_size ());
+ ACE_OS::memcpy (address->get_buffer (),
+ x.get_addr (),
+ x.get_addr_size ());
+}
+*/
diff --git a/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h b/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h
new file mode 100644
index 00000000000..4aea1678b7c
--- /dev/null
+++ b/ciaosvcs/Events/CIAO_RTEC/SimpleAddressServer.h
@@ -0,0 +1,26 @@
+// SimpleAddressServer.h
+
+#ifndef SIMPLEADDRESSSERVER_H
+#define SIMPLEADDRESSSERVER_H
+
+#include <orbsvcs/RtecUDPAdminS.h>
+
+class ACE_INET_Addr;
+
+class SimpleAddressServer : public POA_RtecUDPAdmin::AddrServer {
+public:
+ SimpleAddressServer (const ACE_INET_Addr& address);
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr& address)
+ throw (CORBA::SystemException);
+/*
+ virtual void get_ip_address (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_IP_Address_out address
+ ACE_ENV_ARG_DECL)
+ throw (CORBA::SystemException);
+*/
+private:
+ RtecUDPAdmin::UDP_Addr address_;
+};
+
+#endif