TAO_Notify_EventChannel Class Reference

Implementation of CosNotifyChannelAdmin::EventChannel. More...

#include <EventChannel.h>

Inheritance diagram for TAO_Notify_EventChannel:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_EventChannel:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Notify_Refcountable_Guard_T<
TAO_Notify_EventChannel
Ptr
typedef CosNotifyChannelAdmin::ChannelIDSeq SEQ
typedef CosNotifyChannelAdmin::ChannelIDSeq_var SEQ_VAR

Public Member Functions

 TAO_Notify_EventChannel (void)
 Constuctor.

virtual ~TAO_Notify_EventChannel ()
 Destructor.

void init (TAO_Notify_EventChannelFactory *ecf, const CosNotification::QoSProperties &initial_qos, const CosNotification::AdminProperties &initial_admin)
 Init.

void init (TAO_Notify::Topology_Parent *parent)
 Init (for reload).

void remove (TAO_Notify_ConsumerAdmin *consumer_admin)
 Remove ConsumerAdmin from its container.

void remove (TAO_Notify_SupplierAdmin *supplier_admin)
 Remove SupplierAdmin from its container.

virtual void _add_ref (void)
 ServantBase refcount methods.

virtual void _remove_ref (void)
virtual void save_persistent (TAO_Notify::Topology_Saver &saver)
virtual TAO_Notify::Topology_Objectload_child (const ACE_CString &type, CORBA::Long id, const TAO_Notify::NVPList &attrs)
virtual void reconnect (void)
virtual TAO_Notify_Object::ID get_id () const
 Find the id associated with topology object.

TAO_Notify_ProxyConsumerfind_proxy_consumer (TAO_Notify::IdVec &id_path, size_t position)
TAO_Notify_ProxySupplierfind_proxy_supplier (TAO_Notify::IdVec &id_path, size_t position)
virtual int shutdown (void)
 Shutdown.

virtual void load_attrs (const TAO_Notify::NVPList &attrs)
virtual void destroy (void)
 TAO_Notify_Container_T requires a destroy method.


Protected Member Functions

virtual::CosNotifyChannelAdmin::EventChannelFactory_ptr MyFactory ()
 =CosNotifyChannelAdmin::EventChannel methods

virtual::CosNotifyChannelAdmin::ConsumerAdmin_ptr default_consumer_admin ()
virtual::CosNotifyChannelAdmin::SupplierAdmin_ptr default_supplier_admin ()
virtual::CosNotifyFilter::FilterFactory_ptr default_filter_factory (void)
virtual::CosNotifyChannelAdmin::ConsumerAdmin_ptr new_for_consumers (CosNotifyChannelAdmin::InterFilterGroupOperator op, CosNotifyChannelAdmin::AdminID_out id)
virtual::CosNotifyChannelAdmin::SupplierAdmin_ptr new_for_suppliers (CosNotifyChannelAdmin::InterFilterGroupOperator op, CosNotifyChannelAdmin::AdminID_out id)
virtual::CosNotifyChannelAdmin::ConsumerAdmin_ptr get_consumeradmin (CosNotifyChannelAdmin::AdminID id)
virtual::CosNotifyChannelAdmin::SupplierAdmin_ptr get_supplieradmin (CosNotifyChannelAdmin::AdminID id)
virtual::CosNotifyChannelAdmin::AdminIDSeq * get_all_consumeradmins (void)
virtual::CosNotifyChannelAdmin::AdminIDSeq * get_all_supplieradmins (void)
virtual::CosNotification::QoSProperties * get_qos (void)
 Get the QoS Properties.

virtual void set_qos (const CosNotification::QoSProperties &qos)
 Set the QoS Properties.

virtual void validate_qos (const CosNotification::QoSProperties &required_qos, CosNotification::NamedPropertyRangeSeq_out available_qos)
virtual::CosNotification::AdminProperties * get_admin (void)
virtual void set_admin (const CosNotification::AdminProperties &admin)
virtual::CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers (void)
virtual::CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers (void)

Private Types

typedef TAO_Notify_Container_T<
TAO_Notify_ConsumerAdmin
TAO_Notify_ConsumerAdmin_Container
typedef TAO_Notify_Container_T<
TAO_Notify_SupplierAdmin
TAO_Notify_SupplierAdmin_Container

Private Member Functions

virtual void save_attrs (TAO_Notify::NVPList &attrs)
TAO_Notify_ConsumerAdmin_Containerca_container ()
TAO_Notify_SupplierAdmin_Containersa_container ()
virtual void release (void)
 Release.


Private Attributes

