TAO_Notify_ConsumerAdmin Class Reference

Implementation of CosNotifyChannelAdmin::ConsumerAdmin. More...

#include <ConsumerAdmin.h>

Inheritance diagram for TAO_Notify_ConsumerAdmin:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_ConsumerAdmin:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Notify_Refcountable_Guard_T<
TAO_Notify_ConsumerAdmin
Ptr

Public Member Functions

 TAO_Notify_ConsumerAdmin (void)
 Constructor.
virtual ~TAO_Notify_ConsumerAdmin ()
 Destructor.
void init (TAO_Notify_EventChannel *ec)
 Init.
virtual void _add_ref (void)
 ServantBase refcount methods.
virtual void _remove_ref (void)
virtual const char * get_admin_type_name () const
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.
TAO_Notify_ProxySupplierfind_proxy_supplier (TAO_Notify::IdVec &id_path, size_t position)
virtual void destroy (void)
 TAO_Notify_Container_T requires a destroy method.

Protected Member Functions

TAO_Notify::Topology_Objectload_proxy (CORBA::Long id, CosNotifyChannelAdmin::ClientType ctype, const TAO_Notify::NVPList &attrs)
virtual CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id, const CosNotification::QoSProperties &initial_qos)
 = NotifyExt::ConsumerAdmin methods
virtual CosNotifyChannelAdmin::AdminID MyID (void)
 = CosNotifyChannelAdmin::ConsumerAdmin methods
virtual ::CosNotifyChannelAdmin::EventChannel_ptr MyChannel (void)
virtual ::CosNotifyChannelAdmin::InterFilterGroupOperator MyOperator (void)
virtual ::CosNotifyFilter::MappingFilter_ptr priority_filter (void)
virtual void priority_filter (CosNotifyFilter::MappingFilter_ptr priority_filter)
virtual ::CosNotifyFilter::MappingFilter_ptr lifetime_filter (void)
virtual void lifetime_filter (CosNotifyFilter::MappingFilter_ptr lifetime_filter)
virtual ::CosNotifyChannelAdmin::ProxyIDSeqpull_suppliers (void)
virtual ::CosNotifyChannelAdmin::ProxyIDSeqpush_suppliers (void)
virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr get_proxy_supplier (CosNotifyChannelAdmin::ProxyID proxy_id)
virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_pull_supplier (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id)
virtual ::CosNotifyChannelAdmin::ProxySupplier_ptr obtain_notification_push_supplier (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id)
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 void subscription_change (const CosNotification::EventTypeSeq &added, const CosNotification::EventTypeSeq &removed)
virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter)
virtual void remove_filter (CosNotifyFilter::FilterID filter)
virtual ::CosNotifyFilter::Filter_ptr get_filter (CosNotifyFilter::FilterID filter)
virtual ::CosNotifyFilter::FilterIDSeqget_all_filters (void)
virtual void remove_all_filters (void)
virtual ::CosEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (void)
virtual ::CosEventChannelAdmin::ProxyPullSupplier_ptr obtain_pull_supplier (void)

Private Member Functions

virtual void release (void)
 Release this object.

Detailed Description

Implementation of CosNotifyChannelAdmin::ConsumerAdmin.

Definition at line 42 of file ConsumerAdmin.h.


Member Typedef Documentation

typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_ConsumerAdmin > TAO_Notify_ConsumerAdmin::Ptr

Reimplemented from TAO_Notify_Refcountable.

Definition at line 47 of file ConsumerAdmin.h.


Constructor & Destructor Documentation

TAO_Notify_ConsumerAdmin::TAO_Notify_ConsumerAdmin ( void   ) 

Constructor.

Definition at line 40 of file ConsumerAdmin.cpp.

00041   : TAO_Notify_Admin ()
00042 {
00043 }

TAO_Notify_ConsumerAdmin::~TAO_Notify_ConsumerAdmin (  )  [virtual]

Destructor.

Definition at line 53 of file ConsumerAdmin.cpp.

00054 {
00055 }


Member Function Documentation

void TAO_Notify_ConsumerAdmin::_add_ref ( void   )  [virtual]

ServantBase refcount methods.

Definition at line 69 of file ConsumerAdmin.cpp.

References TAO_Notify_Refcountable::_incr_refcnt().

00070 {
00071   this->_incr_refcnt ();
00072 }

void TAO_Notify_ConsumerAdmin::_remove_ref ( void   )  [virtual]

Definition at line 75 of file ConsumerAdmin.cpp.

References TAO_Notify_Refcountable::_decr_refcnt().

00076 {
00077   this->_decr_refcnt ();
00078 }

CosNotifyFilter::FilterID TAO_Notify_ConsumerAdmin::add_filter ( CosNotifyFilter::Filter_ptr  new_filter  )  [protected, virtual]

