From 14c7083790394dde849d0562426944a419c8c1f9 Mon Sep 17 00:00:00 2001 From: dengg Date: Thu, 20 Apr 2006 01:47:42 +0000 Subject: Thu Apr 20 01:40:11 UTC 2006 Gan Deng --- TAO/CIAO/ChangeLog | 13 +++++ .../DomainApplicationManager_Impl.cpp | 45 +++++----------- .../DAnCE/NodeApplication/NodeApplication_Impl.cpp | 60 ++++++++++++++-------- .../DAnCE/NodeApplication/NodeApplication_Impl.h | 6 +++ .../flattened_deploymentplan_events.cdp | 25 ++++++++- TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp | 26 ++++++++-- TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp | 13 ----- 7 files changed, 116 insertions(+), 72 deletions(-) diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 9465042d8bb..71d77e2f0e5 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,16 @@ +Thu Apr 20 01:40:11 UTC 2006 Gan Deng + + * ciao/Deployment_Core.idl + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp + * DAnCE/NodeApplication/NodeApplication_Impl.cpp + * DAnCE/NodeApplication/NodeApplication_Impl.h + * examples/Hello/descriptors_events/flattened_deploymentplan_events.cdp + * tools/Config_Handlers/DP_Handler.cpp + * tools/Config_Handlers/PSPE_Handler.cpp + + Reverted CCMComponentPortKind definition back to spec defined + data type. + Thu Apr 13 13:43:19 UTC 2006 William R. Otte * First cut integration point. diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 0a501d506df..71a0f2fdd2c 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -60,6 +60,8 @@ DomainApplicationManager_Impl (CORBA::ORB_ptr orb, "CIAOEvents") != 0) continue; + // Note, we should do a sanity check here to make + // sure we didn't pick up the wrong infoProperty!! this->plan_.infoProperty[0].value >>= this->esd_; break; } @@ -703,7 +705,7 @@ install_all_es (void) // 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); @@ -916,7 +918,7 @@ finishLaunch (CORBA::Boolean start, { if (CORBA::is_nil (entry->int_id_.node_application_.in ())) throw Deployment::StartError (); - + entry->int_id_.node_application_->finishLaunch (*unnecessary_connections, start, @@ -1240,25 +1242,14 @@ populate_connection_for_binding ( { const CORBA::ULong binding_len = binding.internalEndpoint.length (); + // If only 1 internalEndpoint, then we know it's through event service. 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; - } + return + this->handle_es_connection (instname, + binding, + plan, + retv); } else if (binding_len == 2) { @@ -1338,7 +1329,9 @@ handle_es_connection ( retv[len].event_service = es._retn (); // One more thing needs to be done if this is a es_consumer connection - if (endpoint.kind == Deployment::rtecEventConsumer) + // We need to populate the field of this connection, which + // is the object reference of this event consumer port. + if (endpoint.kind == Deployment::EventConsumer) { // Now we search in the received connections to get the objRef of event sink bool found = false; @@ -1463,7 +1456,7 @@ handle_direct_connection ( false); } break; - } + } } return true; } @@ -1888,16 +1881,6 @@ dump_connections (const ::Deployment::Connections & connections) ACE_DEBUG ((LM_DEBUG, "EventConsumer\n")); break; - case Deployment::rtecEventPublisher: - - ACE_DEBUG ((LM_DEBUG, "rtecEventPublisher\n")); - break; - - case Deployment::rtecEventConsumer: - - ACE_DEBUG ((LM_DEBUG, "rtecEventConsumer\n")); - break; - default: ACE_DEBUG ((LM_DEBUG, "Unknown port kind.\n")); } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index 028e522c7cb..5edb7a51b3a 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -95,7 +95,8 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( // For ES_to_Consumer connection, we simply call // handle_es_consumer_connection method. - if (connections[i].kind == Deployment::rtecEventConsumer) + //if (connections[i].kind == Deployment::rtecEventConsumer) + if (this->_is_es_consumer_conn (connections[i])) { this->handle_es_consumer_connection ( connections[i], @@ -121,7 +122,7 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( Components::EventConsumerBase_var consumer; Components::CCMObject_var comp = comp_state.objref_; - + if (CORBA::is_nil (comp.in ())) { ACE_DEBUG ((LM_DEBUG, "comp is nil\n")); @@ -146,23 +147,16 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( break; case Deployment::EventPublisher: - this->handle_publisher_consumer_connection ( - comp.in (), - connections[i], - add_connection); - break; - - case Deployment::rtecEventPublisher: - this->handle_publisher_es_connection ( - comp.in (), - connections[i], - add_connection); - break; - - case Deployment::rtecEventConsumer: - this->handle_es_consumer_connection ( - connections[i], - add_connection); + if (this->_is_publisher_es_conn (connections[i])) + this->handle_publisher_es_connection ( + comp.in (), + connections[i], + add_connection); + else + this->handle_publisher_consumer_connection ( + comp.in (), + connections[i], + add_connection); break; default: @@ -922,7 +916,7 @@ handle_publisher_es_connection ( ACE_THROW_SPEC ((CORBA::SystemException, Deployment::InvalidConnection)) { - if (connection.kind != Deployment::rtecEventPublisher) + if (! this->_is_publisher_es_conn (connection)) { ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) - NodeApplication_Impl.cpp, " @@ -1018,7 +1012,7 @@ handle_es_consumer_connection ( ACE_THROW_SPEC ((CORBA::SystemException, Deployment::InvalidConnection)) { - if (connection.kind != Deployment::rtecEventConsumer) + if (! this->_is_es_consumer_conn (connection)) { ACE_DEBUG ((LM_DEBUG, "CIAO (%P|%t) - NodeApplication_Impl.cpp, " @@ -1091,7 +1085,7 @@ handle_es_consumer_connection ( for (CORBA::ULong j = 0; j < size; ++j) { - consumer_config->insert_source ((*filter).sources[j].in ()); + consumer_config->insert_source ((*filter).sources[j]); } } @@ -1240,3 +1234,25 @@ CIAO::NodeApplication_Impl::build_event_connection ( ACE_DEBUG ((LM_DEBUG, "CIAO::NodeApplication_Impl::build_connection () completed!!!!\n")); } + +bool +CIAO::NodeApplication_Impl:: +_is_es_consumer_conn (Deployment::Connection conn) +{ + if (conn.kind == Deployment::EventConsumer && + ACE_OS::strcmp (conn.endpointPortName, "CIAO_ES") == 0) + return true; + else + return false; +} + +bool +CIAO::NodeApplication_Impl:: +_is_publisher_es_conn (Deployment::Connection conn) +{ + if (conn.kind == Deployment::EventPublisher && + ACE_OS::strcmp (conn.endpointPortName, "CIAO_ES") == 0) + return true; + else + return false; +} diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h index d1c14c43baa..d86974df468 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h @@ -279,6 +279,12 @@ namespace CIAO ACE_THROW_SPEC ((CORBA::SystemException, Deployment::InvalidConnection)); + virtual bool + _is_es_consumer_conn (Deployment::Connection conn); + + virtual bool + _is_publisher_es_conn (Deployment::Connection conn); + /// Register the publisher to the CIAO event service /// The only fields of struct used in this method /// are: , , , . diff --git a/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_events.cdp b/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_events.cdp index b2c75e78c02..526d9552628 100644 --- a/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_events.cdp +++ b/TAO/CIAO/examples/Hello/descriptors_events/flattened_deploymentplan_events.cdp @@ -151,9 +151,27 @@ hello_event_ec_publisher_connection + + + + ciao::rtec + dummy + + dummy + + + tk_string + + + dummy + + + + + click_out - rtecEventPublisher + EventPublisher Hello-Sender-idd @@ -163,9 +181,12 @@ hello_event_ec_consumer_connection + + + click_in - rtecEventConsumer + EventConsumer Hello-Receiver-idd diff --git a/TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp index 5737e682eb8..833bb0d645d 100644 --- a/TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp +++ b/TAO/CIAO/tools/Config_Handlers/DP_Handler.cpp @@ -140,10 +140,7 @@ ACE_RCSID (Config_Handlers, this->idl_dp_->infoProperty.length (len + 1); - if (pstart->name () != "CIAOServerResources") - Property_Handler::get_property (*pstart, - this->idl_dp_->infoProperty [len]); - else + if (pstart->name () == "CIAOServerResources") { /* * Hook for RT-CCM @@ -160,6 +157,27 @@ ACE_RCSID (Config_Handlers, this->idl_dp_->infoProperty [len].name = pstart->name ().c_str (); this->idl_dp_->infoProperty [len].value <<= *(srd_handler.srd_idl ()); } + else if (pstart->name () == "CIAOEvents") + { + /* + * Hook for EVENTS + */ + + ACE_DEBUG ((LM_DEBUG, + "Importing CIAOEvents...\n")); + + // Parse the SR document + CIAOEvents_Handler event_handler (pstart->value ().value ().begin_string ()->c_str ()); + + // Populate the property + this->idl_dp_->infoProperty [len].name = pstart->name ().c_str (); + this->idl_dp_->infoProperty [len].value <<= *(event_handler.esd_idl ()); + } + else + { + Property_Handler::get_property (*pstart, + this->idl_dp_->infoProperty [len]); + } } // Read in the realizes, if present if (xsc_dp.realizes_p ()) diff --git a/TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp index 4df8b9cb92c..d18285c8b12 100644 --- a/TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp +++ b/TAO/CIAO/tools/Config_Handlers/PSPE_Handler.cpp @@ -133,19 +133,6 @@ namespace CIAO case ::Deployment::EventConsumer: pspe.kind (CCMComponentPortKind::EventConsumer); break; - - case ::Deployment::ecEventEmitter: - case ::Deployment::ecEventPublisher: - case ::Deployment::ecEventConsumer: - case ::Deployment::rtecEventEmitter: - case ::Deployment::rtecEventPublisher: - case ::Deployment::rtecEventConsumer: - case ::Deployment::nsEventEmitter: - case ::Deployment::nsEventPublisher: - case ::Deployment::nsEventConsumer: - ACE_ERROR ((LM_ERROR, "Unsupported PortKind\n")); - break; - } -- cgit v1.2.1