TAO_Notify_EventChannelFactory::Ptr ecf_
TAO_SYNCH_MUTEX default_admin_mutex_
CosNotifyChannelAdmin::ConsumerAdmin_var default_consumer_admin_
CosNotifyChannelAdmin::SupplierAdmin_var default_supplier_admin_
ACE_Auto_Ptr< TAO_Notify_ConsumerAdmin_Containerca_container_
 ConsumerAdmin Container.

ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Containersa_container_
 SupplierAdmin Container.


Friends

class TAO_Notify_Builder

Detailed Description

Implementation of CosNotifyChannelAdmin::EventChannel.

Definition at line 48 of file EventChannel.h.


Member Typedef Documentation

typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_EventChannel > TAO_Notify_EventChannel::Ptr
 

Reimplemented from TAO_Notify_Refcountable.

Definition at line 55 of file EventChannel.h.

Referenced by destroy().

typedef CosNotifyChannelAdmin::ChannelIDSeq TAO_Notify_EventChannel::SEQ
 

Definition at line 56 of file EventChannel.h.

typedef CosNotifyChannelAdmin::ChannelIDSeq_var TAO_Notify_EventChannel::SEQ_VAR
 

Definition at line 57 of file EventChannel.h.

typedef TAO_Notify_Container_T<TAO_Notify_ConsumerAdmin> TAO_Notify_EventChannel::TAO_Notify_ConsumerAdmin_Container [private]
 

Definition at line 104 of file EventChannel.h.

Referenced by init().

typedef TAO_Notify_Container_T<TAO_Notify_SupplierAdmin> TAO_Notify_EventChannel::TAO_Notify_SupplierAdmin_Container [private]
 

Definition at line 105 of file EventChannel.h.

Referenced by init().


Constructor & Destructor Documentation

TAO_Notify_EventChannel::TAO_Notify_EventChannel void   ) 
 

Constuctor.

Definition at line 46 of file EventChannel.cpp.

00047   : ecf_ (0)
00048   , ca_container_ (0)
00049   , sa_container_ (0)
00050 {
00051 }

TAO_Notify_EventChannel::~TAO_Notify_EventChannel  )  [virtual]
 

Destructor.

Definition at line 53 of file EventChannel.cpp.

00054 {
00055 }


Member Function Documentation

void TAO_Notify_EventChannel::_add_ref void   )  [virtual]
 

ServantBase refcount methods.

Definition at line 172 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_incr_refcnt().

00173 {
00174   this->_incr_refcnt ();
00175 }

void TAO_Notify_EventChannel::_remove_ref void   )  [virtual]
 

Definition at line 178 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_decr_refcnt().

00179 {
00180   this->_decr_refcnt ();
00181 }

TAO_Notify_EventChannel::TAO_Notify_ConsumerAdmin_Container & TAO_Notify_EventChannel::ca_container  )  [private]
 

Definition at line 560 of file EventChannel.cpp.

References ACE_ASSERT, and ca_container_.

Referenced by destroy(), init(), reconnect(), remove(), save_persistent(), and shutdown().

00561 {
00562   ACE_ASSERT( this->ca_container_.get() != 0 );
00563   return *ca_container_;
00564 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::default_consumer_admin  )  [protected]
 

Definition at line 256 of file EventChannel.cpp.

References ACE_ASSERT, ACE_GUARD_RETURN, CosNotifyChannelAdmin::AdminID, default_consumer_admin_, CORBA::is_nil(), new_for_consumers(), TAO_Notify_Object::poa(), TAO_Notify_POA_Helper::reference_to_servant(), TAO_Notify_Admin::set_default(), and TAO_SYNCH_MUTEX.

Referenced by for_consumers().

00257 {
00258   if (CORBA::is_nil (default_consumer_admin_.in ()))
00259     {
00260       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::ConsumerAdmin::_nil());
00261       if (CORBA::is_nil (default_consumer_admin_.in ()))
00262         {
00263           CosNotifyChannelAdmin::AdminID id;
00264           this->default_consumer_admin_ = this->new_for_consumers (CosNotifyChannelAdmin::OR_OP, id);
00265           // Wish there was a better way to do this!
00266           PortableServer::ServantBase * admin_servant =
00267             this->poa()->reference_to_servant (
00268               this->default_consumer_admin_.in ());
00269           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00270           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00271           if (pAdmin != 0)
00272             {
00273               pAdmin->set_default (true);
00274             }
00275         }
00276     }
00277   return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (this->default_consumer_admin_.in ());
00278 }

CosNotifyFilter::FilterFactory_ptr TAO_Notify_EventChannel::default_filter_factory void   )  [protected]
 