Definition at line 266 of file ConsumerAdmin.cpp.

References TAO_Notify_FilterAdmin::add_filter(), TAO_Notify_Admin::filter_admin_, and TAO_Notify::Topology_Object::self_change().

00267 {
00268   CosNotifyFilter::FilterID fid =
00269     this->filter_admin_.add_filter (new_filter);
00270   this->self_change ();
00271   return fid;
00272 }

void TAO_Notify_ConsumerAdmin::destroy ( void   )  [virtual]

TAO_Notify_Container_T requires a destroy method.

Definition at line 88 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::ec_, TAO_Notify_Admin::proxy_container(), and TAO_Notify_Admin::shutdown().

00089 {
00090   this->shutdown ();
00091   this->ec_->remove (this);
00092   this->proxy_container ().destroy ();
00093 }

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

Definition at line 355 of file ConsumerAdmin.cpp.

References ACE_Vector< T, DEFAULT_SIZE >::size(), and TAO_Notify_ProxySupplier_Find_Worker.

Referenced by TAO_Notify_EventChannel::find_proxy_supplier().

00358 {
00359   TAO_Notify_ProxySupplier * result = 0;
00360   size_t path_size = id_path.size ();
00361   if (position < path_size)
00362   {
00363     TAO_Notify_ProxySupplier_Find_Worker find_worker;
00364     TAO_Notify_Proxy * proxy = find_worker.find (id_path[position], this->proxy_container());
00365     result = dynamic_cast <TAO_Notify_ProxySupplier *> (proxy);
00366   }
00367   return result;
00368 }

const char * TAO_Notify_ConsumerAdmin::get_admin_type_name (  )  const [virtual]

Implements TAO_Notify_Admin.

Definition at line 46 of file ConsumerAdmin.cpp.

00047 {
00048   return "consumer_admin";
00049 }

CosNotifyFilter::FilterIDSeq * TAO_Notify_ConsumerAdmin::get_all_filters ( void   )  [protected]

Definition at line 287 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::filter_admin_, and TAO_Notify_FilterAdmin::get_all_filters().

00288 {
00289   return this->filter_admin_.get_all_filters ();
00290 }

CosNotifyFilter::Filter_ptr TAO_Notify_ConsumerAdmin::get_filter ( CosNotifyFilter::FilterID  filter  )  [protected]

Definition at line 281 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::filter_admin_, and TAO_Notify_FilterAdmin::get_filter().

00282 {
00283   return this->filter_admin_.get_filter (filter);
00284 }

CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin::get_proxy_supplier ( CosNotifyChannelAdmin::ProxyID  proxy_id  )  [protected]

Definition at line 225 of file ConsumerAdmin.cpp.

References TAO_Notify_ProxySupplier_Find_Worker.

00226 {
00227   TAO_Notify_ProxySupplier_Find_Worker find_worker;
00228 
00229   return find_worker.resolve (proxy_id, this->proxy_container());
00230 }

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

Get the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 239 of file ConsumerAdmin.cpp.

References TAO_Notify_Object::get_qos().

00240 {
00241   return this->TAO_Notify_Object::get_qos ();
00242 }

void TAO_Notify_ConsumerAdmin::init ( TAO_Notify_EventChannel ec  ) 

Init.

Definition at line 58 of file ConsumerAdmin.cpp.

References TAO_Notify_Properties::default_consumer_admin_qos_properties(), TAO_Notify_Admin::init(), TAO_Notify_Properties::instance(), and set_qos().

Referenced by TAO_Notify_Builder::build_consumer_admin().

00059 {
00060   TAO_Notify_Admin::init (ec);
00061 
00062   const CosNotification::QoSProperties &default_ca_qos =
00063     TAO_Notify_PROPERTIES::instance ()->default_consumer_admin_qos_properties ();
00064 
00065   this->set_qos (default_ca_qos);
00066 }

void TAO_Notify_ConsumerAdmin::lifetime_filter ( CosNotifyFilter::MappingFilter_ptr  lifetime_filter  )  [protected, virtual]

Definition at line 321 of file ConsumerAdmin.cpp.

00322 {
00323   throw CORBA::NO_IMPLEMENT ();
00324 }

CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin::lifetime_filter ( void   )  [protected]

Definition at line 314 of file ConsumerAdmin.cpp.

00316 {
00317   throw CORBA::NO_IMPLEMENT ();
00318 }

TAO_Notify::Topology_Object * TAO_Notify_ConsumerAdmin::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_Admin.

Definition at line 97 of file ConsumerAdmin.cpp.

References ACE_DEBUG, ACE_TEXT(), CosNotifyChannelAdmin::ANY_EVENT, DEBUG_LEVEL, LM_DEBUG, TAO_Notify_Admin::load_child(), load_proxy(), CosNotifyChannelAdmin::SEQUENCE_EVENT, and CosNotifyChannelAdmin::STRUCTURED_EVENT.

