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)
 Constructor.
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)
 Create a child of the appropriate type and return it.
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 void cleanup_proxy (CosNotifyChannelAdmin::ProxyID id, bool is_supplier)
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.
virtual CosNotifyChannelAdmin::ConsumerAdmin_ptr get_consumeradmin (CosNotifyChannelAdmin::AdminID id)
 This is public to allow TAO_MonitorConsumerAdmin access.
virtual CosNotifyChannelAdmin::SupplierAdmin_ptr get_supplieradmin (CosNotifyChannelAdmin::AdminID id)
 This is public to allow TAO_MonitorSupplierAdmin access.

Protected Member Functions

virtual ::CosNotifyChannelAdmin::EventChannelFactory_ptr MyFactory ()
 =CosNotifyChannelAdminEventChannel methods
virtual ::CosNotifyChannelAdmin::ConsumerAdmin_ptr default_consumer_admin (void)
virtual ::CosNotifyChannelAdmin::SupplierAdmin_ptr default_supplier_admin (void)
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::AdminIDSeqget_all_consumeradmins (void)
virtual ::CosNotifyChannelAdmin::AdminIDSeqget_all_supplieradmins (void)
virtual ::CosNotification::QoSPropertiesget_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::AdminPropertiesget_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_
 Default Consumer Admin.
CosNotifyChannelAdmin::SupplierAdmin_var default_supplier_admin_
 Default Supplier Admin.
ACE_Auto_Ptr< TAO_Notify_ConsumerAdmin_Containerca_container_
 ConsumerAdmin Container.
ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Containersa_container_
 SupplierAdmin Container.
CosNotifyFilter::FilterFactory_var default_filter_factory_
 The default filter factory.

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.

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 116 of file EventChannel.h.

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

Definition at line 117 of file EventChannel.h.


Constructor & Destructor Documentation

TAO_Notify_EventChannel::TAO_Notify_EventChannel ( void   ) 

Constructor.

Definition at line 46 of file EventChannel.cpp.

00047   : ecf_ (0)
00048   , ca_container_ (0)
00049   , sa_container_ (0)
00050   , default_filter_factory_ (CosNotifyFilter::FilterFactory::_nil ())
00051 {
00052 }

TAO_Notify_EventChannel::~TAO_Notify_EventChannel (  )  [virtual]

Destructor.

Definition at line 54 of file EventChannel.cpp.

00055 {
00056 }


Member Function Documentation

void TAO_Notify_EventChannel::_add_ref ( void   )  [virtual]

ServantBase refcount methods.

Definition at line 180 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_incr_refcnt().

00181 {
00182   this->_incr_refcnt ();
00183 }

void TAO_Notify_EventChannel::_remove_ref ( void   )  [virtual]

Definition at line 186 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_decr_refcnt().

00187 {
00188   this->_decr_refcnt ();
00189 }

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

Definition at line 570 of file EventChannel.cpp.

References ACE_ASSERT, and ca_container_.

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

00571 {
00572   ACE_ASSERT( this->ca_container_.get() != 0 );
00573   return *ca_container_;
00574 }

void TAO_Notify_EventChannel::cleanup_proxy ( CosNotifyChannelAdmin::ProxyID  id,
bool  is_supplier 
) [virtual]

Definition at line 199 of file EventChannel.cpp.

00200 { }

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

Definition at line 269 of file EventChannel.cpp.

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

Referenced by for_consumers().

00270 {
00271   if (CORBA::is_nil (default_consumer_admin_.in ()))
00272     {
00273       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::ConsumerAdmin::_nil());
00274       if (CORBA::is_nil (default_consumer_admin_.in ()))
00275         {
00276           CosNotifyChannelAdmin::AdminID id;
00277           this->default_consumer_admin_ = this->new_for_consumers (CosNotifyChannelAdmin::OR_OP, id);
00278           // Wish there was a better way to do this!
00279           PortableServer::ServantBase * admin_servant =
00280             this->poa()->reference_to_servant (
00281               this->default_consumer_admin_.in ());
00282           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00283           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00284           if (pAdmin != 0)
00285             {
00286               pAdmin->set_default (true);
00287             }
00288         }
00289     }
00290   return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (this->default_consumer_admin_.in ());
00291 }

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

Definition at line 318 of file EventChannel.cpp.

00319 {
00320   return CosNotifyFilter::FilterFactory::_duplicate (this->default_filter_factory_.in ());
00321 }

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

