TAO_Notify_Object Class Reference

Base Object for RT_Notify's CORBA Objects. More...

#include <Object.h>

Inheritance diagram for TAO_Notify_Object:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_Object:

Collaboration graph
[legend]
List of all members.

Public Types

typedef CORBA::Long ID
 Id for Objects.

Public Member Functions

virtual ~TAO_Notify_Object (void)
 Destructor.
ID id (void) const
 This Object's ID.
virtual CORBA::Object_ptr activate (PortableServer::Servant servant)
 Activate.
virtual CORBA::Object_ptr activate (PortableServer::Servant servant, CORBA::Long id)
 Activate with existing id.
void deactivate (void)
 Deactivate.
bool has_shutdown (void)
 Have we been shutdown. returns true if shutdown.
void execute_task (TAO_Notify_Method_Request &method_request)
CORBA::Object_ptr ref (void)
 Get CORBA Ref.
virtual void set_qos (const CosNotification::QoSProperties &qos)
 Set the QoS Properties.
CosNotification::QoSPropertiesget_qos (void)
 Get the QoS Properties.
bool find_qos_property_value (const char *name, CosNotification::PropertyValue &value) const
virtual TAO_Notify_Timertimer (void)
 Obtain the Timer manager associated with this object.
TAO_Notify_Event_Managerevent_manager (void)
 Accessor for the Event Manager.
virtual int shutdown (void)
 Shutdown. Returns 1 if the shutdown was already run once before.
virtual void load_attrs (const TAO_Notify::NVPList &attrs)
TAO_Notify_Worker_Taskget_worker_task (void)
 Allow access to the underlying worker task.

Protected Member Functions

 TAO_Notify_Object (void)
 Constructor.
void initialize (TAO_Notify_Object *parent)
 Init this object with data from <rhs>.
void inherit_poas (TAO_Notify_Object &parent)
 Uses the poas from the supplied object.
void adopt_poa (TAO_Notify_POA_Helper *single)
 Adopts the supplied poa as all are poas.
void set_primary_as_proxy_poa ()
 Changes the primary poa to the current proxy poa.
TAO_Notify_POA_Helperproxy_poa (void)
 Accessor for the proxy_poa_.
TAO_Notify_POA_Helperobject_poa (void)
 Accessor for the object_poa_.
TAO_Notify_POA_Helperpoa (void)
 Get the POA assigned to us.
void set_event_manager (TAO_Notify_Event_Manager *event_manager)
void set_admin_properties (TAO_Notify_AdminProperties *admin_properties)
TAO_Notify_AdminPropertiesadmin_properties (void)
 Accessor for the Admin Properties.
virtual void qos_changed (const TAO_Notify_QoSProperties &qos_properties)
virtual void save_attrs (TAO_Notify::NVPList &attrs)

Protected Attributes

TAO_Notify_QoSProperties qos_properties_
 QoS Properties.
TAO_SYNCH_MUTEX lock_
 The mutex to serialize access to state variables.

Private Member Functions

void set_worker_task (TAO_Notify_Worker_Task *worker_task)
 Set Worker Task. This object assume ownership of the set object.
void set_proxy_poa (TAO_Notify_POA_Helper *proxy_poa)
 Setting the proxy_poa_ gives ownership to this class.
void set_object_poa (TAO_Notify_POA_Helper *object_poa)
 Setting the object_poa_ gives ownership to this class.
void set_poa (TAO_Notify_POA_Helper *object_poa)
 Setting the object_poa_ gives ownership to this class.
void shutdown_worker_task (void)
 Shutdown the current worker task and delete it if we own it.
void destroy_proxy_poa (void)
 Shutdown the current proxy poa.
void destroy_object_poa (void)
 Shutdown the current object poa.
void destroy_poa (void)
 Shutdown the current poa.

Private Attributes

TAO_Notify_POA_Helperpoa_
 The POA in which the object is activated.
TAO_Notify_POA_Helperproxy_poa_
 The POA in which the proxys are activated.
bool own_proxy_poa_
TAO_Notify_POA_Helperobject_poa_
 The POA in which the object's children are activated.
bool own_object_poa_
ID id_
 Id assigned to this object.
TAO_Notify_Refcountable_Guard_T<
TAO_Notify_Event_Manager
event_manager_
TAO_Notify_AdminProperties::Ptr admin_properties_
 Admin Properties.
TAO_Notify_Worker_Task::Ptr worker_task_
 Worker Task.
bool own_worker_task_
bool shutdown_
 Are we shutdown (i,e. scheduled for destroy).

Friends

class TAO_Notify_Builder
class TAO_Notify_RT_Builder

Detailed Description

Base Object for RT_Notify's CORBA Objects.

Definition at line 47 of file Object.h.


Member Typedef Documentation