00099 {
00100   TAO_Notify::Topology_Object* result = this;
00101   if (type == "proxy_push_supplier")
00102   {
00103     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00104       ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
00105       , static_cast<int> (id)
00106       ));
00107     result = this->load_proxy(id, CosNotifyChannelAdmin::ANY_EVENT, attrs);
00108   }
00109   else if (type == "structured_proxy_push_supplier")
00110   {
00111     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00112       ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
00113       , static_cast<int> (id)
00114       ));
00115     result = this->load_proxy(id, CosNotifyChannelAdmin::STRUCTURED_EVENT, attrs);
00116   }
00117   else if (type == "sequence_proxy_push_supplier")
00118   {
00119     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00120       ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
00121       , static_cast<int> (id)
00122       ));
00123     result = this->load_proxy(id, CosNotifyChannelAdmin::SEQUENCE_EVENT, attrs);
00124   }
00125 #if 0
00126   else if (type == "ec_proxy_push_supplier")
00127   {
00128     if (DEBUG_LEVEL) ACE_DEBUG ((LM_DEBUG,
00129       ACE_TEXT ("(%P|%t) Admin reload proxy %d\n")
00130       , static_cast<int> (id)
00131       ));
00132     result = this->load_proxy(id, attrs);
00133   }
00134 #endif
00135   else
00136   {
00137     result = TAO_Notify_Admin::load_child (type, id, attrs);
00138   }
00139   return result;
00140 }

TAO_Notify::Topology_Object * TAO_Notify_ConsumerAdmin::load_proxy ( CORBA::Long  id,
CosNotifyChannelAdmin::ClientType  ctype,
const TAO_Notify::NVPList attrs 
) [protected]

Definition at line 143 of file ConsumerAdmin.cpp.

References ACE_ASSERT, TAO_Notify_Builder::build_proxy(), TAO_Notify_Properties::builder(), TAO_Notify_Properties::instance(), and TAO_Notify_Object::load_attrs().

Referenced by load_child().

00147 {
00148   TAO_Notify_Builder* bld = TAO_Notify_PROPERTIES::instance()->builder();
00149   TAO_Notify_ProxySupplier * proxy =
00150     bld->build_proxy (this
00151                , ctype
00152                , id);
00153   ACE_ASSERT(proxy != 0);
00154   proxy->load_attrs (attrs);
00155   return proxy;
00156 }

CosNotifyChannelAdmin::EventChannel_ptr TAO_Notify_ConsumerAdmin::MyChannel ( void   )  [protected]

Definition at line 205 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::ec_.

00206 {
00207   return this->ec_->_this ();
00208 }

CosNotifyChannelAdmin::AdminID TAO_Notify_ConsumerAdmin::MyID ( void   )  [protected, virtual]

= CosNotifyChannelAdmin::ConsumerAdmin methods

Definition at line 199 of file ConsumerAdmin.cpp.

References TAO_Notify_Object::id().

00200 {
00201   return this->id ();
00202 }

CosNotifyChannelAdmin::InterFilterGroupOperator TAO_Notify_ConsumerAdmin::MyOperator ( void   )  [protected]

Definition at line 211 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::filter_operator_.

00212 {
00213   return this->filter_operator_;
00214 }

CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin::obtain_notification_pull_supplier ( CosNotifyChannelAdmin::ClientType  ctype,
CosNotifyChannelAdmin::ProxyID_out  proxy_id 
) [protected]

Definition at line 333 of file ConsumerAdmin.cpp.

00336 {
00337   throw CORBA::NO_IMPLEMENT ();
00338 }

CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin::obtain_notification_push_supplier ( CosNotifyChannelAdmin::ClientType  ctype,
CosNotifyChannelAdmin::ProxyID_out  proxy_id 
) [protected]

Definition at line 159 of file ConsumerAdmin.cpp.

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

00162 {
00163   CosNotification::QoSProperties initial_qos;
00164 
00165   CosNotifyChannelAdmin::ProxySupplier_var proxy =
00166     TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
00167                                                                 , ctype
00168                                                                 , proxy_id
00169                                                                 , initial_qos);
00170   this->self_change ();
00171   return proxy._retn ();
00172 }

CosNotifyChannelAdmin::ProxySupplier_ptr TAO_Notify_ConsumerAdmin::obtain_notification_push_supplier_with_qos ( CosNotifyChannelAdmin::ClientType  ctype,
CosNotifyChannelAdmin::ProxyID_out  proxy_id,
const CosNotification::QoSProperties initial_qos 
) [protected, virtual]

= NotifyExt::ConsumerAdmin methods

Definition at line 175 of file ConsumerAdmin.cpp.

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