Definition at line 294 of file EventChannel.cpp.

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

Referenced by for_suppliers().

00295 {
00296   if (CORBA::is_nil (default_supplier_admin_.in ()))
00297     {
00298       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::SupplierAdmin::_nil());
00299       if (CORBA::is_nil (default_supplier_admin_.in ()))
00300         {
00301           CosNotifyChannelAdmin::AdminID id;
00302           this->default_supplier_admin_ = this->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, id);
00303           PortableServer::ServantBase * admin_servant =
00304             this->poa()->poa()->reference_to_servant (
00305               this->default_supplier_admin_.in ());
00306           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00307           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00308           if (pAdmin != 0)
00309             {
00310               pAdmin->set_default (true);
00311             }
00312         }
00313     }
00314   return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (this->default_supplier_admin_.in ());
00315 }

void TAO_Notify_EventChannel::destroy ( void   )  [virtual]

TAO_Notify_Container_T requires a destroy method.

Definition at line 220 of file EventChannel.cpp.

References ca_container(), ca_container_, default_filter_factory_, TAO_Notify_Container_T< TYPE >::destroy(), ecf_, sa_container(), and sa_container_.

Referenced by TAO_CosNotify_Service::finalize_service().

00221 {
00222   TAO_Notify_EventChannel::Ptr guard( this );
00223 
00224   if (this->shutdown () == 1)
00225     return;
00226 
00227   this->ecf_->remove (this);
00228 
00229   this->sa_container ().destroy ();
00230   this->ca_container ().destroy ();
00231 
00232   this->sa_container_.reset( 0 );
00233   this->ca_container_.reset( 0 );
00234 
00235   this->default_filter_factory_ = CosNotifyFilter::FilterFactory::_nil();
00236 }

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

Definition at line 523 of file EventChannel.cpp.

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

Referenced by TAO_Notify_EventChannelFactory::find_proxy_consumer().

00524 {
00525   TAO_Notify_ProxyConsumer * result = 0;
00526   size_t path_size = id_path.size ();
00527   if (position < path_size)
00528   {
00529     TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00530     TAO_Notify_SupplierAdmin * admin = find_worker.find (id_path[position], this->sa_container());
00531     ++position;
00532     if (admin != 0)
00533     {
00534       result = admin->find_proxy_consumer (id_path, position);
00535     }
00536   }
00537   return result;
00538 }

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

Definition at line 541 of file EventChannel.cpp.

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

Referenced by TAO_Notify_EventChannelFactory::find_proxy_supplier().

00542 {
00543   TAO_Notify_ProxySupplier * result = 0;
00544   size_t path_size = id_path.size ();
00545   if (position < path_size)
00546   {
00547     TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00548     TAO_Notify_ConsumerAdmin * admin = find_worker.find (id_path[position], this->ca_container());
00549     ++position;
00550     if (admin != 0)
00551     {
00552       result = admin->find_proxy_supplier (id_path, position);
00553     }
00554   }
00555   return result;
00556 }

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

Definition at line 396 of file EventChannel.cpp.

References default_consumer_admin().

00397 {
00398   return this->default_consumer_admin();
00399 }

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

Definition at line 402 of file EventChannel.cpp.

References default_supplier_admin().

00403 {
00404   return this->default_supplier_admin ();
00405 }

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

Definition at line 382 of file EventChannel.cpp.

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

00383 {
00384   CosNotification::AdminProperties_var properties;
00385 
00386   ACE_NEW_THROW_EX (properties,
00387                     CosNotification::AdminProperties (),
00388                     CORBA::NO_MEMORY ());
00389 
00390   this->admin_properties().populate (properties);
00391 
00392   return properties._retn ();
00393 }

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

Definition at line 360 of file EventChannel.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create().

00361 {
00362   TAO_Notify_ConsumerAdmin_Seq_Worker seq_worker;
00363 
00364   return seq_worker.create (this->ca_container());
00365 }

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

Definition at line 368 of file EventChannel.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create().

