diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-29 18:39:07 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-03-29 18:39:07 +0000 |
commit | d4b1383b09e0aeb947dfab2f330435607c89ac44 (patch) | |
tree | f85400ffbf611b580c0b875b444a4e2bd37ef768 | |
parent | e686c901d08ce385595ac5a765c1f85f312266b3 (diff) | |
download | ATCD-d4b1383b09e0aeb947dfab2f330435607c89ac44.tar.gz |
.
6 files changed, 150 insertions, 80 deletions
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 7d7ffad9aab..eb86114768b 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -3,7 +3,6 @@ #include "DomainApplicationManager_Impl.h" #include "ExecutionManager/Execution_Manager_Impl.h" #include "ciao/NodeApplicationManagerC.h" -#include "ciao/Deployment_EventsC.h" #include "ace/Null_Mutex.h" #include "ace/OS_NS_string.h" #include "ace/SString.h" @@ -38,7 +37,8 @@ DomainApplicationManager_Impl (CORBA::ORB_ptr orb, // deployment_file_ (CORBA::string_dup (deployment_file)), deployment_config_ (orb), - is_redeployment_ (false) + is_redeployment_ (false), + esd_ (0) { ACE_DECLARE_NEW_CORBA_ENV; ACE_NEW_THROW_EX (this->all_connections_, @@ -49,6 +49,16 @@ DomainApplicationManager_Impl (CORBA::ORB_ptr orb, Deployment::ComponentPlans (), CORBA::NO_MEMORY ()); ACE_CHECK; + + for (CORBA::ULong i = 0; i < this->plan_.infoProperty.length (); ++i) + { + if (ACE_OS::strcmp (this->plan_.infoProperty[i].name.in (), + "CIAOEvents") != 0) + continue; + + this->plan_.infoProperty[0].value >>= this->esd_; + break; + } } CIAO::DomainApplicationManager_Impl::~DomainApplicationManager_Impl () @@ -645,71 +655,50 @@ install_all_es (void) { ACE_TRY { - for (CORBA::ULong i = 0; i < this->plan_.infoProperty.length (); ++i) + for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) { - if (ACE_OS::strcmp (this->plan_.infoProperty[i].name.in (), - "CIAOEvents") != 0) - continue; + // 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 (); - CIAO::DAnCE::EventServiceDeploymentDescriptions_var es = 0; - this->plan_.infoProperty[0].value >>= es; + // Find NA, and then invoke operation on it + ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - for (CORBA::ULong j = 0; j < es->length (); ++j) + if (this->artifact_map_.find (this->esd_[j].node.in (), + entry) != 0) { - // Construct the ESInstallationInfos data - Deployment::ESInstallationInfos_var es_infos; - ACE_NEW (es_infos, - Deployment::ESInstallationInfos); - - es_infos->length (1); - (*es_infos)[0].id = es[j].name.in (); - (*es_infos)[0].type = CIAO::RTEC; //only RTEC is supported so far - (*es_infos)[0].svcconf = es[j].svc_cfg_file.in (); - - // Populate the "filters" info, in case this CIAO_Event_Service has - // one or more filters specified through descriptors - for (CORBA::ULong k = 0; k < es[j].filters.length (); ++k) - { - CORBA::ULong len = (*es_infos)[0].es_config.length (); - (*es_infos)[0].es_config.length (len + 1); - (*es_infos)[0].es_config[len].name = - CORBA::string_dup ("RtecFilter"); - (*es_infos)[0].es_config[len].value <<= es[j].filters; - } + ACE_ERROR ((LM_ERROR, + "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" + "CIAO::DomainApplicationManager_Impl::install_all_es -" + "ERROR while finding the node specific plan " + "for the node [%s] \n", + this->esd_[j].node.in ())); - // Find NA, and then invoke operation on it - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; + ACE_CString error + ("Unable to resolve a reference to NodeManager: "); + error += this->esd_[j].node.in (); - if (this->artifact_map_.find (es[j].node.in (), - entry) != 0) - { - ACE_ERROR ((LM_ERROR, - "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" - "CIAO::DomainApplicationManager_Impl::install_all_es -" - "ERROR while finding the node specific plan " - "for the node [%s] \n", - es[j].node.in ())); - - ACE_CString error - ("Unable to resolve a reference to NodeManager: "); - error += es[j].node.in (); - - ACE_TRY_THROW - (Deployment::StartError - ("DomainApplicationManager_Impl::install_all_es", - error.c_str ())); - } + ACE_TRY_THROW + (Deployment::StartError + ("DomainApplicationManager_Impl::install_all_es", + error.c_str ())); + } - // Invoke install_es () operation on each cached NodeApplication object. - ::Deployment::NodeApplication_ptr my_na = - (entry->int_id_).node_application_.in (); + // Invoke install_es () operation on each cached NodeApplication object. + ::Deployment::NodeApplication_ptr my_na = + (entry->int_id_).node_application_.in (); - ::Deployment::CIAO_Event_Services_var event_services = - my_na->install_es (es_infos); + ::Deployment::CIAO_Event_Services_var event_services = + my_na->install_es (es_infos); - // Add these returned ES objects into the cached map - this->add_es_to_map (es_infos, event_services); - } + // Add these returned ES objects into the cached map + this->add_es_to_map (es_infos, event_services); } } ACE_CATCHANY @@ -1308,8 +1297,13 @@ handle_es_connection ( retv[len].endpointInstanceName = es_id.c_str (); retv[len].endpointPortName = "CIAO_ES"; + // We need to populate the actual filter and store it into + // the <connection.config> field if (binding.deployRequirement.length () != 0) - retv[len].config = binding.deployRequirement[0].property; + { + retv[len].config = + this->get_connection_QoS_configuration (binding.deployRequirement[0]); + } // If we didnt find the objref of the connection ... CIAO::CIAO_Event_Service_var es; @@ -1947,3 +1941,51 @@ subtract_connections (const Deployment::Connections & left, } return retv._retn (); } + +const Deployment::Properties & +CIAO::DomainApplicationManager_Impl:: +get_connection_QoS_configuration (const Deployment::Requirement & requirement) +{ + // Get the name/identifier of the filter associated with + // this connection + Deployment::Properties_var retv; + ACE_NEW_NORETURN (retv, Deployment::Properties); + + CORBA::ULong len = retv->length (); + + for (CORBA::ULong i = 0; + i < requirement.property.length (); + ++i) + { + const char *filter_name; + if (ACE_OS::strcmp ("EventFilter", + requirement.property[i].name) == 0) + { + + if ((requirement.property[i].value >>= filter_name) == false) + ACE_ERROR ((LM_ERROR, + "ERROR: DomainApplicationManager_Impl::" + "get_connection_QoS_configuration unable to " + "extract event filter information\n")); + } + + // Search for the desired filter + for (CORBA::ULong j = 0; j < this->esd_->length (); ++j) + { + // Populate the "filters" info, in case this CIAO_Event_Service has + // one or more filters specified through descriptors + for (CORBA::ULong k = 0; k < this->esd_[j].filters.length (); ++k) + { + if (ACE_OS::strcmp (this->esd_[j].filters[k].name.in (), + filter_name) == 0) + { + retv->length (len + 1); + retv[len].name = CORBA::string_dup ("EventFilter"); + retv[len].value <<= this->esd_[j].filters[k]; + break; + } + } + } + } + return retv.inout (); +} diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h index 3c38d573ffe..384b509fc51 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h @@ -37,6 +37,7 @@ #include "Deployment_Configuration.h" #include "DomainApplicationManager_Export.h" #include "ciao/CIAO_common.h" +#include "ciao/Deployment_EventsC.h" namespace CIAO { @@ -388,6 +389,16 @@ namespace CIAO Deployment::CIAO_Event_Services * event_services) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError)); + + /** + * Get the actual event connection QoS properties based on the + * deployment requirement. The deployment requirement only specifies + * an identifier/reference to the EventServiceDeploymentDescriptions. + */ + virtual const Deployment::Properties & + get_connection_QoS_configuration ( + const Deployment::Requirement & requirement); + protected: /// location of the Domainapplication CORBA::String_var domainapp_path_; @@ -471,6 +482,9 @@ namespace CIAO /// member function implementations. The reason is because we want /// to avoid unnecessary code duplicate. The default value is "false". bool is_redeployment_; + + /// Cache the CIAO_Event_Service deployment description + CIAO::DAnCE::EventServiceDeploymentDescriptions_var esd_; }; } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index af82e965d4e..0308297b012 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -550,7 +550,6 @@ ACE_THROW_SPEC ((::CORBA::SystemException, for (CORBA::ULong i = 0; i < total_lenth; ++i) { CIAO_Event_Service_var temp = - //es_factory_.create (CIAO::DIRECT); es_factory_.create (es_infos[i].type); CORBA::ULong curr_len = retv->length (); @@ -574,7 +573,10 @@ create_connection_key (const Deployment::Connection & connection) (*retv) += connection.portName.in (); (*retv) += connection.endpointInstanceName.in (); (*retv) += connection.endpointPortName.in (); - ACE_DEBUG ((LM_ERROR, "The key is: %s\n", (*retv).c_str ())); + if (CIAO::debug_level () > 11) + { + ACE_DEBUG ((LM_ERROR, "The key is: %s\n", (*retv).c_str ())); + } return retv; } @@ -607,7 +609,7 @@ handle_facet_receptable_connection ( ACE_TRY_CHECK; ACE_CString key = (*create_connection_key (connection)); - if (CIAO::debug_level () > 6) + if (CIAO::debug_level () > 10) { ACE_DEBUG ((LM_ERROR, "[BINDING KEY]: %s\n", key.c_str ())); } @@ -995,7 +997,7 @@ handle_es_consumer_connection ( for (CORBA::ULong i = 0; i < connection.config.length (); ++i) { if (ACE_OS::strcmp (connection.config[i].name.in (), - "RtecFilter") != 0) + "EventFilter") != 0) continue; // Extract the filter information diff --git a/TAO/CIAO/ciao/Deployment_Core.idl b/TAO/CIAO/ciao/Deployment_Core.idl index 7cf55574ab0..bf6212e0d2f 100644 --- a/TAO/CIAO/ciao/Deployment_Core.idl +++ b/TAO/CIAO/ciao/Deployment_Core.idl @@ -224,7 +224,7 @@ module Deployment string id; CIAO::EventServiceType type; string svcconf; - Properties es_config; + //Properties es_config; }; /// CIAO specific extension diff --git a/TAO/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp b/TAO/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp index e59abbe37ef..d9d081c2222 100644 --- a/TAO/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp +++ b/TAO/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent.cpp @@ -12,6 +12,7 @@ //============================================================================= #include "CIAO_RTEvent.h" +#include "ciao/CIAO_common.h" namespace CIAO { @@ -76,7 +77,10 @@ namespace CIAO ACE_CHECK; this->type_id_ = this->source_id_; - ACE_DEBUG ((LM_DEBUG, "connect source id: %i\n", this->source_id_)); + if (CIAO::debug_level () > 11) + { + ACE_DEBUG ((LM_DEBUG, "connect source id: %i\n", this->source_id_)); + } RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = this->rt_event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -341,7 +345,11 @@ namespace CIAO ACE_THROW_SPEC (( CORBA::SystemException)) { - ACE_DEBUG ((LM_DEBUG, "supplier's id: %s\n", supplier_id)); + if (CIAO::debug_level () > 11) + { + ACE_DEBUG ((LM_DEBUG, "supplier's id: %s\n", supplier_id)); + + } this->supplier_id_ = supplier_id; @@ -349,8 +357,6 @@ namespace CIAO RtecEventComm::EventSourceID source_id = hasher (this->supplier_id_.c_str ()); - ACE_DEBUG ((LM_DEBUG, "supplier's source id: %i\n", source_id)); - this->qos_.insert (source_id, source_id, 0, diff --git a/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_with_filters.cdp b/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_with_filters.cdp index 2c1cda47015..9ad178d6dfc 100644 --- a/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_with_filters.cdp +++ b/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_with_filters.cdp @@ -163,6 +163,24 @@ <connection> <name>hello_event_ec_consumer_connection</name> + + <!-- The position of the below "deployRequirement" element matters --> + <deployRequirement> + <resourceType>EventFilter</resourceType> + <name>my_filter_01</name> + <property> + <name>EventFilter</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>my_filter</string> + </value> + </value> + </property> + </deployRequirement> + <internalEndpoint> <portName>click_in</portName> <kind>rtecEventConsumer</kind> @@ -171,18 +189,6 @@ <externalReference> <location>ES_01</location> </externalReference> - <deployRequirement> - <name>filter</name> - <value> - <type> - <kind>tk_string</kind> - </type> - <value> - <string>my_filter</string> - </value> - </value> - </deployRequirement> - </connection> <!-- @@ Runtime library name must match exactly in "location" tag --> |