00179 {
00180   CosNotifyChannelAdmin::ProxySupplier_var proxy =
00181     TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this
00182                                                                 , ctype
00183                                                                 , proxy_id
00184                                                                 , initial_qos);
00185   this->self_change ();
00186   return proxy._retn ();
00187 }

CosEventChannelAdmin::ProxyPullSupplier_ptr TAO_Notify_ConsumerAdmin::obtain_pull_supplier ( void   )  [protected]

Definition at line 349 of file ConsumerAdmin.cpp.

00350 {
00351   throw CORBA::NO_IMPLEMENT ();
00352 }

CosEventChannelAdmin::ProxyPushSupplier_ptr TAO_Notify_ConsumerAdmin::obtain_push_supplier ( void   )  [protected]

Definition at line 190 of file ConsumerAdmin.cpp.

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

00191 {
00192   CosEventChannelAdmin::ProxyPushSupplier_var proxy =
00193     TAO_Notify_PROPERTIES::instance()->builder()->build_proxy (this);
00194   this->self_change ();
00195   return proxy._retn ();
00196 }

void TAO_Notify_ConsumerAdmin::priority_filter ( CosNotifyFilter::MappingFilter_ptr  priority_filter  )  [protected, virtual]

Definition at line 307 of file ConsumerAdmin.cpp.

00309 {
00310   throw CORBA::NO_IMPLEMENT ();
00311 }

CosNotifyFilter::MappingFilter_ptr TAO_Notify_ConsumerAdmin::priority_filter ( void   )  [protected]

Definition at line 301 of file ConsumerAdmin.cpp.

00302 {
00303   throw CORBA::NO_IMPLEMENT ();
00304 }

CosNotifyChannelAdmin::ProxyIDSeq * TAO_Notify_ConsumerAdmin::pull_suppliers ( void   )  [protected]

Definition at line 327 of file ConsumerAdmin.cpp.

00328 {
00329   throw CORBA::NO_IMPLEMENT ();
00330 }

CosNotifyChannelAdmin::ProxyIDSeq * TAO_Notify_ConsumerAdmin::push_suppliers ( void   )  [protected]

Definition at line 217 of file ConsumerAdmin.cpp.

References TAO_Notify_Seq_Worker_T< TYPE >::create().

00218 {
00219   TAO_Notify_Proxy_Seq_Worker seq_worker;
00220 
00221   return seq_worker.create (this->proxy_container());
00222 }

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

Release this object.

Implements TAO_Notify_Refcountable.

Definition at line 81 of file ConsumerAdmin.cpp.

00082 {
00083   delete this;
00084   //@@ inform factory
00085 }

void TAO_Notify_ConsumerAdmin::remove_all_filters ( void   )  [protected, virtual]

Definition at line 293 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::filter_admin_, and TAO_Notify_FilterAdmin::remove_all_filters().

00294 {
00295   this->filter_admin_.remove_all_filters ();
00296 }

void TAO_Notify_ConsumerAdmin::remove_filter ( CosNotifyFilter::FilterID  filter  )  [protected, virtual]

Definition at line 275 of file ConsumerAdmin.cpp.

References TAO_Notify_Admin::filter_admin_, and TAO_Notify_FilterAdmin::remove_filter().

00276 {
00277   this->filter_admin_.remove_filter (filter);
00278 }

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

Set the QoS Properties.

Reimplemented from TAO_Notify_Object.

Definition at line 232 of file ConsumerAdmin.cpp.

References TAO_Notify_Object::set_qos().

Referenced by init().

00233 {
00234   this->TAO_Notify_Object::set_qos (qos);
00235 }

void TAO_Notify_ConsumerAdmin::subscription_change ( const CosNotification::EventTypeSeq added,
const CosNotification::EventTypeSeq removed 
) [protected, virtual]

Definition at line 245 of file ConsumerAdmin.cpp.

References ACE_GUARD_THROW_EX, TAO_Notify_EventTypeSeq::add_and_remove(), TAO_Notify_Admin::proxy_container(), TAO_Notify::Topology_Object::self_change(), TAO_Notify_Admin::subscribed_types_, and TAO_SYNCH_MUTEX.

00248 {
00249   TAO_Notify_EventTypeSeq seq_added (added);
00250   TAO_Notify_EventTypeSeq seq_removed (removed);
00251 
00252   {
00253     ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
00254                         CORBA::INTERNAL ());
00255 
00256     this->subscribed_types_.add_and_remove (seq_added, seq_removed);
00257 
00258     TAO_Notify_Subscription_Change_Worker worker (added, removed);
00259 
00260     this->proxy_container().collection()->for_each (&worker);
00261   }
00262   this->self_change ();
00263 }

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

Definition at line 341 of file ConsumerAdmin.cpp.

00344 {
00345   throw CORBA::NO_IMPLEMENT ();
00346 }


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