00369 {
00370   TAO_Notify_SupplierAdmin_Seq_Worker seq_worker;
00371 
00372   return seq_worker.create (this->sa_container());
00373 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::get_consumeradmin ( CosNotifyChannelAdmin::AdminID  id  )  [virtual]

This is public to allow TAO_MonitorConsumerAdmin access.

Definition at line 344 of file EventChannel.cpp.

References TAO_Notify_ConsumerAdmin_Find_Worker.

00345 {
00346   TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00347 
00348   return find_worker.resolve (id, this->ca_container());
00349 }

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.

00091 {return id();}

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

Get the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 257 of file EventChannel.cpp.

References TAO_Notify_Object::get_qos().

00258 {
00259   return this->TAO_Notify_Object::get_qos ();
00260 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::get_supplieradmin ( CosNotifyChannelAdmin::AdminID  id  )  [virtual]

This is public to allow TAO_MonitorSupplierAdmin access.

Definition at line 352 of file EventChannel.cpp.

References TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::resolve().

00353 {
00354   TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00355 
00356   return find_worker.resolve (id, this->sa_container());
00357 }

void TAO_Notify_EventChannel::init ( TAO_Notify::Topology_Parent parent  ) 

Init (for reload).

Definition at line 125 of file EventChannel.cpp.

References ACE_ASSERT, ACE_NEW_THROW_EX, TAO_Notify_Object::admin_properties(), TAO_Notify_Builder::build_filter_factory(), TAO_Notify_Properties::builder(), ca_container(), ca_container_, TAO_Notify_Properties::default_event_channel_qos_properties(), default_filter_factory_, TAO_Notify_Properties::default_poa(), ecf_, TAO_Notify_Object::event_manager(), TAO_Objref_Var_T< T >::in(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Notify_Properties::instance(), TAO_Notify_Refcountable_Guard_T< T >::reset(), sa_container(), sa_container_, TAO_Notify_Object::set_admin_properties(), TAO_Notify_Object::set_event_manager(), and set_qos().

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

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

Init.

Definition at line 59 of file EventChannel.cpp.

References ACE_ASSERT, ACE_NEW_THROW_EX, TAO_Notify_Object::admin_properties(), TAO_Notify_Builder::build_filter_factory(), TAO_Notify_Properties::builder(), ca_container(), ca_container_, TAO_Notify_Properties::default_event_channel_qos_properties(), default_filter_factory_, TAO_Notify_Properties::default_poa(), ecf_, TAO_Notify_Object::event_manager(), TAO_Objref_Var_T< T >::in(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Notify_Properties::instance(), TAO_Notify_Refcountable_Guard_T< T >::reset(), sa_container(), sa_container_, set_admin(), TAO_Notify_Object::set_admin_properties(), TAO_Notify_Object::set_event_manager(), and set_qos().

Referenced by TAO_Notify_Builder::build_event_channel().

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

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 461 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().

00462 {
00463   TAO_Notify_Object::load_attrs(attrs);
00464   attrs.load(this->admin_properties().max_global_queue_length());
00465   attrs.load(this->admin_properties().max_consumers());
00466   attrs.load(this->admin_properties().max_suppliers());
00467   attrs.load(this->admin_properties().reject_new_events());
00468   this->admin_properties().init();
00469 }

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

Create a child of the appropriate type and return it.

Use "type" as passed in to determine what kind of child (supporting the Topology_Object interface) to create and return. Inform it of its new ID.

Reimplemented from TAO_Notify::Topology_Object.

Definition at line 472 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, and TAO_Notify_Admin::load_attrs().

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

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

=CosNotifyChannelAdminEventChannel methods

Definition at line 263 of file EventChannel.cpp.

References ecf_.

00264 {
00265   return this->ecf_->_this ();
00266 }

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

Definition at line 324 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().

00326 {
00327   ::CosNotifyChannelAdmin::ConsumerAdmin_var ca =
00328     TAO_Notify_PROPERTIES::instance()->builder()->build_consumer_admin (this, op, id);
00329   this->self_change ();
00330   return ca._retn ();
00331 }

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

Definition at line 334 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().

00336 {
00337   ::CosNotifyChannelAdmin::SupplierAdmin_var sa =
00338     TAO_Notify_PROPERTIES::instance()->builder()->build_supplier_admin (this, op, id);
00339   this->self_change ();
00340   return sa._retn ();
00341 }

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 560 of file EventChannel.cpp.

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

00561 {
00562   TAO_Notify::Reconnect_Worker<TAO_Notify_ConsumerAdmin> ca_wrk;
00563   this->ca_container().collection()->for_each(&ca_wrk);
00564 
00565   TAO_Notify::Reconnect_Worker<TAO_Notify_SupplierAdmin> sa_wrk;
00566   this->sa_container().collection()->for_each(&sa_wrk);
00567 }

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

Release.

Implements TAO_Notify_Refcountable.

Definition at line 192 of file EventChannel.cpp.

00193 {
00194   delete this;
00195   //@@ inform factory
00196 }

void TAO_Notify_EventChannel::remove ( TAO_Notify_SupplierAdmin supplier_admin  ) 

Remove SupplierAdmin from its container.

Definition at line 245 of file EventChannel.cpp.

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

00246 {
00247   this->sa_container().remove (supplier_admin);
00248 }

void TAO_Notify_EventChannel::remove ( TAO_Notify_ConsumerAdmin consumer_admin  ) 

Remove ConsumerAdmin from its container.

Definition at line 239 of file EventChannel.cpp.

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

00240 {
00241   this->ca_container().remove (consumer_admin);
00242 }

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

Definition at line 577 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().

00578 {
00579   ACE_ASSERT( this->sa_container_.get() != 0 );
00580   return *sa_container_;
00581 }

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 451 of file EventChannel.cpp.

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

Referenced by save_persistent().

00452 {
00453   TAO_Notify_Object::save_attrs(attrs);
00454   add_attr(attrs, this->admin_properties().max_global_queue_length());
00455   add_attr(attrs, this->admin_properties().max_consumers());
00456   add_attr(attrs, this->admin_properties().max_suppliers());
00457   add_attr(attrs, this->admin_properties().reject_new_events());
00458 }

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 415 of file EventChannel.cpp.

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

00416 {
00417   bool changed = this->self_changed_;
00418   this->self_changed_ = false;
00419   this->children_changed_ = false;
00420 
00421   if (is_persistent ())
00422   {
00423     TAO_Notify::NVPList attrs;
00424     this->save_attrs(attrs);
00425 
00426     bool want_all_children = saver.begin_object(
00427       this->id(), "channel", attrs, changed);
00428 
00429     TAO_Notify::Save_Persist_Worker<TAO_Notify_ConsumerAdmin> ca_wrk(saver, want_all_children);
00430 
00431     this->ca_container().collection()->for_each(&ca_wrk);
00432 
00433     TAO_Notify::Save_Persist_Worker<TAO_Notify_SupplierAdmin> sa_wrk(saver, want_all_children);
00434     this->sa_container().collection()->for_each(&sa_wrk);
00435 
00436     saver.end_object(this->id(), "channel");
00437   }
00438 }

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

Definition at line 376 of file EventChannel.cpp.

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

Referenced by init().

00377 {
00378   this->admin_properties().init (admin);
00379 }

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

Set the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 251 of file EventChannel.cpp.

References TAO_Notify_Object::set_qos().

Referenced by init().

00252 {
00253   this->TAO_Notify_Object::set_qos (qos);
00254 }

int TAO_Notify_EventChannel::shutdown ( void   )  [virtual]

Shutdown.

Reimplemented from TAO_Notify_Object.

Definition at line 203 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().

00204 {
00205   int sd_ret = TAO_Notify_Object::shutdown ();
00206 
00207   if (sd_ret == 1)
00208     return 1;
00209 
00210   this->ca_container().shutdown ();
00211 
00212   this->sa_container().shutdown ();
00213 
00214   this->event_manager().shutdown ();
00215 
00216   return 0;
00217 }

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

Definition at line 408 of file EventChannel.cpp.

00410 {
00411   throw CORBA::NO_IMPLEMENT ();
00412 }


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 174 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 125 of file EventChannel.h.

CosNotifyChannelAdmin::ConsumerAdmin_var TAO_Notify_EventChannel::default_consumer_admin_ [private]

Default Consumer Admin.

Definition at line 128 of file EventChannel.h.

Referenced by default_consumer_admin(), and load_child().

CosNotifyFilter::FilterFactory_var TAO_Notify_EventChannel::default_filter_factory_ [private]

The default filter factory.

Definition at line 180 of file EventChannel.h.

Referenced by destroy(), and init().

CosNotifyChannelAdmin::SupplierAdmin_var TAO_Notify_EventChannel::default_supplier_admin_ [private]

Default Supplier Admin.

Definition at line 131 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 123 of file EventChannel.h.

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

ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Container > TAO_Notify_EventChannel::sa_container_ [private]

SupplierAdmin Container.

Definition at line 177 of file EventChannel.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:19 2010 for TAO_CosNotification by  doxygen 1.4.7