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

int has_shutdown (void)
 Have we been shutdown. returns 1 if shutdown.

void execute_task (TAO_Notify_Method_Request &method_request)
CORBA::Object_ptr ref ()
 Get CORBA Ref.

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

CosNotification::QoSPropertiesget_qos ()
 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 ()
 shutdown. Returns 1 ifif the shutdown was already run once before.

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

Protected Member Functions

 TAO_Notify_Object (void)
 Constructor.

void initialize (TAO_Notify_Object *parent)
 Init this object with data from .

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)
 Notification that can be overridden by subclasses to be informed that have been modified.

virtual void save_attrs (TAO_Notify::NVPList &attrs)

Protected Attributes

TAO_Notify_QoSProperties qos_properties_
 = Protected data members. 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_
 The 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.

Referenced by TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::find(), TAO_Notify_EventChannel::get_id(), TAO_Notify_Find_Worker_T< TYPE, INTERFACE, INTERFACE_PTR, EXCEPTION >::resolve(), TAO_Notify_ID_Factory::set_last_used(), TAO_Notify_Method_Request_Lookup::unmarshal(), and TAO_Notify_Method_Request_Dispatch::unmarshal().


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 ACE_ENV_ARG_PARAMETER, and TAO_Notify_POA_Helper::activate_with_id().

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

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 ACE_ENV_ARG_PARAMETER, and TAO_Notify_POA_Helper::activate().

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_ ACE_ENV_ARG_PARAMETER);
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.

Referenced by TAO_Notify_ProxySupplier::disconnect(), TAO_Notify_ProxyConsumer::disconnect(), and TAO_Notify_EventChannel::load_attrs().

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  ) 
 

Deactivate.

Reimplemented in TAO_Notify_Proxy.

Definition at line 89 of file Object.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DEBUG, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, TAO_Notify_POA_Helper::deactivate(), LM_DEBUG, and TAO_debug_level.

Referenced by shutdown().

00090 {
00091   ACE_TRY
00092   {
00093     this->poa_->deactivate (this->id_ ACE_ENV_ARG_PARAMETER);
00094     ACE_TRY_CHECK;
00095   }
00096   ACE_CATCHANY
00097   {
00098     // Do not propagate any exceptions
00099     if (TAO_debug_level > 2)
00100     {
00101       ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t)\n");
00102       ACE_DEBUG ((LM_DEBUG, "Could not deactivate object %d\n", this->id_));
00103     }
00104   }
00105   ACE_ENDTRY;
00106 }

void TAO_Notify_Object::destroy_object_poa void   )  [private]
 

Shutdown the current object poa.

Definition at line 179 of file Object.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, TAO_Notify_POA_Helper::destroy(), object_poa_, own_object_poa_, proxy_poa_, and TAO_debug_level.

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

00180 {
00181   if (this->object_poa_ != 0)
00182   {
00183     ACE_TRY_NEW_ENV
00184     {
00185       if ( this->object_poa_ == this->proxy_poa_ ) this->proxy_poa_ = 0;
00186       if ( this->object_poa_ == this->poa_ ) this->poa_ = 0;
00187 
00188       if ( this->own_object_poa_ == true )
00189       {
00190         this->own_object_poa_ = false;
00191         ACE_Auto_Ptr< TAO_Notify_POA_Helper > aop( object_poa_ );
00192         this->object_poa_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
00193         ACE_TRY_CHECK;
00194       }
00195       this->object_poa_ = 0;
00196     }
00197     ACE_CATCHANY
00198     {
00199       if (TAO_debug_level > 2)
00200         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00201         "Proxy shutdown error (%P|%t)\n");
00202     }
00203     ACE_ENDTRY;
00204   }
00205 }

void TAO_Notify_Object::destroy_poa void   )  [private]
 

Shutdown the current poa.

Definition at line 208 of file Object.cpp.

Referenced by ~TAO_Notify_Object().

