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 ()
 ServantBase refcount methods.

virtual void _remove_ref ()
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 ()
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 ()
 Shutdown.

virtual void load_attrs (const TAO_Notify::NVPList &attrs)

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)
virtual void destroy () throw ( CORBA::SystemException )
 =CosNotifyChannelAdmin::EventChannel methods

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

virtual void set_qos (const CosNotification::QoSProperties &qos) throw ( CORBA::SystemException , CosNotification::UnsupportedQoS )
 Set the QoS Properties.

virtual void validate_qos (const CosNotification::QoSProperties &required_qos, CosNotification::NamedPropertyRangeSeq_out available_qos) throw ( CORBA::SystemException , CosNotification::UnsupportedQoS )
virtual::CosNotification::AdminProperties * get_admin () throw ( CORBA::SystemException )
virtual void set_admin (const CosNotification::AdminProperties &admin) throw ( CORBA::SystemException , CosNotification::UnsupportedAdmin )
virtual::CosEventChannelAdmin::ConsumerAdmin_ptr for_consumers () throw ( CORBA::SystemException )
virtual::CosEventChannelAdmin::SupplierAdmin_ptr for_suppliers () throw ( CORBA::SystemException )
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  )  [virtual]
 

ServantBase refcount methods.

Definition at line 191 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_incr_refcnt().

00192 {
00193   this->_incr_refcnt ();
00194 }

void TAO_Notify_EventChannel::_remove_ref  )  [virtual]
 

Definition at line 197 of file EventChannel.cpp.

References TAO_Notify_Refcountable::_decr_refcnt().

00198 {
00199   this->_decr_refcnt ();
00200 }

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

Definition at line 672 of file EventChannel.cpp.

References ACE_ASSERT, and ca_container_.

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

00673 {
00674   ACE_ASSERT( this->ca_container_.get() != 0 );
00675   return *ca_container_;
00676 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::default_consumer_admin  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 290 of file EventChannel.cpp.

References ACE_ASSERT, ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, CosNotifyChannelAdmin::AdminID, CORBA::is_nil(), TAO_Notify_Admin::set_default(), and TAO_SYNCH_MUTEX.

00294 {
00295   if (CORBA::is_nil (default_consumer_admin_.in ()))
00296     {
00297       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::ConsumerAdmin::_nil());
00298       if (CORBA::is_nil (default_consumer_admin_.in ()))
00299         {
00300           CosNotifyChannelAdmin::AdminID id;
00301           this->default_consumer_admin_ = this->new_for_consumers (CosNotifyChannelAdmin::OR_OP, id ACE_ENV_ARG_PARAMETER);
00302           ACE_CHECK_RETURN (CosNotifyChannelAdmin::ConsumerAdmin::_nil());
00303           // Wish there was a better way to do this!
00304           PortableServer::ServantBase * admin_servant =
00305             this->poa()->reference_to_servant (
00306               this->default_consumer_admin_.in ()
00307               ACE_ENV_ARG_PARAMETER);
00308           ACE_CHECK_RETURN (CosNotifyChannelAdmin::ConsumerAdmin::_nil());
00309           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00310           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00311           if (pAdmin != 0)
00312             {
00313               pAdmin->set_default (true);
00314             }
00315         }
00316     }
00317   return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (this->default_consumer_admin_.in ());
00318 }

CosNotifyFilter::FilterFactory_ptr TAO_Notify_EventChannel::default_filter_factory  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 350 of file EventChannel.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER.

00354 {
00355   return this->ecf_->get_default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
00356 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::default_supplier_admin  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 321 of file EventChannel.cpp.

References ACE_ASSERT, ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_GUARD_RETURN, CosNotifyChannelAdmin::AdminID, CORBA::is_nil(), TAO_Notify_Admin::set_default(), and TAO_SYNCH_MUTEX.

00325 {
00326   if (CORBA::is_nil (default_supplier_admin_.in ()))
00327     {
00328       ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->default_admin_mutex_, CosNotifyChannelAdmin::SupplierAdmin::_nil());
00329       if (CORBA::is_nil (default_supplier_admin_.in ()))
00330         {
00331           CosNotifyChannelAdmin::AdminID id;
00332           this->default_supplier_admin_ = this->new_for_suppliers (CosNotifyChannelAdmin::OR_OP, id ACE_ENV_ARG_PARAMETER);
00333           ACE_CHECK_RETURN (CosNotifyChannelAdmin::SupplierAdmin::_nil());
00334           PortableServer::ServantBase * admin_servant =
00335             this->poa()->poa()->reference_to_servant (
00336               this->default_supplier_admin_.in ()
00337               ACE_ENV_ARG_PARAMETER);
00338           ACE_CHECK_RETURN (0);
00339           TAO_Notify_Admin * pAdmin = dynamic_cast <TAO_Notify_Admin *> (admin_servant);
00340           ACE_ASSERT (pAdmin != 0); // if this assert triggers, we have mixed implementations?
00341           if (pAdmin != 0)
00342             {
00343               pAdmin->set_default (true);
00344             }
00345         }
00346     }
00347   return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (this->default_supplier_admin_.in ());
00348 }