Definition at line 304 of file EventChannel.cpp.

References ecf_.

00305 {
00306   return this->ecf_->get_default_filter_factory ();
00307 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::default_supplier_admin  )  [protected]
 

Definition at line 281 of file EventChannel.cpp.

References ACE_ASSERT, ACE_GUARD_RETURN, CosNotifyChannelAdmin::AdminID, default_supplier_admin_, CORBA::is_nil(), new_for_suppliers(), TAO_Notify_POA_Helper::poa(), TAO_Notify_Object::poa(), TAO_Notify_Admin::set_default(), and TAO_SYNCH_MUTEX.

Referenced by for_suppliers().

00282 {
00283   if (CORBA::is_nil (default_supplier_admin_.in ()))
00284     {
00285       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::SupplierAdmin::_nil());
00286       if (CORBA::is_nil (default_supplier_admin_.in ()))
00287         {
00288           CosNotifyChannelAdmin::AdminID id;
00289           this->default_supplier_admin_ = this->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, id);
00290           PortableServer::ServantBase * admin_servant =
00291             this->poa()->poa()->reference_to_servant (
00292               this->default_supplier_admin_.in ());
00293           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00294           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00295           if (pAdmin != 0)
00296             {
00297               pAdmin->set_default (true);
00298             }
00299         }
00300     }
00301   return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (this->default_supplier_admin_.in ());
00302 }

void TAO_Notify_EventChannel::destroy void   )  [virtual]
 

TAO_Notify_Container_T requires a destroy method.

Definition at line 208 of file EventChannel.cpp.

References ca_container(), ca_container_, TAO_Notify_Container_T< TYPE >::destroy(), ecf_, Ptr, ACE_Auto_Basic_Ptr< X >::reset(), sa_container(), sa_container_, and shutdown().

Referenced by TAO_CosNotify_Service::finalize_service().

00209 {
00210   TAO_Notify_EventChannel::Ptr guard( this );
00211 
00212   int result = this->shutdown ();
00213   if ( result == 1)
00214     return;
00215 
00216   this->ecf_->remove (this);
00217 
00218   this->sa_container ().destroy ();
00219   this->ca_container ().destroy ();
00220 
00221   this->sa_container_.reset( 0 );
00222   this->ca_container_.reset( 0 );
00223 }

TAO_Notify_ProxyConsumer * TAO_Notify_EventChannel::find_proxy_consumer TAO_Notify::IdVec id_path,
size_t  position
 

Definition at line 513 of file EventChannel.cpp.

References TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::find(), TAO_Notify_SupplierAdmin::find_proxy_consumer(), TAO_Notify::IdVec, ACE_Vector< T, DEFAULT_SIZE >::size(), and TAO_Notify_SupplierAdmin_Find_Worker.

Referenced by TAO_Notify_EventChannelFactory::find_proxy_consumer().

00514 {
00515   TAO_Notify_ProxyConsumer * result = 0;
00516   size_t path_size = id_path.size ();
00517   if (position < path_size)
00518   {
00519     TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00520     TAO_Notify_SupplierAdmin * admin = find_worker.find (id_path[position], this->sa_container());
00521     ++position;
00522     if (admin != 0)
00523     {
00524       result = admin->find_proxy_consumer (id_path, position);
00525     }
00526   }
00527   return result;
00528 }

TAO_Notify_ProxySupplier * TAO_Notify_EventChannel::find_proxy_supplier TAO_Notify::IdVec id_path,
size_t  position
 

Definition at line 531 of file EventChannel.cpp.

References TAO_Notify_ConsumerAdmin::find_proxy_supplier(), TAO_Notify::IdVec, ACE_Vector< T, DEFAULT_SIZE >::size(), TAO_Notify_ConsumerAdmin, and TAO_Notify_ConsumerAdmin_Find_Worker.

Referenced by TAO_Notify_EventChannelFactory::find_proxy_supplier().

00532 {
00533   TAO_Notify_ProxySupplier * result = 0;
00534   size_t path_size = id_path.size ();
00535   if (position < path_size)
00536   {
00537     TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00538     TAO_Notify_ConsumerAdmin * admin = find_worker.find (id_path[position], this->ca_container());
00539     ++position;
00540     if (admin != 0)
00541     {
00542       result = admin->find_proxy_supplier (id_path, position);
00543     }
00544   }
00545   return result;
00546 }

CosEventChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::for_consumers void   )  [protected]
 

Definition at line 385 of file EventChannel.cpp.

References default_consumer_admin().

00386 {
00387   return this->default_consumer_admin();
00388 }

CosEventChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::for_suppliers void   )  [protected]
 

