diff options
author | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-10-31 08:04:36 +0000 |
---|---|---|
committer | edwardgt <edwardgt@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-10-31 08:04:36 +0000 |
commit | 441c79edcbf7a53148e85bdc1b89314d6418dc72 (patch) | |
tree | 54f49bf77b264996dccc9bba8af4fd5f4b088726 | |
parent | 15b6b8d705149e460ceffea3a67132d54ea4653f (diff) | |
download | ATCD-441c79edcbf7a53148e85bdc1b89314d6418dc72.tar.gz |
ChangeLogTag: Fri Oct 31 02:00:56 2003 George Edwards <g.edwards@vanderbilt.edu>
-rw-r--r-- | TAO/CIAO/ChangeLog_EC | 109 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_CosNotify.cpp | 32 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_CosNotify.h | 28 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_DirectEvent.cpp | 51 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_DirectEvent.h | 26 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_EventService_Factory_impl.cpp | 34 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_Events.idl | 20 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_RTEvent.cpp | 100 | ||||
-rw-r--r-- | TAO/CIAO/ciao/CIAO_RTEvent.h | 38 | ||||
-rw-r--r-- | TAO/CIAO/ciao/Container_Base.cpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl | 2 | ||||
-rw-r--r-- | TAO/CIAO/tools/Assembly_Deployer/Assembly_Impl.cpp | 22 |
13 files changed, 287 insertions, 179 deletions
diff --git a/TAO/CIAO/ChangeLog_EC b/TAO/CIAO/ChangeLog_EC index 3eeecfb11fc..878c73c33ef 100644 --- a/TAO/CIAO/ChangeLog_EC +++ b/TAO/CIAO/ChangeLog_EC @@ -1,3 +1,23 @@ +Fri Oct 31 02:00:56 2003 George Edwards <g.edwards@vanderbilt.edu> + + * ChangeLog_EC + * ciao/CIAO_CosNotify.cpp + * ciao/CIAO_CosNotify.h + * ciao/CIAO_DirectEvent.cpp + * ciao/CIAO_DirectEvent.h + * ciao/CIAO_EventService_Factory_impl.cpp + * ciao/CIAO_Events.idl + * ciao/CIAO_RTEvent.cpp + * ciao/CIAO_RTEvent.h + * ciao/Container_Base.cpp + * examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.cpp + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.h + * tools/Assembly_Deployer/Assembly_Impl.cpp + + Fixed reference counting bugs. + Mon Oct 20 12:21:11 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * ciao/CIAO_CosNotify.cpp: @@ -17,16 +37,17 @@ Sat Oct 18 14:19:56 2003 George Edwards <g.edwards@vanderbilt.edu> * ciao/CIAO_CosNotify.idl * ciao/CIAO_DirectEvent.cpp -//@@ George, could you please add the path to the following files? - * CIAO_DirectEvent.h - * CIAO_DirectEvent.idl - * CIAO_EventServiceBase.h - * CIAO_EventService_Factory.cpp - * CIAO_EventService_Factory.h - * CIAO_EventService_Factory_impl.cpp - * CIAO_EventService_Factory_impl.h - * CIAO_Events_Export.h - * CIAO_RTEvent.cpp CIAO_RTEvent.h CIAO_RTEvent.idl + * ciao/CIAO_DirectEvent.h + * ciao/CIAO_DirectEvent.idl + * ciao/CIAO_EventServiceBase.h + * ciao/CIAO_EventService_Factory.cpp + * ciao/CIAO_EventService_Factory.h + * ciao/CIAO_EventService_Factory_impl.cpp + * ciao/CIAO_EventService_Factory_impl.h + * ciao/CIAO_Events_Export.h + * ciao/CIAO_RTEvent.cpp + * ciao/CIAO_RTEvent.h + * ciao/CIAO_RTEvent.idl Added event service factory to dynamically create event service objects, provided via ACE dynamic service. Changed UUID to string @@ -34,18 +55,19 @@ Sat Oct 18 14:19:56 2003 George Edwards <g.edwards@vanderbilt.edu> into the event service objects. Modified files: - * CCM_Component.idl - * CCM_Core.mpc - * CCM_Deployment.idl - * CIAO_Events.idl - * ComponentInstallation_Impl.h - * ComponentServer_Impl.h - * Container_Base.cpp - * Container_Base.h - * Container_Base.inl - * Container_Impl.h - * Container_Impl.inl - * Cookies.h + + * ciao/CCM_Component.idl + * ciao/CCM_Core.mpc + * ciao/CCM_Deployment.idl + * ciao/CIAO_Events.idl + * ciao/ComponentInstallation_Impl.h + * ciao/ComponentServer_Impl.h + * ciao/Container_Base.cpp + * ciao/Container_Base.h + * ciao/Container_Base.inl + * ciao/Container_Impl.h + * ciao/Container_Impl.inl + * ciao/Cookies.h Changed container to dynamically link event service libraries. Added new CIAO_Events project. Added method to @@ -53,30 +75,30 @@ Sat Oct 18 14:19:56 2003 George Edwards <g.edwards@vanderbilt.edu> events interface. Removed map of EventServiceInfo structs from CIAO::Container. Added a UUID attribute to CCM_Object. - * Assembly_Deployer/Assembly_Impl.cpp - * Assembly_Deployer/Assembly_Impl.h - * Assembly_Deployer/Assembly_Visitors.cpp - * Assembly_Deployer/Assembly_Visitors.h - * XML_Helpers/Assembly_Handlers.cpp - * XML_Helpers/Assembly_Spec.h - * XML_Helpers/Assembly_Spec.inl + * tools/Assembly_Deployer/Assembly_Impl.cpp + * tools/Assembly_Deployer/Assembly_Impl.h + * tools/Assembly_Deployer/Assembly_Visitors.cpp + * tools/Assembly_Deployer/Assembly_Visitors.h + * tools/XML_Helpers/Assembly_Handlers.cpp + * tools/XML_Helpers/Assembly_Spec.h + * tools/XML_Helpers/Assembly_Spec.inl Moved glue code that establishes events connections into the Deployer. Added a map of container references to CIAO::Assembly_Context. - * handcrafted/BasicSP_EC/BMClosedED/BMClosedEDE.idl - * handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp - * handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.h - * handcrafted/BasicSP_EC/BMDevice/BMDeviceE.idl - * handcrafted/BasicSP_EC/BMDevice/BMDevice_svnt.cpp - * handcrafted/BasicSP_EC/BMDevice/BMDevice_svnt.h - * handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl - * handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.cpp - * handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.h - * handcrafted/BasicSP_EC/EC/ECE.idl - * handcrafted/BasicSP_EC/EC/EC_svnt.cpp - * handcrafted/BasicSP_EC/EC/EC_svnt.h + * examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedEDE.idl + * examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp + * examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.h + * examples/handcrafted/BasicSP_EC/BMDevice/BMDeviceE.idl + * examples/handcrafted/BasicSP_EC/BMDevice/BMDevice_svnt.cpp + * examples/handcrafted/BasicSP_EC/BMDevice/BMDevice_svnt.h + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.cpp + * examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplay_svnt.h + * examples/handcrafted/BasicSP_EC/EC/ECE.idl + * examples/handcrafted/BasicSP_EC/EC/EC_svnt.cpp + * examples/handcrafted/BasicSP_EC/EC/EC_svnt.h Added a UUID attribute to CCM_Object. Moved glue code that establishes events connections into the Deployer. Changed @@ -84,8 +106,9 @@ Sat Oct 18 14:19:56 2003 George Edwards <g.edwards@vanderbilt.edu> appended. Removed files: - * CIAO_Events.cpp - * CIAO_Events.h + + * ciao/CIAO_Events.cpp + * ciao/CIAO_Events.h Broke these files apart into one file per service. diff --git a/TAO/CIAO/ciao/CIAO_CosNotify.cpp b/TAO/CIAO/ciao/CIAO_CosNotify.cpp index fb79da38dc0..7c16291da37 100644 --- a/TAO/CIAO/ciao/CIAO_CosNotify.cpp +++ b/TAO/CIAO/ciao/CIAO_CosNotify.cpp @@ -337,8 +337,9 @@ namespace CIAO { } - CosNotify_Consumer_Config_impl::CosNotify_Consumer_Config_impl () : - service_type_ (NOTIFY) + CosNotify_Consumer_Config_impl::CosNotify_Consumer_Config_impl (PortableServer::POA_ptr poa) : + service_type_ (NOTIFY), + poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -408,8 +409,20 @@ namespace CIAO return this->qos_._retn (); } - CosNotify_Supplier_Config_impl::CosNotify_Supplier_Config_impl () : - service_type_ (NOTIFY) + void + CosNotify_Consumer_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + + CosNotify_Supplier_Config_impl::CosNotify_Supplier_Config_impl (PortableServer::POA_ptr poa) : + service_type_ (NOTIFY), + poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -448,4 +461,15 @@ namespace CIAO return this->qos_._retn (); } + void + CosNotify_Supplier_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + } diff --git a/TAO/CIAO/ciao/CIAO_CosNotify.h b/TAO/CIAO/ciao/CIAO_CosNotify.h index d25e6a22846..c95899e3794 100644 --- a/TAO/CIAO/ciao/CIAO_CosNotify.h +++ b/TAO/CIAO/ciao/CIAO_CosNotify.h @@ -210,7 +210,7 @@ namespace CIAO public: - CosNotify_Consumer_Config_impl (); + CosNotify_Consumer_Config_impl (PortableServer::POA_ptr poa); virtual void consumer_id (const char * consumer_id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -233,10 +233,13 @@ namespace CIAO virtual EventServiceType service_type (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - CosNotifyFilter::Filter_ptr notify_filter (ACE_ENV_SINGLE_ARG_DECL) + virtual CosNotifyFilter::Filter_ptr notify_filter (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - CosNotification::QoSProperties * notify_qos (ACE_ENV_SINGLE_ARG_DECL) + virtual CosNotification::QoSProperties * notify_qos (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); private: @@ -253,6 +256,8 @@ namespace CIAO CosNotification::QoSProperties_var qos_; + PortableServer::POA_var poa_; + }; /** @@ -269,21 +274,24 @@ namespace CIAO public: - CosNotify_Supplier_Config_impl (); + CosNotify_Supplier_Config_impl (PortableServer::POA_ptr poa); + + virtual void supplier_id (const char * supplier_id ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); - void supplier_id (const char * supplier_id ACE_ENV_ARG_DECL) + virtual char * supplier_id (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - char * supplier_id (ACE_ENV_SINGLE_ARG_DECL) + virtual EventServiceType service_type (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - EventServiceType service_type (ACE_ENV_SINGLE_ARG_DECL) + virtual CosNotifyFilter::Filter_ptr notify_filter (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - CosNotifyFilter::Filter_ptr notify_filter (ACE_ENV_SINGLE_ARG_DECL) + virtual CosNotification::QoSProperties * notify_qos (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - CosNotification::QoSProperties * notify_qos (ACE_ENV_SINGLE_ARG_DECL) + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); private: @@ -296,6 +304,8 @@ namespace CIAO CosNotification::QoSProperties_var qos_; + PortableServer::POA_var poa_; + }; } diff --git a/TAO/CIAO/ciao/CIAO_DirectEvent.cpp b/TAO/CIAO/ciao/CIAO_DirectEvent.cpp index 6036c6ca6a1..93ef82fbdce 100644 --- a/TAO/CIAO/ciao/CIAO_DirectEvent.cpp +++ b/TAO/CIAO/ciao/CIAO_DirectEvent.cpp @@ -42,8 +42,10 @@ namespace CIAO consumer_config->consumer (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - this->consumer_array_.set (consumer._retn (), - this->consumer_array_.size ()); + this->consumer_array_.size (this->consumer_array_.size () + 1); + + this->consumer_array_.set (Components::EventConsumerBase::_duplicate (consumer.in ()), + this->consumer_array_.size () - 1); } @@ -68,7 +70,6 @@ namespace CIAO { } - void DirectEventService::push_event ( Components::EventBase * ev @@ -94,9 +95,15 @@ namespace CIAO } } - Direct_Consumer_Config_impl::Direct_Consumer_Config_impl () : - service_type_ (DIRECT) + Direct_Consumer_Config_impl::Direct_Consumer_Config_impl (PortableServer::POA_ptr poa) : + service_type_ (DIRECT), + poa_ (PortableServer::POA::_duplicate (poa)) + { + } + + Direct_Consumer_Config_impl::~Direct_Consumer_Config_impl (void) { + ACE_DEBUG ((LM_DEBUG, "Direct_Consumer_Config_impl::~Direct_Consumer_Config_impl\n")); } void @@ -126,7 +133,7 @@ namespace CIAO ACE_THROW_SPEC (( CORBA::SystemException)) { - this->consumer_ = consumer; + this->consumer_ = Components::EventConsumerBase::_duplicate (consumer); } CONNECTION_ID @@ -165,9 +172,26 @@ namespace CIAO return Components::EventConsumerBase::_duplicate (this->consumer_.in ()); } - Direct_Supplier_Config_impl::Direct_Supplier_Config_impl (void) - : service_type_ (DIRECT) + void + Direct_Consumer_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + + Direct_Supplier_Config_impl::Direct_Supplier_Config_impl (PortableServer::POA_ptr poa) + : service_type_ (DIRECT), + poa_ (PortableServer::POA::_duplicate (poa)) + { + } + + Direct_Supplier_Config_impl::~Direct_Supplier_Config_impl (void) { + ACE_DEBUG ((LM_DEBUG, "Direct_Supplier_Config_impl::~Direct_Supplier_Config_impl\n")); } void @@ -198,4 +222,15 @@ namespace CIAO return this->service_type_; } + void + Direct_Supplier_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + } diff --git a/TAO/CIAO/ciao/CIAO_DirectEvent.h b/TAO/CIAO/ciao/CIAO_DirectEvent.h index b0ee3d6c564..edf400f4114 100644 --- a/TAO/CIAO/ciao/CIAO_DirectEvent.h +++ b/TAO/CIAO/ciao/CIAO_DirectEvent.h @@ -87,7 +87,7 @@ namespace CIAO * List of consumers. */ /// @@ George, this is cool! Do you want to use a _var or _ptr? - ACE_Array<Components::EventConsumerBase_ptr> consumer_array_; + ACE_Array<Components::EventConsumerBase_var> consumer_array_; }; @@ -101,12 +101,15 @@ namespace CIAO * is specified as the event service type. */ class Direct_Consumer_Config_impl : - public virtual POA_CIAO::Direct_Consumer_Config + public virtual POA_CIAO::Direct_Consumer_Config, + public virtual PortableServer::RefCountServantBase { public: - Direct_Consumer_Config_impl (); + Direct_Consumer_Config_impl (PortableServer::POA_ptr poa); + + virtual ~Direct_Consumer_Config_impl (void); virtual void consumer_id (const char * consumer_id ACE_ENV_ARG_DECL) @@ -132,6 +135,9 @@ namespace CIAO virtual EventServiceType service_type (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + private: ACE_CString consumer_id_; @@ -142,6 +148,8 @@ namespace CIAO EventServiceType service_type_; + PortableServer::POA_var poa_; + }; /** @@ -153,12 +161,15 @@ namespace CIAO * is specified as the event service type. */ class Direct_Supplier_Config_impl : - public virtual POA_CIAO::Direct_Supplier_Config + public virtual POA_CIAO::Direct_Supplier_Config, + public virtual PortableServer::RefCountServantBase { public: - Direct_Supplier_Config_impl (); + Direct_Supplier_Config_impl (PortableServer::POA_ptr poa); + + virtual ~Direct_Supplier_Config_impl (void); void supplier_id (const char * supplier_id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -169,12 +180,17 @@ namespace CIAO EventServiceType service_type (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + private: ACE_CString supplier_id_; EventServiceType service_type_; + PortableServer::POA_var poa_; + }; } diff --git a/TAO/CIAO/ciao/CIAO_EventService_Factory_impl.cpp b/TAO/CIAO/ciao/CIAO_EventService_Factory_impl.cpp index 2f2c2874764..453ae01ba6d 100644 --- a/TAO/CIAO/ciao/CIAO_EventService_Factory_impl.cpp +++ b/TAO/CIAO/ciao/CIAO_EventService_Factory_impl.cpp @@ -29,28 +29,6 @@ namespace CIAO rt_event_channel_ (RtecEventChannelAdmin::EventChannel::_nil ()), notify_channel_ (CosNotifyChannelAdmin::EventChannel::_nil ()) { - - /*this->orb_ = CORBA::ORB_init (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n")); - this->root_poa_ = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - */ - } EventService_Factory_impl::~EventService_Factory_impl (void) @@ -67,7 +45,7 @@ namespace CIAO { Direct_Consumer_Config_impl * consumer_config = 0; ACE_NEW_RETURN (consumer_config, - Direct_Consumer_Config_impl, + Direct_Consumer_Config_impl (this->root_poa_.in ()), Consumer_Config::_nil ()); Direct_Consumer_Config_var return_direct = consumer_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -79,7 +57,7 @@ namespace CIAO { RTEvent_Consumer_Config_impl * consumer_config = 0; ACE_NEW_RETURN (consumer_config, - RTEvent_Consumer_Config_impl, + RTEvent_Consumer_Config_impl (this->root_poa_.in ()), Consumer_Config::_nil ()); RTEvent_Consumer_Config_var return_rtec = consumer_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -91,7 +69,7 @@ namespace CIAO { CosNotify_Consumer_Config_impl * consumer_config = 0; ACE_NEW_RETURN (consumer_config, - CosNotify_Consumer_Config_impl, + CosNotify_Consumer_Config_impl (this->root_poa_.in ()), Consumer_Config::_nil ()); CosNotify_Consumer_Config_var return_notify = consumer_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -119,7 +97,7 @@ namespace CIAO { Direct_Supplier_Config_impl * supplier_config = 0; ACE_NEW_RETURN (supplier_config, - Direct_Supplier_Config_impl, + Direct_Supplier_Config_impl (this->root_poa_.in ()), Supplier_Config::_nil ()); Direct_Supplier_Config_var return_direct = supplier_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -131,7 +109,7 @@ namespace CIAO { RTEvent_Supplier_Config_impl * supplier_config = 0; ACE_NEW_RETURN (supplier_config, - RTEvent_Supplier_Config_impl, + RTEvent_Supplier_Config_impl (this->root_poa_.in ()), Supplier_Config::_nil ()); RTEvent_Supplier_Config_var return_rtec = supplier_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -143,7 +121,7 @@ namespace CIAO { CosNotify_Supplier_Config_impl * supplier_config = 0; ACE_NEW_RETURN (supplier_config, - CosNotify_Supplier_Config_impl, + CosNotify_Supplier_Config_impl (this->root_poa_.in ()), Supplier_Config::_nil ()); CosNotify_Supplier_Config_var return_notify = supplier_config->_this (ACE_ENV_SINGLE_ARG_PARAMETER); diff --git a/TAO/CIAO/ciao/CIAO_Events.idl b/TAO/CIAO/ciao/CIAO_Events.idl index f6c2a79d368..a4d975e9174 100644 --- a/TAO/CIAO/ciao/CIAO_Events.idl +++ b/TAO/CIAO/ciao/CIAO_Events.idl @@ -25,25 +25,23 @@ module CIAO RTNOTIFY }; - interface Consumer_Config + interface Supplier_Config { attribute CONNECTION_ID supplier_id; - - attribute CONNECTION_ID consumer_id; - - attribute Components::EventConsumerBase consumer; - + readonly attribute EventServiceType service_type; + void destroy (); + }; - interface Supplier_Config + interface Consumer_Config : Supplier_Config { - - attribute CONNECTION_ID supplier_id; - - readonly attribute EventServiceType service_type; + + attribute CONNECTION_ID consumer_id; + + attribute Components::EventConsumerBase consumer; }; diff --git a/TAO/CIAO/ciao/CIAO_RTEvent.cpp b/TAO/CIAO/ciao/CIAO_RTEvent.cpp index 4c491c3aa94..6b39673eda2 100644 --- a/TAO/CIAO/ciao/CIAO_RTEvent.cpp +++ b/TAO/CIAO/ciao/CIAO_RTEvent.cpp @@ -58,7 +58,7 @@ namespace CIAO // Create and register supplier servant RTEventServiceSupplier_impl * supplier_servant = 0; ACE_NEW (supplier_servant, - RTEventServiceSupplier_impl (orb_.in ())); + RTEventServiceSupplier_impl (root_poa_.in ())); RtecEventComm::PushSupplier_var push_supplier = supplier_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -98,7 +98,7 @@ namespace CIAO consumer_config->consumer (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (consumer.in ())) + if (CORBA::is_nil (consumer)) ACE_DEBUG ((LM_DEBUG, "nil event consumer\n")); RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = @@ -113,8 +113,8 @@ namespace CIAO RTEventServiceConsumer_impl * consumer_servant = 0; ACE_NEW (consumer_servant, RTEventServiceConsumer_impl ( - orb_.in (), - Components::EventConsumerBase::_duplicate (consumer.in ()))); + root_poa_.in (), + consumer.in ())); RtecEventComm::PushConsumer_var push_consumer = consumer_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; @@ -207,40 +207,24 @@ namespace CIAO } - RTEventServiceSupplier_impl::RTEventServiceSupplier_impl (void) - { - } - RTEventServiceSupplier_impl::RTEventServiceSupplier_impl ( - CORBA::ORB_ptr orb) : - orb_ (CORBA::ORB::_duplicate (orb)) + PortableServer::POA_ptr poa) : + poa_ (PortableServer::POA::_duplicate (poa)) { } void RTEventServiceSupplier_impl::disconnect_push_supplier (void) { - CORBA::Object_var poa_object = - orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR ((LM_ERROR, "Nil RootPOA\n")); - PortableServer::ObjectId_var oid = root_poa->servant_to_id (this); - root_poa->deactivate_object (oid); - delete this; - } - - RTEventServiceConsumer_impl::RTEventServiceConsumer_impl (void) - { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); } RTEventServiceConsumer_impl::RTEventServiceConsumer_impl ( - CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, Components::EventConsumerBase_ptr consumer) : - orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)), event_consumer_ (Components::EventConsumerBase::_duplicate (consumer)) { } @@ -261,6 +245,7 @@ namespace CIAO ACE_CHECK; } } + } void @@ -269,21 +254,14 @@ namespace CIAO { ACE_DEBUG ((LM_DEBUG, "CIAO::RTEventServiceConsumer_impl::disconnect_push_consumer\n")); - CORBA::Object_var poa_object = - orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - if (CORBA::is_nil (root_poa.in ())) - ACE_ERROR ((LM_ERROR, "Nil RootPOA\n")); - PortableServer::ObjectId_var oid = root_poa->servant_to_id (this); - root_poa->deactivate_object (oid); - delete this; + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); } - RTEvent_Consumer_Config_impl::RTEvent_Consumer_Config_impl (void) : - service_type_ (RTEC) + RTEvent_Consumer_Config_impl::RTEvent_Consumer_Config_impl (PortableServer::POA_ptr poa) : + service_type_ (RTEC), + poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -337,7 +315,7 @@ namespace CIAO CORBA::SystemException)) { - ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::consumer_id\n")); + ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::set_consumer_id\n")); this->consumer_id_ = consumer_id; } @@ -350,7 +328,7 @@ namespace CIAO CORBA::SystemException)) { - ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::supplier_id\n")); + ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::set_supplier_id\n")); this->supplier_id_ = supplier_id; @@ -371,7 +349,7 @@ namespace CIAO ACE_THROW_SPEC (( CORBA::SystemException)) { - this->consumer_ = consumer; + this->consumer_ = Components::EventConsumerBase::_duplicate (consumer); } CONNECTION_ID @@ -389,6 +367,9 @@ namespace CIAO ACE_THROW_SPEC (( CORBA::SystemException)) { + + ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::get_supplier_id\n")); + return CORBA::string_dup (this->supplier_id_.c_str ()); } @@ -407,6 +388,8 @@ namespace CIAO ACE_THROW_SPEC (( CORBA::SystemException)) { + ACE_DEBUG ((LM_DEBUG, "RTEvent_Consumer_Config_impl::get_consumer\n")); + return Components::EventConsumerBase::_duplicate (this->consumer_.in ()); } @@ -425,8 +408,24 @@ namespace CIAO } - RTEvent_Supplier_Config_impl::RTEvent_Supplier_Config_impl (void) : - service_type_ (RTEC) + void + RTEvent_Consumer_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + + ACE_DEBUG + ((LM_DEBUG, "RTEvent_Consumer_Config_impl::destroy\n")); + + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + + RTEvent_Supplier_Config_impl::RTEvent_Supplier_Config_impl (PortableServer::POA_ptr poa) : + service_type_ (RTEC), + poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -488,4 +487,15 @@ namespace CIAO } + void + RTEvent_Supplier_Config_impl::destroy ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException)) + { + PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); + this->poa_->deactivate_object (oid); + this->_remove_ref (); + } + } diff --git a/TAO/CIAO/ciao/CIAO_RTEvent.h b/TAO/CIAO/ciao/CIAO_RTEvent.h index b382461f0a6..84da8527c77 100644 --- a/TAO/CIAO/ciao/CIAO_RTEvent.h +++ b/TAO/CIAO/ciao/CIAO_RTEvent.h @@ -41,7 +41,7 @@ namespace CIAO PortableServer::POA_ptr poa, RtecEventChannelAdmin::EventChannel_ptr ec); - ~RTEventService (); + virtual ~RTEventService (void); virtual void connect_event_supplier ( CIAO::Supplier_Config_ptr supplier_config @@ -137,10 +137,8 @@ namespace CIAO public: - RTEventServiceSupplier_impl (void); - RTEventServiceSupplier_impl ( - CORBA::ORB_ptr orb); + PortableServer::POA_ptr poa); virtual void disconnect_push_supplier ( ACE_ENV_SINGLE_ARG_DECL) @@ -149,7 +147,7 @@ namespace CIAO private: - CORBA::ORB_var orb_; + PortableServer::POA_var poa_; }; @@ -165,10 +163,8 @@ namespace CIAO public: - RTEventServiceConsumer_impl (void); - RTEventServiceConsumer_impl ( - CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, Components::EventConsumerBase_ptr consumer); virtual void push ( @@ -181,7 +177,7 @@ namespace CIAO private: - CORBA::ORB_var orb_; + PortableServer::POA_var poa_; Components::EventConsumerBase_var event_consumer_; @@ -196,14 +192,15 @@ namespace CIAO * specified as the event service type. */ class RTEvent_Consumer_Config_impl : - public virtual POA_CIAO::RTEvent_Consumer_Config + public virtual POA_CIAO::RTEvent_Consumer_Config, + public virtual PortableServer::RefCountServantBase { public: - RTEvent_Consumer_Config_impl (); + RTEvent_Consumer_Config_impl (PortableServer::POA_ptr poa); - ~RTEvent_Consumer_Config_impl (); + virtual ~RTEvent_Consumer_Config_impl (void); virtual void start_conjunction_group (CORBA::Long size ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -238,6 +235,9 @@ namespace CIAO virtual RtecEventChannelAdmin::ConsumerQOS * rt_event_qos (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + private: ACE_CString consumer_id_; @@ -250,6 +250,8 @@ namespace CIAO ACE_ConsumerQOS_Factory qos_; + PortableServer::POA_var poa_; + }; /** @@ -261,14 +263,15 @@ namespace CIAO * specified as the event service type. */ class RTEvent_Supplier_Config_impl : - public virtual POA_CIAO::RTEvent_Supplier_Config + public virtual POA_CIAO::RTEvent_Supplier_Config, + public virtual PortableServer::RefCountServantBase { public: - RTEvent_Supplier_Config_impl (); + RTEvent_Supplier_Config_impl (PortableServer::POA_ptr poa); - ~RTEvent_Supplier_Config_impl (); + virtual ~RTEvent_Supplier_Config_impl (void); void supplier_id (const char * supplier_id ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -282,6 +285,9 @@ namespace CIAO RtecEventChannelAdmin::SupplierQOS * rt_event_qos (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void destroy (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + private: ACE_CString supplier_id_; @@ -290,6 +296,8 @@ namespace CIAO ACE_SupplierQOS_Factory qos_; + PortableServer::POA_var poa_; + }; } diff --git a/TAO/CIAO/ciao/Container_Base.cpp b/TAO/CIAO/ciao/Container_Base.cpp index ca57500e3d5..cdca3b44f77 100644 --- a/TAO/CIAO/ciao/Container_Base.cpp +++ b/TAO/CIAO/ciao/Container_Base.cpp @@ -196,12 +196,12 @@ CIAO::Container::push_event ( ACE_DEBUG ((LM_DEBUG, "CIAO::Container::push_event\n")); CIAO::EventServiceBase * event_service; + // ACE_DEBUG ((LM_DEBUG, "Pushing from supplier id: %s\n", connection_id)); if (this->event_service_map_.find (connection_id, event_service) != 0) { ACE_THROW ( Components::InvalidConnection ()); } - event_service->push_event (ev ACE_ENV_ARG_PARAMETER); ACE_CHECK; diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp b/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp index 511df25fde4..ce230a87de2 100644 --- a/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMClosedED/BMClosedED_svnt.cpp @@ -252,7 +252,7 @@ namespace CIAO_GLUE_BasicSP ACE_CString my_uuid = this->servant_->component_UUID (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - my_uuid += "_data_available_publisher"; + my_uuid += "_out_avail_publisher"; this->container_->push_event (ev, my_uuid.c_str () diff --git a/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl b/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl index 0188ea55aa8..afa651e3ec4 100644 --- a/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl +++ b/TAO/CIAO/examples/handcrafted/BasicSP_EC/BMDisplay/BMDisplayE.idl @@ -1,4 +1,4 @@ -// $Id$ +//$Id$ #include <Components.idl> #include "BMDisplay.idl" diff --git a/TAO/CIAO/tools/Assembly_Deployer/Assembly_Impl.cpp b/TAO/CIAO/tools/Assembly_Deployer/Assembly_Impl.cpp index 653df8d4ea1..81362960494 100644 --- a/TAO/CIAO/tools/Assembly_Deployer/Assembly_Impl.cpp +++ b/TAO/CIAO/tools/Assembly_Deployer/Assembly_Impl.cpp @@ -336,15 +336,15 @@ CIAO::Assembly_Impl::make_connections (ACE_ENV_SINGLE_ARG_DECL) ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (sink)) + if (CORBA::is_nil (sink.in ())) ACE_DEBUG ((LM_DEBUG, "Nil sink\n")); Components::EventConsumerBase_var consumer - = this->resolve_consumer (connection->dest_iface_ - ACE_ENV_ARG_PARAMETER); + = sink->get_consumer (connection->dest_iface_->resolver_info () + ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (consumer)) + if (CORBA::is_nil (consumer.in ())) ACE_DEBUG ((LM_DEBUG, "Nil consumer\n")); Components::CCMObject_var source @@ -352,7 +352,7 @@ CIAO::Assembly_Impl::make_connections (ACE_ENV_SINGLE_ARG_DECL) ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (source)) + if (CORBA::is_nil (source.in ())) ACE_DEBUG ((LM_DEBUG, "Nil source\n")); Components::Deployment::Container_var container; @@ -365,7 +365,7 @@ CIAO::Assembly_Impl::make_connections (ACE_ENV_SINGLE_ARG_DECL) container->get_event_service (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - if (CORBA::is_nil (event_service)) + if (CORBA::is_nil (event_service.in ())) ACE_DEBUG ((LM_DEBUG, "Nil event_service\n")); CIAO::EventServiceType type = CIAO::RTEC; @@ -399,6 +399,9 @@ CIAO::Assembly_Impl::make_connections (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; this->connected_publishers_.insert (sid); + + supplier_config->destroy (ACE_ENV_SINGLE_ARG_DECL); + ACE_CHECK; } CIAO::Consumer_Config_var consumer_config = @@ -409,12 +412,15 @@ CIAO::Assembly_Impl::make_connections (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; consumer_config->consumer_id (cid.c_str () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - consumer_config->consumer (Components::EventConsumerBase::_duplicate (consumer.in ()) + 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; - event_service->connect_event_consumer (consumer_config.in () ACE_ENV_ARG_PARAMETER); + consumer_config->destroy (ACE_ENV_SINGLE_ARG_DECL); ACE_CHECK; } |