void TAO_Notify_EventChannel::destroy  )  throw ( CORBA::SystemException ) [private, virtual]
 

=CosNotifyChannelAdmin::EventChannel methods

Definition at line 230 of file EventChannel.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, and Ptr.

00234 {
00235   TAO_Notify_EventChannel::Ptr guard( this );
00236 
00237   int result = this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00238   ACE_CHECK;
00239   if ( result == 1)
00240     return;
00241 
00242   this->ecf_->remove (this ACE_ENV_ARG_PARAMETER);
00243   ACE_CHECK;
00244 
00245   this->sa_container_.reset( 0 );
00246   this->ca_container_.reset( 0 );
00247 }

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

Definition at line 617 of file EventChannel.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, 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().

00618 {
00619   TAO_Notify_ProxyConsumer * result = 0;
00620   size_t path_size = id_path.size ();
00621   if (position < path_size)
00622   {
00623     TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00624     TAO_Notify_SupplierAdmin * admin = find_worker.find (id_path[position], this->sa_container() ACE_ENV_ARG_PARAMETER);
00625     ACE_CHECK_RETURN (0);
00626     ++position;
00627     if (admin != 0)
00628     {
00629       result = admin->find_proxy_consumer (id_path, position
00630         ACE_ENV_ARG_PARAMETER);
00631       ACE_CHECK_RETURN(0);
00632     }
00633   }
00634   return result;
00635 }

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

Definition at line 638 of file EventChannel.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, 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().

00639 {
00640   TAO_Notify_ProxySupplier * result = 0;
00641   size_t path_size = id_path.size ();
00642   if (position < path_size)
00643   {
00644     TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00645     TAO_Notify_ConsumerAdmin * admin = find_worker.find (id_path[position], this->ca_container() ACE_ENV_ARG_PARAMETER);
00646     ACE_CHECK_RETURN (0);
00647     ++position;
00648     if (admin != 0)
00649     {
00650       result = admin->find_proxy_supplier (id_path, position
00651         ACE_ENV_ARG_PARAMETER);
00652       ACE_CHECK_RETURN(0);
00653     }
00654   }
00655   return result;
00656 }

CosEventChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::for_consumers  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 466 of file EventChannel.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER.

00470 {
00471   return this->default_consumer_admin(ACE_ENV_SINGLE_ARG_PARAMETER);
00472 }

CosEventChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::for_suppliers  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 475 of file EventChannel.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER.

00479 {
00480   return this->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
00481 }

CosNotification::AdminProperties * TAO_Notify_EventChannel::get_admin  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 449 of file EventChannel.cpp.

References ACE_NEW_THROW_EX, and CosNotification::AdminProperties.

00453 {
00454   CosNotification::AdminProperties_var properties;
00455 
00456   ACE_NEW_THROW_EX (properties,
00457                     CosNotification::AdminProperties (),
00458                     CORBA::NO_MEMORY ());
00459 
00460   this->admin_properties().populate (properties);
00461 
00462   return properties._retn ();
00463 }

CosNotifyChannelAdmin::AdminIDSeq * TAO_Notify_EventChannel::get_all_consumeradmins  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 417 of file EventChannel.cpp.

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

00421 {
00422   TAO_Notify_ConsumerAdmin_Seq_Worker seq_worker;
00423 
00424   return seq_worker.create (this->ca_container() ACE_ENV_ARG_PARAMETER);
00425 }

CosNotifyChannelAdmin::AdminIDSeq * TAO_Notify_EventChannel::get_all_supplieradmins  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 428 of file EventChannel.cpp.

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

00432 {
00433   TAO_Notify_SupplierAdmin_Seq_Worker seq_worker;
00434 
00435   return seq_worker.create (this->sa_container() ACE_ENV_ARG_PARAMETER);
00436 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::get_consumeradmin CosNotifyChannelAdmin::AdminID  id  )  throw ( CORBA::SystemException , CosNotifyChannelAdmin::AdminNotFound ) [private]
 