Definition at line 391 of file EventChannel.cpp.

References default_supplier_admin().

00392 {
00393   return this->default_supplier_admin ();
00394 }

CosNotification::AdminProperties * TAO_Notify_EventChannel::get_admin void   )  [protected]
 

Definition at line 371 of file EventChannel.cpp.

References ACE_NEW_THROW_EX, TAO_Notify_Object::admin_properties(), CosNotification::AdminProperties, and TAO_Notify_PropertySeq::populate().

00372 {
00373   CosNotification::AdminProperties_var properties;
00374 
00375   ACE_NEW_THROW_EX (properties,
00376                     CosNotification::AdminProperties (),
00377                     CORBA::NO_MEMORY ());
00378 
00379   this->admin_properties().populate (properties);
00380 
00381   return properties._retn ();
00382 }

CosNotifyChannelAdmin::AdminIDSeq * TAO_Notify_EventChannel::get_all_consumeradmins void   )  [protected]
 

Definition at line 349 of file EventChannel.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create(), and TAO_Notify_ConsumerAdmin_Seq_Worker.

00350 {
00351   TAO_Notify_ConsumerAdmin_Seq_Worker seq_worker;
00352 
00353   return seq_worker.create (this->ca_container());
00354 }

CosNotifyChannelAdmin::AdminIDSeq * TAO_Notify_EventChannel::get_all_supplieradmins void   )  [protected]
 

Definition at line 357 of file EventChannel.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create(), and TAO_Notify_SupplierAdmin_Seq_Worker.

00358 {
00359   TAO_Notify_SupplierAdmin_Seq_Worker seq_worker;
00360 
00361   return seq_worker.create (this->sa_container());
00362 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::get_consumeradmin CosNotifyChannelAdmin::AdminID  id  )  [protected]
 

Definition at line 333 of file EventChannel.cpp.

References CosNotifyChannelAdmin::AdminID, and TAO_Notify_ConsumerAdmin_Find_Worker.

00334 {
00335   TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00336 
00337   return find_worker.resolve (id, this->ca_container());
00338 }

virtual TAO_Notify_Object::ID TAO_Notify_EventChannel::get_id  )  const [inline, virtual]
 

Find the id associated with topology object.

A bit of a hack because id is unknown to Topology_Object the get_id returns the same thing as id -- we just need someone to find it for us.

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 91 of file EventChannel.h.

References TAO_Notify_Object::ID.

00091 {return id();}

CosNotification::QoSProperties * TAO_Notify_EventChannel::get_qos void   )  [protected]
 

Get the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 244 of file EventChannel.cpp.

References TAO_Notify_Object::get_qos().

00245 {
00246   return this->TAO_Notify_Object::get_qos ();
00247 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::get_supplieradmin CosNotifyChannelAdmin::AdminID  id  )  [protected]
 

Definition at line 341 of file EventChannel.cpp.

References CosNotifyChannelAdmin::AdminID, TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::resolve(), and TAO_Notify_SupplierAdmin_Find_Worker.

00342 {
00343   TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00344 
00345   return find_worker.resolve (id, this->sa_container());
00346 }

void TAO_Notify_EventChannel::init TAO_Notify::Topology_Parent parent  ) 
 

Init (for reload).

Definition at line 120 of file EventChannel.cpp.