typedef CORBA::Long TAO_Notify_Object::ID

Id for Objects.

Definition at line 54 of file Object.h.


Constructor & Destructor Documentation

TAO_Notify_Object::~TAO_Notify_Object ( void   )  [virtual]

Destructor.

Definition at line 35 of file Object.cpp.

References ACE_DEBUG, destroy_object_poa(), destroy_poa(), destroy_proxy_poa(), LM_DEBUG, and TAO_debug_level.

00036 {
00037   if (TAO_debug_level > 2 )
00038     ACE_DEBUG ((LM_DEBUG,"object:%x  destroyed\n", this ));
00039 
00040   this->destroy_proxy_poa ();
00041   this->destroy_object_poa ();
00042   this->destroy_poa ();
00043 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_Object::TAO_Notify_Object ( void   )  [protected]

Constructor.

Definition at line 21 of file Object.cpp.

References ACE_DEBUG, LM_DEBUG, and TAO_debug_level.

00022 : poa_ (0)
00023 , proxy_poa_ (0)
00024 , own_proxy_poa_ (false)
00025 , object_poa_ (0)
00026 , own_object_poa_ (false)
00027 , id_ (0)
00028 , own_worker_task_ (false)
00029 , shutdown_ (false)
00030 {
00031   if (TAO_debug_level > 2 )
00032     ACE_DEBUG ((LM_DEBUG,"object:%x  created\n", this ));
00033 }


Member Function Documentation

CORBA::Object_ptr TAO_Notify_Object::activate ( PortableServer::Servant  servant,
CORBA::Long  id 
) [virtual]

Activate with existing id.

Reimplemented in TAO_Notify_Proxy, and TAO_Notify_RT_StructuredProxyPushSupplier.

Definition at line 78 of file Object.cpp.

References TAO_Notify_POA_Helper::activate_with_id(), id_, and poa_.

00081 {
00082   this->id_ = id;
00083   return this->poa_->activate_with_id (servant, this->id_);
00084 }

CORBA::Object_ptr TAO_Notify_Object::activate ( PortableServer::Servant  servant  )  [virtual]

Activate.

Reimplemented in TAO_Notify_Proxy, and TAO_Notify_RT_StructuredProxyPushSupplier.

Definition at line 71 of file Object.cpp.

References TAO_Notify_POA_Helper::activate(), and poa_.

Referenced by TAO_Notify_Proxy::activate(), TAO_Notify_EventChannelFactory::activate_self(), TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Builder::build_event_channel(), and TAO_Notify_Builder::build_supplier_admin().

00072 {
00073   return this->poa_->activate (servant, this->id_);
00074 }

ACE_INLINE TAO_Notify_AdminProperties & TAO_Notify_Object::admin_properties ( void   )  [protected]

Accessor for the Admin Properties.

Definition at line 91 of file Object.inl.

References ACE_ASSERT, and admin_properties_.

Referenced by TAO_Notify_ProxySupplier::connect(), TAO_Notify_ProxyConsumer::connect(), TAO_Notify_ProxySupplier::disconnect(), TAO_Notify_ProxyConsumer::disconnect(), TAO_Notify_EventChannel::get_admin(), TAO_Notify_EventChannel::init(), TAO_Notify_EventChannel::load_attrs(), TAO_Notify_ProxyPushConsumer::push(), TAO_Notify_CosEC_ProxyPushConsumer::push(), TAO_Notify_StructuredProxyPushConsumer::push_structured_event(), TAO_Notify_SequenceProxyPushConsumer::push_structured_events(), TAO_Notify_EventChannel::set_admin(), and set_admin_properties().

00092 {
00093   ACE_ASSERT( this->admin_properties_.get() != 0 );
00094   return *this->admin_properties_;
00095 }

ACE_INLINE void TAO_Notify_Object::adopt_poa ( TAO_Notify_POA_Helper single  )  [protected]

Adopts the supplied poa as all are poas.

Definition at line 36 of file Object.inl.

References ACE_ASSERT, set_object_poa(), set_poa(), and set_proxy_poa().

Referenced by TAO_Notify_EventChannelFactory::init().

00037 {
00038   ACE_ASSERT( single != 0 );
00039   this->set_proxy_poa( single );
00040   this->set_object_poa( single );
00041   this->set_poa( single );
00042 
00043   // Maintain ownership of the poa
00044 }

void TAO_Notify_Object::deactivate ( void   ) 

Deactivate.

Reimplemented in TAO_Notify_Proxy.

Definition at line 88 of file Object.cpp.

References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, TAO_Notify_POA_Helper::deactivate(), LM_DEBUG, poa_, and TAO_debug_level.

Referenced by shutdown().

00089 {
00090   try
00091   {
00092     this->poa_->deactivate (this->id_);
00093   }
00094   catch (const CORBA::Exception& ex)
00095   {
00096     // Do not propagate any exceptions
00097     if (TAO_debug_level > 2)
00098     {
00099       ex._tao_print_exception ("(%P|%t)\n");
00100       ACE_DEBUG ((LM_DEBUG, "Could not deactivate object %d\n", this->id_));
00101     }
00102   }
00103 }

void TAO_Notify_Object::destroy_object_poa ( void   )  [private]

Shutdown the current object poa.

Definition at line 172 of file Object.cpp.

References CORBA::Exception::_tao_print_exception(), TAO_Notify_POA_Helper::destroy(), object_poa_, own_object_poa_, poa_, proxy_poa_, and TAO_debug_level.

Referenced by set_object_poa(), and ~TAO_Notify_Object().

00173 {
00174   if (this->object_poa_ != 0)
00175   {
00176     try
00177     {
00178       if ( this->object_poa_ == this->proxy_poa_ ) this->proxy_poa_ = 0;
00179       if ( this->object_poa_ == this->poa_ ) this->poa_ = 0;
00180 
00181       if ( this->own_object_poa_ == true )
00182       {
00183         this->own_object_poa_ = false;
00184         ACE_Auto_Ptr< TAO_Notify_POA_Helper > aop( object_poa_ );
00185         this->object_poa_->destroy ();
00186       }
00187       this->object_poa_ = 0;
00188     }
00189     catch (const CORBA::Exception& ex)
00190     {
00191       if (TAO_debug_level > 2)
00192         ex._tao_print_exception ("Proxy shutdown error (%P|%t)\n");
00193     }
00194   }
00195 }

void TAO_Notify_Object::destroy_poa ( void   )  [private]

Shutdown the current poa.

Definition at line 198 of file Object.cpp.

References poa_.

Referenced by ~TAO_Notify_Object().

00199 {
00200   this->poa_ = 0;
00201 }

void TAO_Notify_Object::destroy_proxy_poa ( void   )  [private]

Shutdown the current proxy poa.

Definition at line 146 of file Object.cpp.

References CORBA::Exception::_tao_print_exception(), TAO_Notify_POA_Helper::destroy(), object_poa_, own_proxy_poa_, poa_, proxy_poa_, and TAO_debug_level.

Referenced by set_proxy_poa(), and ~TAO_Notify_Object().

00147 {
00148   if (this->proxy_poa_ != 0)
00149   {
00150     try
00151     {
00152       if ( this->proxy_poa_ == this->object_poa_ ) this->object_poa_ = 0;
00153       if ( this->proxy_poa_ == this->poa_ ) this->poa_ = 0;
00154 
00155       if ( this->own_proxy_poa_ == true )
00156       {
00157         this->own_proxy_poa_ = false;
00158         ACE_Auto_Ptr< TAO_Notify_POA_Helper > app( proxy_poa_ );
00159         this->proxy_poa_->destroy ();
00160       }
00161       this->proxy_poa_ = 0;
00162     }
00163     catch (const CORBA::Exception& ex)
00164     {
00165       if (TAO_debug_level > 2)
00166         ex._tao_print_exception ("Proxy shutdown error (%P|%t)\n");
00167     }
00168   }
00169 }

ACE_INLINE TAO_Notify_Event_Manager & TAO_Notify_Object::event_manager ( void   ) 

Accessor for the Event Manager.

Definition at line 84 of file Object.inl.

References ACE_ASSERT, and event_manager_.

Referenced by TAO_Notify_ProxySupplier::connect(), TAO_Notify_ProxyConsumer::connect(), TAO_Notify_ProxySupplier::disconnect(), TAO_Notify_ProxyConsumer::disconnect(), TAO_Notify_Method_Request_Lookup::execute_i(), TAO_Notify_EventChannel::init(), TAO_Notify_ProxyConsumer_T< SERVANT_TYPE >::offer_change(), set_event_manager(), TAO_Notify_EventChannel::shutdown(), and TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::subscription_change().

00085 {
00086   ACE_ASSERT( this->event_manager_.get() != 0 );
00087   return *this->event_manager_;
00088 }

ACE_INLINE void TAO_Notify_Object::execute_task ( TAO_Notify_Method_Request method_request  ) 

Definition at line 14 of file Object.inl.

References TAO_Notify_Refcountable_Guard_T< T >::isSet().

Referenced by TAO_Notify_ProxySupplier::deliver(), TAO_Notify::Routing_Slip::dispatch(), TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::forward_any(), TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::forward_any_no_filtering(), TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::forward_structured(), TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::forward_structured_no_filtering(), TAO_Notify_CosEC_ProxyPushConsumer::push(), TAO_Notify_ProxyConsumer::push_i(), TAO_Notify::Routing_Slip::route(), and TAO_Notify_Proxy::types_changed().

00015 {
00016   TAO_Notify_Worker_Task::Ptr task( this->worker_task_ );
00017   if ( task.isSet() )
00018   {
00019     task->execute( method_request );
00020   }
00021 }

bool TAO_Notify_Object::find_qos_property_value ( const char *  name,
CosNotification::PropertyValue value 
) const

Definition at line 300 of file Object.cpp.

00303 {
00304   // qos_properties_ is essentially a map and the find() method returns
00305   // zero on success.  We must convert this to a boolean value.
00306   return (this->qos_properties_.find (name, value) == 0);
00307 }

CosNotification::QoSProperties * TAO_Notify_Object::get_qos ( void   ) 

Get the QoS Properties.

Reimplemented in TAO_Notify_ConsumerAdmin, TAO_Notify_EventChannel, TAO_Notify_Proxy_T< SERVANT_TYPE >, TAO_Notify_SupplierAdmin, TAO_Notify_Proxy_T< POA_Event_Forwarder::ProxyPushSupplier >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::ProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::SequenceProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier >, TAO_Notify_Proxy_T< POA_Event_Forwarder::StructuredProxyPushSupplier >, TAO_Notify_Proxy_T< POA_CosEventChannelAdmin::ProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosEventChannelAdmin::ProxyPushSupplier >, and TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer >.

Definition at line 286 of file Object.cpp.

References ACE_NEW_THROW_EX, TAO_Notify_PropertySeq::populate(), and qos_properties_.

Referenced by TAO_Notify_SupplierAdmin::get_qos(), TAO_Notify_Proxy_T< SERVANT_TYPE >::get_qos(), TAO_Notify_EventChannel::get_qos(), and TAO_Notify_ConsumerAdmin::get_qos().

00287 {
00288   CosNotification::QoSProperties_var properties;
00289 
00290   ACE_NEW_THROW_EX (properties,
00291     CosNotification::QoSProperties (),
00292     CORBA::NO_MEMORY ());
00293 
00294   this->qos_properties_.populate (properties);
00295 
00296   return properties._retn ();
00297 }

TAO_Notify_Worker_Task * TAO_Notify_Object::get_worker_task ( void   ) 

Allow access to the underlying worker task.

Definition at line 361 of file Object.cpp.

References TAO_Notify_Refcountable_Guard_T< T >::get(), and worker_task_.

00362 {
00363   return this->worker_task_.get ();
00364 }

ACE_INLINE bool TAO_Notify_Object::has_shutdown ( void   ) 

Have we been shutdown. returns true if shutdown.

Definition at line 71 of file Object.inl.

References shutdown_.

Referenced by TAO_Notify::Routing_Slip::dispatch().

00072 {
00073   return this->shutdown_;
00074 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Long TAO_Notify_Object::id ( void   )  const

This Object's ID.

Definition at line 8 of file Object.inl.

References id_.

Referenced by TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Builder::build_event_channel(), TAO_Notify_Builder::build_supplier_admin(), TAO_Notify_Admin::cleanup_proxy(), TAO_Notify_EventChannel::default_consumer_admin(), TAO_Notify_EventChannel::default_supplier_admin(), TAO_Notify::Routing_Slip::dispatch(), TAO_Notify_EventChannelFactory::get_id(), TAO_Notify_SupplierAdmin::MyID(), and TAO_Notify_ConsumerAdmin::MyID().

00009 {
00010   return id_;
00011 }

ACE_INLINE void TAO_Notify_Object::inherit_poas ( TAO_Notify_Object parent  )  [protected]

Uses the poas from the supplied object.

Definition at line 24 of file Object.inl.

References object_poa(), own_object_poa_, own_proxy_poa_, poa(), proxy_poa(), set_object_poa(), set_poa(), and set_proxy_poa().

Referenced by initialize().

00025 {
00026   this->set_proxy_poa( parent.proxy_poa() );
00027   this->set_object_poa( parent.object_poa() );
00028   this->set_poa( parent.poa() );
00029 
00030   // Do not take ownership of parent's poas
00031   own_proxy_poa_ = false;
00032   own_object_poa_ = false;
00033 }

void TAO_Notify_Object::initialize ( TAO_Notify_Object parent  )  [protected]

Init this object with data from <rhs>.

Definition at line 46 of file Object.cpp.

References ACE_ASSERT, admin_properties_, event_manager_, TAO_Notify_Refcountable_Guard_T< T >::get(), inherit_poas(), qos_changed(), qos_properties_, TAO_Notify_QoSProperties::transfer(), and worker_task_.

Referenced by TAO_Notify::Topology_Object::initialize().

00047 {
00048   ACE_ASSERT (parent != 0 && this->event_manager_.get() == 0);
00049 
00050   // Do not use sets to avoid asserts.
00051   // Object must be able to inherit NULL references
00052   // due to current design.
00053   this->event_manager_ = parent->event_manager_;
00054   this->admin_properties_ = parent->admin_properties_;
00055   this->inherit_poas( *parent );
00056   this->worker_task_ = parent->worker_task_;
00057 
00058   // Pass  QoS
00059   parent->qos_properties_.transfer (this->qos_properties_);
00060   this->qos_changed (this->qos_properties_);
00061 }

void TAO_Notify_Object::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 in TAO_Notify_Admin, TAO_Notify_EventChannel, TAO_Notify_ProxyPushConsumer, TAO_Notify_ProxyPushSupplier, TAO_Notify_SequenceProxyPushConsumer, TAO_Notify_SequenceProxyPushSupplier, TAO_Notify_StructuredProxyPushConsumer, and TAO_Notify_StructuredProxyPushSupplier.

Definition at line 348 of file Object.cpp.

References TAO_Notify_QoSProperties::init(), TAO_Notify::NVPList::load(), and qos_properties_.

Referenced by TAO_Notify_StructuredProxyPushSupplier::load_attrs(), TAO_Notify_StructuredProxyPushConsumer::load_attrs(), TAO_Notify_SequenceProxyPushSupplier::load_attrs(), TAO_Notify_SequenceProxyPushConsumer::load_attrs(), TAO_Notify_ProxyPushSupplier::load_attrs(), TAO_Notify_ProxyPushConsumer::load_attrs(), TAO_Notify_EventChannel::load_attrs(), TAO_Notify_Admin::load_attrs(), TAO_Notify_SupplierAdmin::load_proxy(), and TAO_Notify_ConsumerAdmin::load_proxy().

00349 {
00350   attrs.load (this->qos_properties_.event_reliability ());
00351   attrs.load (this->qos_properties_.connection_reliability ());
00352   attrs.load (this->qos_properties_.priority ());
00353   attrs.load (this->qos_properties_.timeout ());
00354   attrs.load (this->qos_properties_.stop_time_supported ());
00355   attrs.load (this->qos_properties_.maximum_batch_size ());
00356   attrs.load (this->qos_properties_.pacing_interval ());
00357   this->qos_properties_.init ();
00358 }

ACE_INLINE TAO_Notify_POA_Helper * TAO_Notify_Object::object_poa ( void   )  [protected]

Accessor for the object_poa_.

Definition at line 59 of file Object.inl.

References object_poa_.

Referenced by inherit_poas(), TAO_Notify_EventChannelFactory::init(), and set_object_poa().

00060 {
00061   return this->object_poa_;
00062 }

ACE_INLINE TAO_Notify_POA_Helper * TAO_Notify_Object::poa ( void   )  [protected]

Get the POA assigned to us.

Definition at line 53 of file Object.inl.

References poa_.

Referenced by TAO_Notify_EventChannel::default_consumer_admin(), TAO_Notify_EventChannel::default_supplier_admin(), inherit_poas(), and set_poa().

00054 {
00055   return this->poa_;
00056 }

ACE_INLINE TAO_Notify_POA_Helper * TAO_Notify_Object::proxy_poa ( void   )  [protected]

Accessor for the proxy_poa_.

Definition at line 65 of file Object.inl.

References proxy_poa_.

Referenced by TAO_Notify_Proxy::deactivate(), inherit_poas(), and set_proxy_poa().

00066 {
00067   return this->proxy_poa_;
00068 }

void TAO_Notify_Object::qos_changed ( const TAO_Notify_QoSProperties qos_properties  )  [protected, virtual]

Notification that can be overridden by subclasses to be informed that <qos_properties_> have been modified.

Reimplemented in TAO_Notify_Proxy, and TAO_Notify_ProxySupplier.

Definition at line 311 of file Object.cpp.

Referenced by initialize(), and set_qos().

00312 {
00313   // NOP.
00314 }

CORBA::Object_ptr TAO_Notify_Object::ref ( void   ) 

Get CORBA Ref.

Definition at line 125 of file Object.cpp.

References TAO_Notify_POA_Helper::id_to_reference(), and poa_.

Referenced by TAO_Notify_RT_StructuredProxyPushSupplier::activate(), TAO_Notify_ProxySupplier_T< SERVANT_TYPE >::MyAdmin(), and TAO_Notify_ProxyConsumer_T< SERVANT_TYPE >::MyAdmin().

00126 {
00127   return this->poa_->id_to_reference (this->id_);
00128 }

void TAO_Notify_Object::save_attrs ( TAO_Notify::NVPList attrs  )  [protected, virtual]

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

Reimplemented in TAO_Notify_Admin, TAO_Notify_EventChannel, and TAO_Notify_Proxy.

Definition at line 336 of file Object.cpp.

References add_qos_attr().

Referenced by TAO_Notify_Proxy::save_attrs(), TAO_Notify_EventChannel::save_attrs(), and TAO_Notify_Admin::save_attrs().

00337 {
00338   add_qos_attr(attrs, this->qos_properties_.event_reliability ());
00339   add_qos_attr(attrs, this->qos_properties_.connection_reliability ());
00340   add_qos_attr(attrs, this->qos_properties_.priority ());
00341   add_qos_attr(attrs, this->qos_properties_.timeout ());
00342   add_qos_attr(attrs, this->qos_properties_.stop_time_supported ());
00343   add_qos_attr(attrs, this->qos_properties_.maximum_batch_size ());
00344   add_qos_attr(attrs, this->qos_properties_.pacing_interval ());
00345 }

ACE_INLINE void TAO_Notify_Object::set_admin_properties ( TAO_Notify_AdminProperties admin_properties  )  [protected]

Definition at line 77 of file Object.inl.

References ACE_ASSERT, admin_properties(), admin_properties_, and ACE_Strong_Bound_Ptr< X, ACE_LOCK >::reset().

Referenced by TAO_Notify_EventChannel::init().

00078 {
00079   ACE_ASSERT( admin_properties != 0 );
00080   this->admin_properties_.reset( admin_properties );
00081 }

void TAO_Notify_Object::set_event_manager ( TAO_Notify_Event_Manager event_manager  )  [protected]

Definition at line 64 of file Object.cpp.

References ACE_ASSERT, event_manager(), event_manager_, and TAO_Notify_Refcountable_Guard_T< T >::reset().

Referenced by TAO_Notify_EventChannel::init().

00065 {
00066   ACE_ASSERT( event_manager != 0 );
00067   this->event_manager_.reset( event_manager );
00068 }

void TAO_Notify_Object::set_object_poa ( TAO_Notify_POA_Helper object_poa  )  [private]

Setting the object_poa_ gives ownership to this class.

Definition at line 228 of file Object.cpp.

References destroy_object_poa(), object_poa(), object_poa_, and own_object_poa_.

Referenced by adopt_poa(), and inherit_poas().

00229 {
00230   // shutdown current object poa.
00231   this->destroy_object_poa ();
00232 
00233   this->object_poa_ = object_poa;
00234 
00235   this->own_object_poa_ = true;
00236 }

void TAO_Notify_Object::set_poa ( TAO_Notify_POA_Helper object_poa  )  [private]

Setting the object_poa_ gives ownership to this class.

Definition at line 239 of file Object.cpp.

References poa(), and poa_.

Referenced by adopt_poa(), inherit_poas(), and set_primary_as_proxy_poa().

00240 {
00241   this->poa_ = poa;
00242 }

ACE_INLINE void TAO_Notify_Object::set_primary_as_proxy_poa (  )  [protected]

Changes the primary poa to the current proxy poa.

Definition at line 47 of file Object.inl.

References set_poa().

Referenced by TAO_Notify_Proxy::activate().

00048 {
00049   this->set_poa( this->proxy_poa() );
00050 }

void TAO_Notify_Object::set_proxy_poa ( TAO_Notify_POA_Helper proxy_poa  )  [private]

Setting the proxy_poa_ gives ownership to this class.

Definition at line 217 of file Object.cpp.

References destroy_proxy_poa(), own_proxy_poa_, proxy_poa(), and proxy_poa_.

Referenced by adopt_poa(), TAO_Notify_RT_Builder::apply_lane_concurrency(), TAO_Notify_RT_Builder::apply_thread_pool_concurrency(), and inherit_poas().

00218 {
00219   // shutdown current proxy poa.
00220   this->destroy_proxy_poa ();
00221 
00222   this->proxy_poa_ = proxy_poa;
00223 
00224   this->own_proxy_poa_ = true;
00225 }

void TAO_Notify_Object::set_qos ( const CosNotification::QoSProperties qos  )  [virtual]

Set the QoS Properties.

Reimplemented in TAO_Notify_ConsumerAdmin, TAO_Notify_EventChannel, TAO_Notify_Proxy_T< SERVANT_TYPE >, TAO_Notify_SupplierAdmin, TAO_Notify_Proxy_T< POA_Event_Forwarder::ProxyPushSupplier >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::ProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::SequenceProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::SequenceProxyPushSupplier >, TAO_Notify_Proxy_T< POA_Event_Forwarder::StructuredProxyPushSupplier >, TAO_Notify_Proxy_T< POA_CosEventChannelAdmin::ProxyPushConsumer >, TAO_Notify_Proxy_T< POA_CosEventChannelAdmin::ProxyPushSupplier >, and TAO_Notify_Proxy_T< POA_CosNotifyChannelAdmin::StructuredProxyPushConsumer >.

Definition at line 245 of file Object.cpp.

References TAO_Notify_Builder::apply_reactive_concurrency(), TAO_Notify_Properties::builder(), TAO_Notify_QoSProperties::copy(), TAO_Notify_QoSProperties::init(), TAO_Notify_Properties::instance(), TAO_Notify_StructProperty_T< TYPE >::is_valid(), qos_changed(), TAO_Notify_QoSProperties::thread_pool(), TAO_Notify_QoSProperties::thread_pool_lane(), TAO_Notify_StructProperty_T< TYPE >::value(), and worker_task_.

Referenced by TAO_Notify_ProxySupplier::init(), TAO_Notify_ProxyConsumer::init(), TAO_Notify_SupplierAdmin::set_qos(), TAO_Notify_Proxy_T< SERVANT_TYPE >::set_qos(), TAO_Notify_EventChannel::set_qos(), and TAO_Notify_ConsumerAdmin::set_qos().

00246 {
00247   CosNotification::PropertyErrorSeq err_seq;
00248 
00249   TAO_Notify_QoSProperties new_qos_properties;
00250 
00251   if (new_qos_properties.init (qos, err_seq) == -1)
00252     throw CORBA::INTERNAL ();
00253 
00254   // Apply the appropriate concurrency QoS
00255   if (new_qos_properties.thread_pool ().is_valid ())
00256   {
00257     if (new_qos_properties.thread_pool ().value ().static_threads == 0)
00258       {
00259         TAO_Notify_PROPERTIES::instance()->builder()->apply_reactive_concurrency (*this);
00260       }
00261     else
00262       {
00263         TAO_Notify_PROPERTIES::instance()->builder()->
00264         apply_thread_pool_concurrency (*this, new_qos_properties.thread_pool ().value ());
00265       }
00266   }
00267   else if (new_qos_properties.thread_pool_lane ().is_valid ())
00268     TAO_Notify_PROPERTIES::instance()->builder()->
00269     apply_lane_concurrency (*this, new_qos_properties.thread_pool_lane ().value ());
00270 
00271   // Update the Thread Task's QoS properties..
00272   this->worker_task_->update_qos_properties (new_qos_properties);
00273 
00274   // Inform subclasses of QoS changed.
00275   this->qos_changed (new_qos_properties);
00276 
00277   // Init the the overall QoS on this object.
00278   if (new_qos_properties.copy (this->qos_properties_) == -1)
00279     throw CORBA::INTERNAL ();
00280 
00281   if (err_seq.length () > 0) // Unsupported Property
00282     throw CosNotification::UnsupportedQoS (err_seq);
00283 }

void TAO_Notify_Object::set_worker_task ( TAO_Notify_Worker_Task worker_task  )  [private]

Set Worker Task. This object assume ownership of the set object.

Definition at line 204 of file Object.cpp.

References ACE_ASSERT, own_worker_task_, TAO_Notify_Refcountable_Guard_T< T >::reset(), shutdown_worker_task(), and worker_task_.

Referenced by TAO_Notify_Builder::apply_reactive_concurrency(), and TAO_Notify_Builder::apply_thread_pool_concurrency().

00205 {
00206   ACE_ASSERT( worker_task != 0 );
00207 
00208   // shutdown the current worker.
00209   this->shutdown_worker_task ();
00210 
00211   this->worker_task_.reset (worker_task);
00212 
00213   this->own_worker_task_ = true;
00214 }

int TAO_Notify_Object::shutdown ( void   )  [virtual]

Shutdown. Returns 1 if the shutdown was already run once before.

Reimplemented in TAO_Notify_Admin, TAO_Notify_EventChannel, TAO_Notify_EventChannelFactory, TAO_Notify_ProxyConsumer, and TAO_Notify_ProxySupplier.

Definition at line 106 of file Object.cpp.

References ACE_GUARD_RETURN, deactivate(), shutdown_, shutdown_worker_task(), and TAO_SYNCH_MUTEX.

Referenced by TAO_Notify_EventChannelFactory::shutdown(), TAO_Notify_EventChannel::shutdown(), and TAO_Notify_Admin::shutdown().

00107 {
00108   {
00109     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 1);
00110 
00111     if (this->shutdown_ == 1)
00112       return 1; // Another thread has already run shutdown.
00113 
00114     this->shutdown_ = 1;
00115   }
00116 
00117   this->deactivate ();
00118 
00119   this->shutdown_worker_task ();
00120 
00121   return 0;
00122 }

void TAO_Notify_Object::shutdown_worker_task ( void   )  [private]

Shutdown the current worker task and delete it if we own it.

Definition at line 131 of file Object.cpp.

References TAO_Notify_Refcountable_Guard_T< T >::isSet(), TAO_Notify_Refcountable_Guard_T< T >::reset(), and worker_task_.

Referenced by set_worker_task(), and shutdown().

00132 {
00133   // Only do this if we are the owner.
00134   TAO_Notify_Worker_Task::Ptr task( this->worker_task_ );
00135   this->worker_task_.reset();
00136   if ( task.isSet() )
00137   {
00138     if ( this->own_worker_task_ )
00139     {
00140       task->shutdown ();
00141     }
00142   }
00143 }

TAO_Notify_Timer * TAO_Notify_Object::timer ( void   )  [virtual]

Obtain the Timer manager associated with this object.

Definition at line 317 of file Object.cpp.

References ACE_ASSERT, TAO_Notify_Refcountable_Guard_T< T >::get(), and worker_task_.

00318 {
00319   ACE_ASSERT (worker_task_.get() != 0);
00320   return this->worker_task_->timer ();
00321 }


Friends And Related Function Documentation

friend class TAO_Notify_Builder [friend]

Reimplemented in TAO_Notify_Admin, TAO_Notify_EventChannel, TAO_Notify_EventChannelFactory, TAO_Notify_CosEC_ProxyPushConsumer, TAO_Notify_CosEC_ProxyPushSupplier, TAO_Notify_ProxyPushConsumer, TAO_Notify_ProxyPushSupplier, TAO_Notify_SequenceProxyPushConsumer, TAO_Notify_SequenceProxyPushSupplier, TAO_Notify_StructuredProxyPushConsumer, and TAO_Notify_StructuredProxyPushSupplier.

Definition at line 49 of file Object.h.

friend class TAO_Notify_RT_Builder [friend]

Definition at line 50 of file Object.h.


Member Data Documentation

TAO_Notify_AdminProperties::Ptr TAO_Notify_Object::admin_properties_ [private]

Admin Properties.

Definition at line 206 of file Object.h.

Referenced by admin_properties(), TAO_Notify_Builder::apply_thread_pool_concurrency(), initialize(), and set_admin_properties().

TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager > TAO_Notify_Object::event_manager_ [private]

The event manager. TAO_Notify_Event_Manager inl includes Object.h

Definition at line 203 of file Object.h.

Referenced by event_manager(), initialize(), and set_event_manager().

ID TAO_Notify_Object::id_ [private]

Id assigned to this object.

Definition at line 199 of file Object.h.

Referenced by activate(), and id().

TAO_SYNCH_MUTEX TAO_Notify_Object::lock_ [protected]

The mutex to serialize access to state variables.

Reimplemented in TAO_Notify_FilterAdmin.

Definition at line 183 of file Object.h.

Referenced by TAO_Notify_Consumer::proxy_lock().

TAO_Notify_POA_Helper* TAO_Notify_Object::object_poa_ [private]

The POA in which the object's children are activated.

Definition at line 195 of file Object.h.

Referenced by destroy_object_poa(), destroy_proxy_poa(), object_poa(), and set_object_poa().

bool TAO_Notify_Object::own_object_poa_ [private]

Definition at line 196 of file Object.h.

Referenced by destroy_object_poa(), inherit_poas(), and set_object_poa().

bool TAO_Notify_Object::own_proxy_poa_ [private]

Definition at line 192 of file Object.h.

Referenced by destroy_proxy_poa(), inherit_poas(), and set_proxy_poa().

bool TAO_Notify_Object::own_worker_task_ [private]

Definition at line 210 of file Object.h.

Referenced by set_worker_task().

TAO_Notify_POA_Helper* TAO_Notify_Object::poa_ [private]

The POA in which the object is activated.

Definition at line 188 of file Object.h.

Referenced by activate(), deactivate(), destroy_object_poa(), destroy_poa(), destroy_proxy_poa(), poa(), ref(), and set_poa().

TAO_Notify_POA_Helper* TAO_Notify_Object::proxy_poa_ [private]

The POA in which the proxys are activated.

Definition at line 191 of file Object.h.

Referenced by destroy_object_poa(), destroy_proxy_poa(), proxy_poa(), and set_proxy_poa().

TAO_Notify_QoSProperties TAO_Notify_Object::qos_properties_ [protected]

QoS Properties.

Definition at line 153 of file Object.h.

Referenced by get_qos(), initialize(), and load_attrs().

bool TAO_Notify_Object::shutdown_ [private]

Are we shutdown (i,e. scheduled for destroy).

Definition at line 213 of file Object.h.

Referenced by has_shutdown(), and shutdown().

TAO_Notify_Worker_Task::Ptr TAO_Notify_Object::worker_task_ [private]

Worker Task.

Definition at line 209 of file Object.h.

Referenced by get_worker_task(), initialize(), set_qos(), set_worker_task(), shutdown_worker_task(), and timer().


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