Definition at line 393 of file EventChannel.cpp.

References ACE_ENV_ARG_PARAMETER, CosNotifyChannelAdmin::AdminID, and TAO_Notify_ConsumerAdmin_Find_Worker.

00398 {
00399   TAO_Notify_ConsumerAdmin_Find_Worker find_worker;
00400 
00401   return find_worker.resolve (id, this->ca_container() ACE_ENV_ARG_PARAMETER);
00402 }

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

References TAO_Notify_Object::ID.

00094 {return id();}

CosNotification::QoSProperties * TAO_Notify_EventChannel::get_qos  )  throw ( CORBA::SystemException ) [private]
 

Get the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 272 of file EventChannel.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER, and TAO_Notify_Object::get_qos().

00276 {
00277   return this->TAO_Notify_Object::get_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
00278 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::get_supplieradmin CosNotifyChannelAdmin::AdminID  id  )  throw ( CORBA::SystemException , CosNotifyChannelAdmin::AdminNotFound ) [private]
 

Definition at line 405 of file EventChannel.cpp.

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

00410 {
00411   TAO_Notify_SupplierAdmin_Find_Worker find_worker;
00412 
00413   return find_worker.resolve (id, this->sa_container() ACE_ENV_ARG_PARAMETER);
00414 }

void TAO_Notify_EventChannel::init TAO_Notify::Topology_Parent parent  ) 
 

Init (for reload).

Definition at line 131 of file EventChannel.cpp.

References ACE_ASSERT, ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, ca_container(), ca_container_, ecf_, TAO_Notify_Object::event_manager(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Singleton< TYPE, ACE_LOCK >::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.

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

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_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, CosNotification::AdminProperties, ca_container(), ca_container_, ecf_, TAO_Notify_Object::event_manager(), TAO_Notify_Event_Manager::init(), TAO_Notify_Container_T< TYPE >::init(), TAO_Notify::Topology_Object::initialize(), TAO_Singleton< TYPE, ACE_LOCK >::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().

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

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

00547 {
00548   TAO_Notify_Object::load_attrs(attrs);
00549   attrs.load(this->admin_properties().max_global_queue_length());
00550   attrs.load(this->admin_properties().max_consumers());
00551   attrs.load(this->admin_properties().max_suppliers());
00552   attrs.load(this->admin_properties().reject_new_events());
00553   this->admin_properties().init();
00554 }

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

References ACE_CHECK_RETURN, ACE_DEBUG, ACE_ENV_ARG_PARAMETER, ACE_TEXT(), TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Builder::build_supplier_admin(), DEBUG_LEVEL, default_consumer_admin_, default_supplier_admin_, TAO_Singleton< TYPE, ACE_LOCK >::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.

00561 {
00562   TAO_Notify::Topology_Object* result = this;
00563   if (type == "consumer_admin")
00564   {
00565     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00566       ACE_TEXT ("(%P|%t) EventChannel reload consumer_admin %d\n")
00567       , static_cast<int> (id)
00568       ));
00569 
00570     // call special builder method to reload
00571     TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00572     TAO_Notify_ConsumerAdmin * ca = bld->build_consumer_admin (
00573       this,
00574       id
00575       ACE_ENV_ARG_PARAMETER);
00576     ACE_CHECK_RETURN(0);
00577     ca->load_attrs (attrs);
00578     if (ca->is_default ())
00579       {
00580         CORBA::Object_var caob = this->poa()->servant_to_reference (ca ACE_ENV_ARG_PARAMETER);
00581         ACE_CHECK_RETURN(0);
00582         this->default_consumer_admin_ =
00583           CosNotifyChannelAdmin::ConsumerAdmin::_narrow (
00584           caob.in () ACE_ENV_ARG_PARAMETER);
00585         ACE_CHECK_RETURN(0);
00586       }
00587     result = ca;
00588   }
00589   else if (type == "supplier_admin")
00590   {
00591     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00592       ACE_TEXT ("(%P|%t) EventChannel reload supplier_admin %d\n")
00593       , static_cast<int> (id)
00594       ));
00595     TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00596 
00597     TAO_Notify_SupplierAdmin * sa = bld->build_supplier_admin (
00598       this,
00599       id
00600       ACE_ENV_ARG_PARAMETER);
00601     ACE_CHECK_RETURN(0);
00602     sa->load_attrs (attrs);
00603     if (sa->is_default ())
00604       {
00605         CORBA::Object_var saob = this->poa()->servant_to_reference (sa ACE_ENV_ARG_PARAMETER);
00606         ACE_CHECK_RETURN(0);
00607         this->default_supplier_admin_ =
00608           CosNotifyChannelAdmin::SupplierAdmin::_narrow (
00609           saob.in () ACE_ENV_ARG_PARAMETER);
00610         ACE_CHECK_RETURN(0);
00611       }
00612     result = sa;
00613   }
00614   return result;
00615 }