References ACE_ASSERT, ACE_NEW_THROW_EX, ca_container(), ca_container_, TAO_Notify_Properties::default_event_channel_qos_properties(), ecf_, TAO_Notify_Object::event_manager(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Notify_Properties::instance(), CosNotification::QoSProperties, ACE_Auto_Basic_Ptr< X >::reset(), sa_container(), sa_container_, TAO_Notify_Object::set_admin_properties(), TAO_Notify_Object::set_event_manager(), set_qos(), TAO_Notify_ConsumerAdmin_Container, and TAO_Notify_SupplierAdmin_Container.

00121 {
00122   ACE_ASSERT (this->ecf_.get() == 0);
00123   // this-> on the following line confuses VC6
00124   initialize (parent);
00125 
00126   this->ecf_.reset (dynamic_cast <TAO_Notify_EventChannelFactory*>(parent));
00127   ACE_ASSERT (this->ecf_.get() !=0);
00128 
00129   // Init ca_container_
00130   TAO_Notify_ConsumerAdmin_Container* ca_container = 0;
00131   ACE_NEW_THROW_EX (ca_container,
00132                     TAO_Notify_ConsumerAdmin_Container (),
00133                     CORBA::INTERNAL ());
00134   this->ca_container_.reset (ca_container);
00135 
00136   this->ca_container().init ();
00137 
00138   TAO_Notify_SupplierAdmin_Container* sa_container = 0;
00139   // Init ca_container_
00140   ACE_NEW_THROW_EX (sa_container,
00141                     TAO_Notify_SupplierAdmin_Container (),
00142                     CORBA::INTERNAL ());
00143   this->sa_container_.reset (sa_container);
00144 
00145   this->sa_container().init ();
00146 
00147   // Set the admin properties.
00148   TAO_Notify_AdminProperties* admin_properties = 0;
00149   ACE_NEW_THROW_EX (admin_properties,
00150                     TAO_Notify_AdminProperties (),
00151                     CORBA::NO_MEMORY ());
00152   this->set_admin_properties (admin_properties);
00153 
00154   // create the event manager. @@ use factory
00155   TAO_Notify_Event_Manager* event_manager = 0;
00156   ACE_NEW_THROW_EX (event_manager,
00157                     TAO_Notify_Event_Manager (),
00158                     CORBA::INTERNAL ());
00159   this->set_event_manager (event_manager);
00160 
00161   this->event_manager().init ();
00162 
00163   const CosNotification::QoSProperties &default_ec_qos =
00164     TAO_Notify_PROPERTIES::instance ()->default_event_channel_qos_properties ();
00165 
00166   this->set_qos (default_ec_qos);
00167 
00168 }

void TAO_Notify_EventChannel::init TAO_Notify_EventChannelFactory ecf,
const CosNotification::QoSProperties initial_qos,
const CosNotification::AdminProperties initial_admin
 

Init.

Definition at line 58 of file EventChannel.cpp.

References ACE_ASSERT, ACE_NEW_THROW_EX, CosNotification::AdminProperties, ca_container(), ca_container_, TAO_Notify_Properties::default_event_channel_qos_properties(), ecf_, TAO_Notify_Object::event_manager(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Notify_Properties::instance(), CosNotification::QoSProperties, ACE_Auto_Basic_Ptr< X >::reset(), sa_container(), sa_container_, set_admin(), TAO_Notify_Object::set_admin_properties(), TAO_Notify_Object::set_event_manager(), set_qos(), TAO_Notify_ConsumerAdmin_Container, and TAO_Notify_SupplierAdmin_Container.

Referenced by TAO_Notify_Builder::build_event_channel().

00061 {
00062   ACE_ASSERT (this->ca_container_.get() == 0);
00063 
00064   // this-> on the following line confuses VC6
00065   initialize (ecf);
00066 
00067   this->ecf_.reset (ecf);
00068 
00069   // Init ca_container_
00070   TAO_Notify_ConsumerAdmin_Container* ca_container = 0;
00071   ACE_NEW_THROW_EX (ca_container,
00072                     TAO_Notify_ConsumerAdmin_Container (),
00073                     CORBA::INTERNAL ());
00074   this->ca_container_.reset (ca_container);
00075 
00076   this->ca_container().init ();
00077 
00078   // Init ca_container_
00079   TAO_Notify_SupplierAdmin_Container* sa_container = 0;
00080   ACE_NEW_THROW_EX (sa_container,
00081                     TAO_Notify_SupplierAdmin_Container (),
00082                     CORBA::INTERNAL ());
00083   this->sa_container_.reset (sa_container);
00084 
00085   this->sa_container().init ();
00086 
00087   // Set the admin properties.
00088   TAO_Notify_AdminProperties* admin_properties = 0;
00089   ACE_NEW_THROW_EX (admin_properties,
00090                     TAO_Notify_AdminProperties (),
00091                     CORBA::NO_MEMORY ());
00092   this->set_admin_properties (admin_properties);
00093 
00094   // create the event manager. @@ use factory
00095   TAO_Notify_Event_Manager* event_manager = 0;
00096   ACE_NEW_THROW_EX (event_manager,
00097                     TAO_Notify_Event_Manager (),
00098                     CORBA::INTERNAL ());
00099   this->set_event_manager (event_manager);
00100 
00101   this->event_manager().init ();
00102 
00103   const CosNotification::QoSProperties &default_ec_qos =
00104     TAO_Notify_PROPERTIES::instance ()->default_event_channel_qos_properties ();
00105 
00106   this->set_qos (default_ec_qos);
00107 
00108   this->set_qos (initial_qos);
00109 
00110   this->set_admin (initial_admin);
00111 
00112   // Note originally default admins were allocated here, bt this caused problems
00113   // attempting to save the topology changes before the Event Channel was completely
00114   // constructed and linked to the ECF.
00115   // Lazy evaluation also avoids creating unneded admins.
00116 }

void TAO_Notify_EventChannel::load_attrs const TAO_Notify::NVPList attrs  )  [virtual]
 

Load our attributes. Each derived type should call the superclass load first before loading its own attributes.

Reimplemented from TAO_Notify_Object.

Definition at line 451 of file EventChannel.cpp.

References TAO_Notify_Object::admin_properties(), TAO_Notify_AdminProperties::init(), TAO_Notify::NVPList::load(), and TAO_Notify_Object::load_attrs().

Referenced by TAO_Notify_EventChannelFactory::load_child().

00452 {
00453   TAO_Notify_Object::load_attrs(attrs);
00454   attrs.load(this->admin_properties().max_global_queue_length());
00455   attrs.load(this->admin_properties().max_consumers());
00456   attrs.load(this->admin_properties().max_suppliers());
00457   attrs.load(this->admin_properties().reject_new_events());
00458   this->admin_properties().init();
00459 }

TAO_Notify::Topology_Object * TAO_Notify_EventChannel::load_child const ACE_CString type,
CORBA::Long  id,
const TAO_Notify::NVPList attrs
[virtual]
 

Definition at line 462 of file EventChannel.cpp.

References ACE_DEBUG, ACE_TEXT(), TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Builder::build_supplier_admin(), TAO_Notify_Properties::builder(), DEBUG_LEVEL, default_consumer_admin_, default_supplier_admin_, TAO_Notify_Properties::instance(), TAO_Notify_Admin::is_default(), LM_DEBUG, TAO_Notify_Admin::load_attrs(), TAO_Notify_Object::poa(), TAO_Notify_POA_Helper::servant_to_reference(), and TAO_Notify_ConsumerAdmin.

00465 {
00466   TAO_Notify::Topology_Object* result = this;
00467   if (type == "consumer_admin")
00468   {
00469     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00470       ACE_TEXT ("(%P|%t) EventChannel reload consumer_admin %d\n")
00471       , static_cast<int> (id)
00472       ));
00473 
00474     // call special builder method to reload
00475     TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00476     TAO_Notify_ConsumerAdmin * ca = bld->build_consumer_admin (
00477       this,
00478       id);
00479     ca->load_attrs (attrs);
00480     if (ca->is_default ())
00481       {
00482         CORBA::Object_var caob = this->poa()->servant_to_reference (ca);
00483         this->default_consumer_admin_ =
00484           CosNotifyChannelAdmin::ConsumerAdmin::_narrow (
00485           caob.in ());
00486       }
00487     result = ca;
00488   }
00489   else if (type == "supplier_admin")
00490   {
00491     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00492       ACE_TEXT ("(%P|%t) EventChannel reload supplier_admin %d\n")
00493       , static_cast<int> (id)
00494       ));
00495     TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00496 
00497     TAO_Notify_SupplierAdmin * sa = bld->build_supplier_admin (
00498       this,
00499       id);
00500     sa->load_attrs (attrs);
00501     if (sa->is_default ())
00502       {
00503         CORBA::Object_var saob = this->poa()->servant_to_reference (sa);
00504         this->default_supplier_admin_ =
00505           CosNotifyChannelAdmin::SupplierAdmin::_narrow (
00506           saob.in ());
00507       }
00508     result = sa;
00509   }
00510   return result;
00511 }