00209 {
00210   this->poa_ = 0;
00211 }

void TAO_Notify_Object::destroy_proxy_poa void   )  [private]
 

Shutdown the current proxy poa.

Definition at line 150 of file Object.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TRY_CHECK, ACE_TRY_NEW_ENV, TAO_Notify_POA_Helper::destroy(), object_poa_, own_proxy_poa_, proxy_poa_, and TAO_debug_level.

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

00151 {
00152   if (this->proxy_poa_ != 0)
00153   {
00154     ACE_TRY_NEW_ENV
00155     {
00156       if ( this->proxy_poa_ == this->object_poa_ ) this->object_poa_ = 0;
00157       if ( this->proxy_poa_ == this->poa_ ) this->poa_ = 0;
00158 
00159       if ( this->own_proxy_poa_ == true )
00160       {
00161         this->own_proxy_poa_ = false;
00162         ACE_Auto_Ptr< TAO_Notify_POA_Helper > app( object_poa_ );
00163         this->proxy_poa_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
00164         ACE_TRY_CHECK;
00165       }
00166       this->proxy_poa_ = 0;
00167     }
00168     ACE_CATCHANY
00169     {
00170       if (TAO_debug_level > 2)
00171         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00172         "Proxy shutdown error (%P|%t)\n");
00173     }
00174     ACE_ENDTRY;
00175   }
00176 }

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::disconnect(), TAO_Notify_ProxyConsumer::disconnect(), TAO_Notify_Method_Request_Lookup::execute_i(), TAO_Notify_EventChannel::init(), and TAO_Notify_EventChannel::shutdown().

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

void TAO_Notify_Object::execute_task TAO_Notify_Method_Request method_request  ) 
 

Referenced by TAO_Notify_ProxySupplier::deliver(), TAO_Notify::Routing_Slip::dispatch(), TAO_Notify_ProxyConsumer::push_i(), TAO_Notify::Routing_Slip::route(), and TAO_Notify_Proxy::types_changed().

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

Definition at line 313 of file Object.cpp.

References TAO_Notify_PropertySeq::find(), CosNotification::PropertyValue, and qos_properties_.

Referenced by TAO_Notify_ProxyConsumer::supports_reliable_events().

00316 {
00317   return this->qos_properties_.find (name, value);
00318 }

CosNotification::QoSProperties * TAO_Notify_Object::get_qos  ) 
 

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 299 of file Object.cpp.

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

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

00300 {
00301   CosNotification::QoSProperties_var properties;
00302 
00303   ACE_NEW_THROW_EX (properties,
00304     CosNotification::QoSProperties (),
00305     CORBA::NO_MEMORY ());
00306 
00307   this->qos_properties_.populate (properties);
00308 
00309   return properties._retn ();
00310 }

ACE_INLINE int TAO_Notify_Object::has_shutdown void   ) 
 

Have we been shutdown. returns 1 if shutdown.

Definition at line 71 of file Object.inl.

Referenced by TAO_Notify::Routing_Slip::dispatch(), TAO_Notify_Consumer::dispatch_pending(), and TAO_Notify_Method_Request_Lookup::execute_i().

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.

Referenced by TAO_Notify_Builder::build_consumer_admin(), TAO_Notify_Builder::build_event_channel(), TAO_Notify_Builder::build_supplier_admin(), TAO_Notify::Routing_Slip::dispatch(), TAO_Notify_EventChannelFactory::find_proxy_consumer(), TAO_Notify_EventChannelFactory::find_proxy_supplier(), and TAO_Notify_EventChannelFactory::get_id().

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 .

Definition at line 46 of file Object.cpp.

References ACE_ASSERT, admin_properties_, event_manager_, TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager >::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 359 of file Object.cpp.

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

Referenced by TAO_Notify_EventChannel::load_attrs(), TAO_Notify_Admin::load_attrs(), TAO_Notify_SupplierAdmin::load_proxy(), and TAO_Notify_ConsumerAdmin::load_proxy().

