diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp | 168 |
1 files changed, 62 insertions, 106 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp index 2cf855c3009..26812db99ae 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp @@ -60,13 +60,12 @@ TAO_Notify_EventChannelFactory::~TAO_Notify_EventChannelFactory () } void -TAO_Notify_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::destroy (void) ACE_THROW_SPEC (( CORBA::SystemException )) { - int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + int result = this->shutdown (); if ( result == 1) return; @@ -80,24 +79,21 @@ TAO_Notify_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL) } void -TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa) { ACE_ASSERT (this->ec_container_.get() == 0); this->default_filter_factory_ = - TAO_Notify_PROPERTIES::instance()->builder()->build_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + TAO_Notify_PROPERTIES::instance()->builder()->build_filter_factory (); // Init ec_container_ TAO_Notify_EventChannel_Container* ecc = 0; ACE_NEW_THROW_EX (ecc, TAO_Notify_EventChannel_Container (), CORBA::INTERNAL ()); - ACE_CHECK; this->ec_container_.reset( ecc ); - this->ec_container().init (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + this->ec_container().init (); TAO_Notify_POA_Helper* object_poa = 0; @@ -105,12 +101,10 @@ TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DE ACE_NEW_THROW_EX (object_poa, TAO_Notify_POA_Helper (), CORBA::NO_MEMORY ()); - ACE_CHECK; ACE_Auto_Ptr<TAO_Notify_POA_Helper> auto_object_poa (object_poa); - object_poa->init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + object_poa->init (poa); this->adopt_poa (auto_object_poa.release ()); @@ -119,21 +113,19 @@ TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DE this->topology_factory_ = ACE_Dynamic_Service <TAO_Notify::Topology_Factory>::instance ("Topology_Factory"); - this->load_topology (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + this->load_topology (); - this->load_event_persistence (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + this->load_event_persistence (); } void -TAO_Notify_EventChannelFactory::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO_Notify_EventChannelFactory::_add_ref (void) { this->_incr_refcnt (); } void -TAO_Notify_EventChannelFactory::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO_Notify_EventChannelFactory::_remove_ref (void) { this->_decr_refcnt (); } @@ -146,30 +138,27 @@ TAO_Notify_EventChannelFactory::release (void) } void -TAO_Notify_EventChannelFactory::remove (TAO_Notify_EventChannel* event_channel ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::remove (TAO_Notify_EventChannel* event_channel) { - this->ec_container().remove (event_channel ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER); + this->ec_container().remove (event_channel); + this->self_change (); } int -TAO_Notify_EventChannelFactory::shutdown (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::shutdown (void) { - int sd_ret = TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (1); + int sd_ret = TAO_Notify_Object::shutdown (); if (sd_ret == 1) return 1; - this->ec_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (1); + this->ec_container().shutdown (); return 0; } CosNotifyFilter::FilterFactory_ptr -TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO_Notify_EventChannelFactory::get_default_filter_factory (void) { return CosNotifyFilter::FilterFactory::_duplicate (this->default_filter_factory_.in ()); } @@ -177,7 +166,7 @@ TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_D ::CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_EventChannelFactory::create_channel ( const CosNotification::QoSProperties & initial_qos, const CosNotification::AdminProperties & initial_admin, - CosNotifyChannelAdmin::ChannelID_out id ACE_ENV_ARG_DECL + CosNotifyChannelAdmin::ChannelID_out id ) ACE_THROW_SPEC (( CORBA::SystemException @@ -189,27 +178,24 @@ TAO_Notify_EventChannelFactory::get_default_filter_factory (ACE_ENV_SINGLE_ARG_D TAO_Notify_PROPERTIES::instance()->builder()->build_event_channel (this , initial_qos , initial_admin - , id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannel::_nil()); - this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannel::_nil()); + , id); + this->self_change (); return ec._retn (); } CosNotifyChannelAdmin::ChannelIDSeq* -TAO_Notify_EventChannelFactory::get_all_channels (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::get_all_channels (void) ACE_THROW_SPEC (( CORBA::SystemException )) { TAO_Notify_EventChannel_Seq_Worker seq_worker; - return seq_worker.create (this->ec_container() ACE_ENV_ARG_PARAMETER); + return seq_worker.create (this->ec_container()); } CosNotifyChannelAdmin::EventChannel_ptr -TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::ChannelID id ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::ChannelID id) ACE_THROW_SPEC (( CORBA::SystemException , CosNotifyChannelAdmin::ChannelNotFound @@ -217,7 +203,7 @@ TAO_Notify_EventChannelFactory::get_event_channel (CosNotifyChannelAdmin::Channe { TAO_Notify_EventChannel_Find_Worker find_worker; - return find_worker.resolve (id, this->ec_container() ACE_ENV_ARG_PARAMETER); + return find_worker.resolve (id, this->ec_container()); } void @@ -233,7 +219,7 @@ TAO_Notify_EventChannelFactory::set_topology_factory(TAO_Notify::Topology_Factor } void -TAO_Notify_EventChannelFactory::load_topology (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::load_topology (void) { this->loading_topology_ = true; if (this->topology_factory_ != 0) @@ -242,8 +228,7 @@ TAO_Notify_EventChannelFactory::load_topology (ACE_ENV_SINGLE_ARG_DECL) auto_ptr<TAO_Notify::Topology_Loader> tl(this->topology_factory_->create_loader()); if (tl.get () != 0) { - tl->load (this ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + tl->load (this); } } else @@ -260,7 +245,7 @@ TAO_Notify_EventChannelFactory::is_persistent () const } void -TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& saver ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& saver) { bool changed = this->self_changed_; this->self_changed_ = false; @@ -269,27 +254,24 @@ TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& sav TAO_Notify::NVPList attrs; // ECF has no attributes bool want_all_children = - saver.begin_object(0, "channel_factory", attrs, changed ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + saver.begin_object(0, "channel_factory", attrs, changed); // for each deleted child // delete_child // if the child has persistence. TAO_Notify::Save_Persist_Worker<TAO_Notify_EventChannel> wrk(saver, want_all_children); - this->ec_container().collection()->for_each(&wrk ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->ec_container().collection()->for_each(&wrk); if (want_all_children || this->reconnect_registry_.is_changed ()) { - this->reconnect_registry_.save_persistent(saver ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->reconnect_registry_.save_persistent(saver); } - saver.end_object(0, "channel_factory" ACE_ENV_ARG_PARAMETER); + saver.end_object(0, "channel_factory"); } void -TAO_Notify_EventChannelFactory::load_event_persistence (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::load_event_persistence (void) { TAO_Notify::Event_Persistence_Strategy * strategy = ACE_Dynamic_Service <TAO_Notify::Event_Persistence_Strategy>::instance ("Event_Persistence"); @@ -326,14 +308,13 @@ TAO_Notify_EventChannelFactory::load_event_persistence (ACE_ENV_SINGLE_ARG_DECL) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Notify Service: Configuration error. Event Persistence requires Topology Persistence.\n") )); - ACE_THROW (CORBA::PERSIST_STORE()); - ACE_CHECK; + throw CORBA::PERSIST_STORE(); } } } bool -TAO_Notify_EventChannelFactory::change_to_parent (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::change_to_parent (void) { bool saving = false; if (! this->loading_topology_) @@ -348,16 +329,13 @@ TAO_Notify_EventChannelFactory::change_to_parent (ACE_ENV_SINGLE_ARG_DECL) // just return. Caller will signal change again if necessary. short seq = this->topology_save_seq_; ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->topology_save_lock_, CORBA::INTERNAL ()); - ACE_CHECK_RETURN(false); if (seq == this->topology_save_seq_) { auto_ptr<TAO_Notify::Topology_Saver> saver(this->topology_factory_->create_saver()); if (saver.get() != 0) { - this->save_persistent(*saver ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(false); - saver->close (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (false); + this->save_persistent(*saver); + saver->close (); } this->topology_save_seq_ += 1; } @@ -370,8 +348,7 @@ TAO_Notify::Topology_Object* TAO_Notify_EventChannelFactory::load_child (const ACE_CString& type, CORBA::Long id, const TAO_Notify:: - NVPList& attrs - ACE_ENV_ARG_DECL) + NVPList& attrs) { // ignore anything but our valid children (ie channel) TAO_Notify::Topology_Object * result = this; @@ -385,9 +362,7 @@ TAO_Notify_EventChannelFactory::load_child (const ACE_CString& type, TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder(); TAO_Notify_EventChannel * ec = bld->build_event_channel( this , - id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); + id); ec->load_attrs (attrs); @@ -401,69 +376,61 @@ TAO_Notify_EventChannelFactory::load_child (const ACE_CString& type, } void -TAO_Notify_EventChannelFactory::reconnect (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::reconnect (void) { // Reconnect all children first TAO_Notify::Reconnect_Worker<TAO_Notify_EventChannel> wrk; - this->ec_container().collection()->for_each(&wrk ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->ec_container().collection()->for_each(&wrk); // Then send reconnection announcement to registered clients ACE_ASSERT (!CORBA::is_nil (this->channel_factory_.in ())); - this->reconnect_registry_.send_reconnect (this->channel_factory_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->reconnect_registry_.send_reconnect (this->channel_factory_.in ()); // reactivate events in-progress Routing_Slip_Set::CONST_ITERATOR iter (this->routing_slip_restart_set_); TAO_Notify::Routing_Slip_Ptr * routing_slip; for (iter.first(); iter.next(routing_slip); iter.advance()) { - (*routing_slip)->reconnect(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + (*routing_slip)->reconnect(); } this->routing_slip_restart_set_.reset (); } NotifyExt::ReconnectionRegistry::ReconnectionID TAO_Notify_EventChannelFactory::register_callback ( - NotifyExt::ReconnectionCallback_ptr reconnection - ACE_ENV_ARG_DECL) + NotifyExt::ReconnectionCallback_ptr reconnection) ACE_THROW_SPEC ((CORBA::SystemException)) { return this->reconnect_registry_.register_callback ( - reconnection - ACE_ENV_ARG_PARAMETER); + reconnection); } void TAO_Notify_EventChannelFactory::unregister_callback ( - NotifyExt::ReconnectionRegistry::ReconnectionID id - ACE_ENV_ARG_DECL) + NotifyExt::ReconnectionRegistry::ReconnectionID id) ACE_THROW_SPEC ((CORBA::SystemException)) { this->reconnect_registry_.unregister_callback ( - id - ACE_ENV_ARG_PARAMETER); + id); } CORBA::Boolean -TAO_Notify_EventChannelFactory::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +TAO_Notify_EventChannelFactory::is_alive (void) ACE_THROW_SPEC ((CORBA::SystemException)) { return CORBA::Boolean (1); } void -TAO_Notify_EventChannelFactory::save_topology (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::save_topology (void) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + this->self_change (); } TAO_Notify_ProxyConsumer * -TAO_Notify_EventChannelFactory::find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::find_proxy_consumer (TAO_Notify::IdVec & id_path, size_t position) { TAO_Notify_ProxyConsumer * result = 0; size_t path_size = id_path.size (); @@ -478,21 +445,18 @@ TAO_Notify_EventChannelFactory::find_proxy_consumer (TAO_Notify::IdVec & id_path { TAO_Notify_EventChannel_Find_Worker find_worker; - TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container()); ++position; if (ec != 0) { - result = ec->find_proxy_consumer (id_path, position - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); + result = ec->find_proxy_consumer (id_path, position); } } return result; } TAO_Notify_ProxySupplier * -TAO_Notify_EventChannelFactory::find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position ACE_ENV_ARG_DECL) +TAO_Notify_EventChannelFactory::find_proxy_supplier (TAO_Notify::IdVec & id_path, size_t position) { TAO_Notify_ProxySupplier * result = 0; size_t path_size = id_path.size (); @@ -506,44 +470,36 @@ TAO_Notify_EventChannelFactory::find_proxy_supplier (TAO_Notify::IdVec & id_path if (position < path_size) { TAO_Notify_EventChannel_Find_Worker find_worker; - TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + TAO_Notify_EventChannel * ec = find_worker.find (id_path[position], this->ec_container()); ++position; if (ec != 0) { - result = ec->find_proxy_supplier (id_path, position - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); + result = ec->find_proxy_supplier (id_path, position); } } return result; } CosNotifyChannelAdmin::EventChannelFactory_ptr -TAO_Notify_EventChannelFactory::activate_self (ACE_ENV_SINGLE_ARG_DECL) +TAO_Notify_EventChannelFactory::activate_self (void) { - CORBA::Object_var obj = this->activate (this ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ()); + CORBA::Object_var obj = this->activate (this); this->channel_factory_ - = CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ()); - CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannelFactory::_nil ()); + = CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in()); + CosNotifyChannelAdmin::EventChannelFactory::_narrow (obj.in()); - ACE_TRY_NEW_ENV + try { if (DEBUG_LEVEL > 9) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Notify_EventChannelFactory::activate_self") )); } - this->reconnect (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->reconnect (); } - ACE_CATCHANY + catch (const CORBA::Exception&) { // ignore for now } - ACE_ENDTRY; return this->channel_factory_._retn(); } |