CosNotifyChannelAdmin::EventChannelFactory_ptr TAO_Notify_EventChannel::MyFactory  )  throw ( CORBA::SystemException ) [private]
 

Definition at line 281 of file EventChannel.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER.

00285 {
00286   return this->ecf_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
00287 }

CosNotifyChannelAdmin::ConsumerAdmin_ptr TAO_Notify_EventChannel::new_for_consumers CosNotifyChannelAdmin::InterFilterGroupOperator  op,
CosNotifyChannelAdmin::AdminID_out  id
throw ( CORBA::SystemException ) [private]
 

Definition at line 359 of file EventChannel.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, and TAO_Singleton< TYPE, ACE_LOCK >::instance().

00366 {
00367   ::CosNotifyChannelAdmin::ConsumerAdmin_var ca =
00368     TAO_Notify_PROPERTIES::instance()->builder()->build_consumer_admin (this, op, id ACE_ENV_ARG_PARAMETER);
00369   ACE_CHECK_RETURN (ca._retn ());
00370   this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
00371   ACE_CHECK_RETURN (ca._retn ());
00372   return ca._retn ();
00373 }

CosNotifyChannelAdmin::SupplierAdmin_ptr TAO_Notify_EventChannel::new_for_suppliers CosNotifyChannelAdmin::InterFilterGroupOperator  op,
CosNotifyChannelAdmin::AdminID_out  id
throw ( CORBA::SystemException ) [private]
 

Definition at line 376 of file EventChannel.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, and TAO_Singleton< TYPE, ACE_LOCK >::instance().

00383 {
00384   ::CosNotifyChannelAdmin::SupplierAdmin_var sa =
00385     TAO_Notify_PROPERTIES::instance()->builder()->build_supplier_admin (this, op, id ACE_ENV_ARG_PARAMETER);
00386   ACE_CHECK_RETURN (sa._retn ());
00387   this->self_change (ACE_ENV_SINGLE_ARG_PARAMETER);
00388   ACE_CHECK_RETURN (sa._retn ());
00389   return sa._retn ();
00390 }

void TAO_Notify_EventChannel::reconnect  )  [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 660 of file EventChannel.cpp.

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

00661 {
00662   TAO_Notify::Reconnect_Worker<TAO_Notify_ConsumerAdmin> ca_wrk;
00663   this->ca_container().collection()->for_each(&ca_wrk ACE_ENV_ARG_PARAMETER);
00664   ACE_CHECK;
00665 
00666   TAO_Notify::Reconnect_Worker<TAO_Notify_SupplierAdmin> sa_wrk;
00667   this->sa_container().collection()->for_each(&sa_wrk ACE_ENV_ARG_PARAMETER);
00668   ACE_CHECK;
00669 }

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

Release.

Implements TAO_Notify_Refcountable.

Definition at line 203 of file EventChannel.cpp.

00204 {
00205   delete this;
00206   //@@ inform factory
00207 }

void TAO_Notify_EventChannel::remove TAO_Notify_SupplierAdmin supplier_admin  ) 
 

Remove SupplierAdmin from its container.

Definition at line 256 of file EventChannel.cpp.

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

00257 {
00258   this->sa_container().remove (supplier_admin ACE_ENV_ARG_PARAMETER);
00259 }

void TAO_Notify_EventChannel::remove TAO_Notify_ConsumerAdmin consumer_admin  ) 
 

Remove ConsumerAdmin from its container.

Definition at line 250 of file EventChannel.cpp.

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

00251 {
00252   this->ca_container().remove (consumer_admin ACE_ENV_ARG_PARAMETER);
00253 }

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

Definition at line 679 of file EventChannel.cpp.

References ACE_ASSERT, and sa_container_.

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

00680 {
00681   ACE_ASSERT( this->sa_container_.get() != 0 );
00682   return *sa_container_;
00683 }

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

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

Referenced by save_persistent().