00360 {
00361   attrs.load (this->qos_properties_.event_reliability ());
00362   attrs.load (this->qos_properties_.connection_reliability ());
00363   attrs.load (this->qos_properties_.priority ());
00364   attrs.load (this->qos_properties_.timeout ());
00365   attrs.load (this->qos_properties_.stop_time_supported ());
00366   attrs.load (this->qos_properties_.maximum_batch_size ());
00367   attrs.load (this->qos_properties_.pacing_interval ());
00368   this->qos_properties_.init ();
00369 }

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

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.

Referenced by inherit_poas(), and TAO_Notify_EventChannel::load_child().

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(), and inherit_poas().

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 have been modified.

Reimplemented in TAO_Notify_Proxy, and TAO_Notify_ProxySupplier.

Definition at line 322 of file Object.cpp.

Referenced by initialize(), and set_qos().

00323 {
00324   // NOP.
00325 }

CORBA::Object_ptr TAO_Notify_Object::ref  ) 
 

Get CORBA Ref.

Definition at line 129 of file Object.cpp.

References ACE_ENV_ARG_PARAMETER, and TAO_Notify_POA_Helper::id_to_reference().

Referenced by TAO_Notify_RT_StructuredProxyPushSupplier::activate().

00130 {
00131   return this->poa_->id_to_reference (this->id_ ACE_ENV_ARG_PARAMETER);
00132 }

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

00348 {
00349   add_qos_attr(attrs, this->qos_properties_.event_reliability ());
00350   add_qos_attr(attrs, this->qos_properties_.connection_reliability ());
00351   add_qos_attr(attrs, this->qos_properties_.priority ());
00352   add_qos_attr(attrs, this->qos_properties_.timeout ());
00353   add_qos_attr(attrs, this->qos_properties_.stop_time_supported ());
00354   add_qos_attr(attrs, this->qos_properties_.maximum_batch_size ());
00355   add_qos_attr(attrs, this->qos_properties_.pacing_interval ());
00356 }

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, 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_, and TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager >::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 238 of file Object.cpp.

References destroy_object_poa(), object_poa_, and own_object_poa_.

Referenced by adopt_poa(), and inherit_poas().

00239 {
00240   // shutdown current object poa.
00241   this->destroy_object_poa ();
00242 
00243   this->object_poa_ = object_poa;
00244 
00245   this->own_object_poa_ = true;
00246 }

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 249 of file Object.cpp.

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

00250 {
00251   this->poa_ = poa;
00252 }

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 227 of file Object.cpp.

References destroy_proxy_poa(), own_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().

00228 {
00229   // shutdown current proxy poa.
00230   this->destroy_proxy_poa ();
00231 
00232   this->proxy_poa_ = proxy_poa;
00233 
00234   this->own_proxy_poa_ = true;
00235 }

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 255 of file Object.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_THROW, TAO_Notify_QoSProperties::copy(), TAO_Notify_QoSProperties::init(), TAO_Singleton< TYPE, ACE_LOCK >::instance(), TAO_Notify_StructProperty_T< TYPE >::is_valid(), CosNotification::PropertyErrorSeq, qos_changed(), CosNotification::QoSProperties, 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().