CosNotifyChannelAdmin::EventChannelFactory_ptr TAO_Notify_EventChannel::MyFactory  )  [protected]
 

=CosNotifyChannelAdmin::EventChannel methods

Definition at line 250 of file EventChannel.cpp.

References ecf_.

00251 {
00252   return this->ecf_->_this ();
00253 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::new_for_consumers CosNotifyChannelAdmin::InterFilterGroupOperator  op,
CosNotifyChannelAdmin::AdminID_out  id
[protected]
 

Definition at line 310 of file EventChannel.cpp.

References TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Properties::builder(), TAO_Notify_Properties::instance(), and TAO_Notify::Topology_Object::self_change().

Referenced by default_consumer_admin().

00314 {
00315   ::CosNotifyChannelAdmin::ConsumerAdmin_var ca =
00316     TAO_Notify_PROPERTIES::instance()->builder()->build_consumer_admin (this, op, id);
00317   this->self_change ();
00318   return ca._retn ();
00319 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::new_for_suppliers CosNotifyChannelAdmin::InterFilterGroupOperator  op,
CosNotifyChannelAdmin::AdminID_out  id
[protected]
 

Definition at line 322 of file EventChannel.cpp.

References TAO_Notify_Builder::build_supplier_admin(), TAO_Notify_Properties::builder(), TAO_Notify_Properties::instance(), and TAO_Notify::Topology_Object::self_change().

Referenced by default_supplier_admin().

00325 {
00326   ::CosNotifyChannelAdmin::SupplierAdmin_var sa =
00327     TAO_Notify_PROPERTIES::instance()->builder()->build_supplier_admin (this, op, id);
00328   this->self_change ();
00329   return sa._retn ();
00330 }

void TAO_Notify_EventChannel::reconnect void   )  [virtual]
 

Re-establish connections that we had before a shutdown.

After a topology restore, this method is called so we can reconnect to any external objects with whom we were interacting. We should call the reconnect() method on all of our children to give them the chance to do the same.

Reimplemented from TAO_Notify::Topology_Savable.

Definition at line 550 of file EventChannel.cpp.

References ca_container(), TAO_Notify_Container_T< TYPE >::collection(), and sa_container().

00551 {
00552   TAO_Notify::Reconnect_Worker<TAO_Notify_ConsumerAdmin> ca_wrk;
00553   this->ca_container().collection()->for_each(&ca_wrk);
00554 
00555   TAO_Notify::Reconnect_Worker<TAO_Notify_SupplierAdmin> sa_wrk;
00556   this->sa_container().collection()->for_each(&sa_wrk);
00557 }

void TAO_Notify_EventChannel::release void   )  [private, virtual]
 