00537 {
00538   TAO_Notify_Object::save_attrs(attrs);
00539   add_attr(attrs, this->admin_properties().max_global_queue_length());
00540   add_attr(attrs, this->admin_properties().max_consumers());
00541   add_attr(attrs, this->admin_properties().max_suppliers());
00542   add_attr(attrs, this->admin_properties().reject_new_events());
00543 }

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 ACE_ENV_ARG_PARAMETER); ACE_CHECK; for all children { if (want_all_children || child.is_changed()) { child.save_persistent(saver ACE_ENV_ARG_PARAMETER); ACE_CHECK; } } for all deleted children { saver.delete_child(child_type, child_id); } saver.end_object(this->id(), type ACE_ENV_ARG_PARAMETER); )

Implements TAO_Notify::Topology_Savable.

Definition at line 497 of file EventChannel.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ca_container(), TAO_Notify_Container_T< TYPE >::collection(), TAO_Notify::Topology_Object::is_persistent(), sa_container(), and save_attrs().

00498 {
00499   bool changed = this->self_changed_;
00500   this->self_changed_ = false;
00501   this->children_changed_ = false;
00502 
00503   if (is_persistent ())
00504   {
00505     TAO_Notify::NVPList attrs;
00506     this->save_attrs(attrs);
00507 
00508     bool want_all_children = saver.begin_object(
00509       this->id(), "channel", attrs, changed ACE_ENV_ARG_PARAMETER);
00510     ACE_CHECK;
00511 
00512     TAO_Notify::Save_Persist_Worker<TAO_Notify_ConsumerAdmin> ca_wrk(saver, want_all_children);
00513 
00514     this->ca_container().collection()->for_each(&ca_wrk ACE_ENV_ARG_PARAMETER);
00515     ACE_CHECK;
00516 
00517     TAO_Notify::Save_Persist_Worker<TAO_Notify_SupplierAdmin> sa_wrk(saver, want_all_children);
00518     this->sa_container().collection()->for_each(&sa_wrk ACE_ENV_ARG_PARAMETER);
00519     ACE_CHECK;
00520 
00521     saver.end_object(this->id(), "channel" ACE_ENV_ARG_PARAMETER);
00522   }
00523 }

void TAO_Notify_EventChannel::set_admin const CosNotification::AdminProperties admin  )  throw ( CORBA::SystemException , CosNotification::UnsupportedAdmin ) [private, virtual]
 

Definition at line 439 of file EventChannel.cpp.

References CosNotification::AdminProperties.

Referenced by init().

00444 {
00445   this->admin_properties().init (admin);
00446 }

void TAO_Notify_EventChannel::set_qos const CosNotification::QoSProperties qos  )  throw ( CORBA::SystemException , CosNotification::UnsupportedQoS ) [private, virtual]
 

Set the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 262 of file EventChannel.cpp.

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

Referenced by init().

00267 {
00268   this->TAO_Notify_Object::set_qos (qos ACE_ENV_ARG_PARAMETER);
00269 }

int TAO_Notify_EventChannel::shutdown  )  [virtual]
 

Shutdown.

Reimplemented from TAO_Notify_Object.

Definition at line 210 of file EventChannel.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, 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().

00211 {
00212   int sd_ret = TAO_Notify_Object::shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00213   ACE_CHECK_RETURN (1);
00214 
00215   if (sd_ret == 1)
00216     return 1;
00217 
00218   this->ca_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00219   ACE_CHECK_RETURN (1);
00220 
00221   this->sa_container().shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00222   ACE_CHECK_RETURN (1);
00223 
00224   this->event_manager().shutdown ();
00225 
00226   return 0;
00227 }

void TAO_Notify_EventChannel::validate_qos const CosNotification::QoSProperties required_qos,
CosNotification::NamedPropertyRangeSeq_out  available_qos
throw ( CORBA::SystemException , CosNotification::UnsupportedQoS ) [private, virtual]
 

Definition at line 484 of file EventChannel.cpp.

References ACE_THROW, and CosNotification::QoSProperties.

00492 {
00493   ACE_THROW (CORBA::NO_IMPLEMENT ());
00494 }


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

Referenced by TAO_Notify_Builder::build_consumer_admin(), ca_container(), 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 load_child().

CosNotifyChannelAdmin::SupplierAdmin_var TAO_Notify_EventChannel::default_supplier_admin_ [private]
 

Definition at line 119 of file EventChannel.h.

Referenced by 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 init().

ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Container > TAO_Notify_EventChannel::sa_container_ [private]
 

SupplierAdmin Container.

Definition at line 240 of file EventChannel.h.

Referenced by init(), and sa_container().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:31:58 2006 for TAO_CosNotification by doxygen 1.3.6