00256 {
00257   CosNotification::PropertyErrorSeq err_seq;
00258 
00259   TAO_Notify_QoSProperties new_qos_properties;
00260 
00261   if (new_qos_properties.init (qos, err_seq) == -1)
00262     ACE_THROW (CORBA::INTERNAL ());
00263 
00264   // Apply the appropriate concurrency QoS
00265   if (new_qos_properties.thread_pool ().is_valid ())
00266   {
00267     if (new_qos_properties.thread_pool ().value ().static_threads == 0)
00268       {
00269         TAO_Notify_PROPERTIES::instance()->builder()->apply_reactive_concurrency (*this ACE_ENV_ARG_PARAMETER);
00270         ACE_CHECK;
00271       }
00272     else
00273       {
00274         TAO_Notify_PROPERTIES::instance()->builder()->
00275         apply_thread_pool_concurrency (*this, new_qos_properties.thread_pool ().value () ACE_ENV_ARG_PARAMETER);
00276         ACE_CHECK;
00277       }
00278   }
00279   else if (new_qos_properties.thread_pool_lane ().is_valid ())
00280     TAO_Notify_PROPERTIES::instance()->builder()->
00281     apply_lane_concurrency (*this, new_qos_properties.thread_pool_lane ().value () ACE_ENV_ARG_PARAMETER);
00282   ACE_CHECK;
00283 
00284   // Update the Thread Task's QoS properties..
00285   this->worker_task_->update_qos_properties (new_qos_properties);
00286 
00287   // Inform subclasses of QoS changed.
00288   this->qos_changed (new_qos_properties);
00289 
00290   // Init the the overall QoS on this object.
00291   if (new_qos_properties.copy (this->qos_properties_) == -1)
00292     ACE_THROW (CORBA::INTERNAL ());
00293 
00294   if (err_seq.length () > 0) // Unsupported Property
00295     ACE_THROW (CosNotification::UnsupportedQoS (err_seq));
00296 }

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 214 of file Object.cpp.

References ACE_ASSERT, own_worker_task_, shutdown_worker_task(), and worker_task_.

Referenced by TAO_Notify_Builder::apply_thread_pool_concurrency().

00215 {
00216   ACE_ASSERT( worker_task != 0 );
00217 
00218   // shutdown the current worker.
00219   this->shutdown_worker_task ();
00220 
00221   this->worker_task_.reset (worker_task);
00222 
00223   this->own_worker_task_ = true;
00224 }

int TAO_Notify_Object::shutdown  )  [virtual]
 

shutdown. Returns 1 ifif 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 109 of file Object.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_GUARD_RETURN, deactivate(), shutdown_worker_task(), and TAO_SYNCH_MUTEX.

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

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

void TAO_Notify_Object::shutdown_worker_task void   )  [private]
 

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

Definition at line 135 of file Object.cpp.

References own_worker_task_, and worker_task_.

Referenced by set_worker_task(), and shutdown().

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

TAO_Notify_Timer * TAO_Notify_Object::timer void   )  [virtual]
 

Obtain the Timer manager associated with this object.

Definition at line 328 of file Object.cpp.

References ACE_ASSERT, and worker_task_.

00329 {
00330   ACE_ASSERT (worker_task_.get() != 0);
00331   return this->worker_task_->timer ();
00332 }


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 203 of file Object.h.

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

TAO_Notify_Refcountable_Guard_T< TAO_Notify_Event_Manager > TAO_Notify_Object::event_manager_ [private]
 

The event manager.

Definition at line 200 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 196 of file Object.h.

TAO_SYNCH_MUTEX TAO_Notify_Object::lock_ [protected]
 

The mutex to serialize access to state variables.

Reimplemented in TAO_Notify_FilterAdmin.

Definition at line 180 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 192 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 193 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 189 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 207 of file Object.h.

Referenced by set_worker_task(), and shutdown_worker_task().

TAO_Notify_POA_Helper* TAO_Notify_Object::poa_ [private]
 

The POA in which the object is activated.

Definition at line 185 of file Object.h.

TAO_Notify_POA_Helper* TAO_Notify_Object::proxy_poa_ [private]
 

The POA in which the proxys are activated.

Definition at line 188 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]
 

= Protected data members. QoS Properties.

Definition at line 150 of file Object.h.

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

bool TAO_Notify_Object::shutdown_ [private]
 

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

Definition at line 210 of file Object.h.

TAO_Notify_Worker_Task::Ptr TAO_Notify_Object::worker_task_ [private]
 

Worker Task.

Definition at line 206 of file Object.h.

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


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