Release.

Implements TAO_Notify_Refcountable.

Definition at line 184 of file EventChannel.cpp.

00185 {
00186   delete this;
00187   //@@ inform factory
00188 }

void TAO_Notify_EventChannel::remove TAO_Notify_SupplierAdmin supplier_admin  ) 
 

Remove SupplierAdmin from its container.

Definition at line 232 of file EventChannel.cpp.

References TAO_Notify_Container_T< TYPE >::remove(), and sa_container().

00233 {
00234   this->sa_container().remove (supplier_admin);
00235 }

void TAO_Notify_EventChannel::remove TAO_Notify_ConsumerAdmin consumer_admin  ) 
 

Remove ConsumerAdmin from its container.

Definition at line 226 of file EventChannel.cpp.

References ca_container(), and TAO_Notify_Container_T< TYPE >::remove().

00227 {
00228   this->ca_container().remove (consumer_admin);
00229 }

TAO_Notify_EventChannel::TAO_Notify_SupplierAdmin_Container & TAO_Notify_EventChannel::sa_container  )  [private]
 

Definition at line 567 of file EventChannel.cpp.

References ACE_ASSERT, and sa_container_.

Referenced by TAO_Notify_Builder::build_supplier_admin(), destroy(), init(), reconnect(), remove(), save_persistent(), and shutdown().

00568 {
00569   ACE_ASSERT( this->sa_container_.get() != 0 );
00570   return *sa_container_;
00571 }

void TAO_Notify_EventChannel::save_attrs TAO_Notify::NVPList attrs  )  [private, virtual]
 

Called by derived types to save their attributes. Each derived type should call its superclass version before saving its own attrs.

Reimplemented from TAO_Notify_Object.

Definition at line 441 of file EventChannel.cpp.

References add_attr(), and TAO_Notify_Object::save_attrs().

Referenced by save_persistent().

00442 {
00443   TAO_Notify_Object::save_attrs(attrs);
00444   add_attr(attrs, this->admin_properties().max_global_queue_length());
00445   add_attr(attrs, this->admin_properties().max_consumers());
00446   add_attr(attrs, this->admin_properties().max_suppliers());
00447   add_attr(attrs, this->admin_properties().reject_new_events());
00448 }

void TAO_Notify_EventChannel::save_persistent TAO_Notify::Topology_Saver saver  )  [virtual]
 

Save our state to a Topology_Saver.

Use the methods of a Topology_Saver to store all information we want persisted. This function is called by our parent, which gives us a saver to use. In turn, we must call this function on all of our children. The implementation should look like: bool change = this->self_changed_; this->self_changed_ = false; this->children_changed_ = false; if (is_persistent ()) { bool want_all_children = saver.begin_object( this->id(), type, attrs, change); for all children { if (want_all_children || child.is_changed()) { child.save_persistent(saver); } } for all deleted children { saver.delete_child(child_type, child_id); } saver.end_object(this->id(), type); )

Implements TAO_Notify::Topology_Savable.

Definition at line 405 of file EventChannel.cpp.

References TAO_Notify::Topology_Saver::begin_object(), ca_container(), TAO_Notify_Container_T< TYPE >::collection(), TAO_Notify::Topology_Saver::end_object(), TAO_Notify::Topology_Object::is_persistent(), sa_container(), and save_attrs().

00406 {
00407   bool changed = this->self_changed_;
00408   this->self_changed_ = false;
00409   this->children_changed_ = false;
00410 
00411   if (is_persistent ())
00412   {
00413     TAO_Notify::NVPList attrs;
00414     this->save_attrs(attrs);
00415 
00416     bool want_all_children = saver.begin_object(
00417       this->id(), "channel", attrs, changed);
00418 
00419     TAO_Notify::Save_Persist_Worker<TAO_Notify_ConsumerAdmin> ca_wrk(saver, want_all_children);
00420 
00421     this->ca_container().collection()->for_each(&ca_wrk);
00422 
00423     TAO_Notify::Save_Persist_Worker<TAO_Notify_SupplierAdmin> sa_wrk(saver, want_all_children);
00424     this->sa_container().collection()->for_each(&sa_wrk);
00425 
00426     saver.end_object(this->id(), "channel");
00427   }
00428 }

void TAO_Notify_EventChannel::set_admin const CosNotification::AdminProperties admin  )  [protected, virtual]
 

Definition at line 365 of file EventChannel.cpp.

References TAO_Notify_Object::admin_properties(), CosNotification::AdminProperties, and TAO_Notify_AdminProperties::init().

Referenced by init().

00366 {
00367   this->admin_properties().init (admin);
00368 }

void TAO_Notify_EventChannel::set_qos const CosNotification::QoSProperties qos  )  [protected, virtual]
 

Set the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 238 of file EventChannel.cpp.

References CosNotification::QoSProperties, and TAO_Notify_Object::set_qos().

Referenced by init().

00239 {
00240   this->TAO_Notify_Object::set_qos (qos);
00241 }

int TAO_Notify_EventChannel::shutdown void   )  [virtual]
 

Shutdown.

Reimplemented from TAO_Notify_Object.

Definition at line 191 of file EventChannel.cpp.

References ca_container(), TAO_Notify_Object::event_manager(), sa_container(), TAO_Notify_Event_Manager::shutdown(), TAO_Notify_Container_T< TYPE >::shutdown(), and TAO_Notify_Object::shutdown().

Referenced by destroy().

00192 {
00193   int sd_ret = TAO_Notify_Object::shutdown ();
00194 
00195   if (sd_ret == 1)
00196     return 1;
00197 
00198   this->ca_container().shutdown ();
00199 
00200   this->sa_container().shutdown ();
00201 
00202   this->event_manager().shutdown ();
00203 
00204   return 0;
00205 }

void TAO_Notify_EventChannel::validate_qos const CosNotification::QoSProperties required_qos,
CosNotification::NamedPropertyRangeSeq_out  available_qos
[protected, virtual]
 

Definition at line 397 of file EventChannel.cpp.

References CosNotification::QoSProperties.

00400 {
00401   throw CORBA::NO_IMPLEMENT ();
00402 }


Friends And Related Function Documentation

friend class TAO_Notify_Builder [friend]
 

Reimplemented from TAO_Notify_Object.

Definition at line 52 of file EventChannel.h.


Member Data Documentation

ACE_Auto_Ptr< TAO_Notify_ConsumerAdmin_Container > TAO_Notify_EventChannel::ca_container_ [private]
 

ConsumerAdmin Container.

Definition at line 171 of file EventChannel.h.

Referenced by TAO_Notify_Builder::build_consumer_admin(), ca_container(), destroy(), and init().

TAO_SYNCH_MUTEX TAO_Notify_EventChannel::default_admin_mutex_ [private]
 

Definition at line 113 of file EventChannel.h.

CosNotifyChannelAdmin::ConsumerAdmin_var TAO_Notify_EventChannel::default_consumer_admin_ [private]
 

Definition at line 116 of file EventChannel.h.

Referenced by default_consumer_admin(), and load_child().

CosNotifyChannelAdmin::SupplierAdmin_var TAO_Notify_EventChannel::default_supplier_admin_ [private]
 

Definition at line 119 of file EventChannel.h.

Referenced by default_supplier_admin(), and load_child().

TAO_Notify_EventChannelFactory::Ptr TAO_Notify_EventChannel::ecf_ [private]
 

= Data Members The parent object.

Definition at line 111 of file EventChannel.h.

Referenced by default_filter_factory(), destroy(), init(), and MyFactory().

ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Container > TAO_Notify_EventChannel::sa_container_ [private]
 

SupplierAdmin Container.

Definition at line 174 of file EventChannel.h.

Referenced by destroy(), init(), and sa_container().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 15:49:08 2008 for TAO_CosNotification by doxygen 1.3.6