diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Object.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Object.h | 93 |
1 files changed, 69 insertions, 24 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.h b/TAO/orbsvcs/orbsvcs/Notify/Object.h index 211e10e84fa..43c2906996b 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Object.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Object.h @@ -19,16 +19,16 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/corba.h" #include "tao/PortableServer/Servant_Base.h" -#include "Types.h" -#include "PropertySeq.h" +#include "orbsvcs/NotifyExtC.h" +#include "QoSProperties.h" +#include "AdminProperties.h" +#include "Refcountable.h" class TAO_NS_POA_Helper; class TAO_NS_Worker_Task; -class TAO_NS_QoSAdmin; class TAO_NS_Event_Manager; -class TAO_NS_AdminProperties; +class TAO_NS_Timer; /** * @class TAO_NS_Object @@ -36,29 +36,31 @@ class TAO_NS_AdminProperties; * @brief Base Object for RT_Notify's CORBA Objects. * */ -class TAO_Notify_Export TAO_NS_Object +class TAO_Notify_Export TAO_NS_Object : public TAO_NS_Refcountable { + friend class TAO_NS_Builder; + public: + /// Id for Objects. + typedef CORBA::Long ID; + /// Constuctor TAO_NS_Object (void); /// Destructor virtual ~TAO_NS_Object (void); - /// Init. - void init (TAO_NS_POA_Helper* poa, TAO_NS_Worker_Task* worker_task ACE_ENV_ARG_DECL); - /// This Object's ID - CORBA::Long id (void); + ID id (void); /// Activate - CORBA::Object_ptr activate (ACE_ENV_SINGLE_ARG_DECL); + virtual CORBA::Object_ptr activate (PortableServer::Servant servant ACE_ENV_ARG_DECL); /// Deactivate void deactivate (ACE_ENV_SINGLE_ARG_DECL); - /// shutdown - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL); + /// Have we been shutdown. returns 1 if shutdown. + int has_shutdown (void); /// Get CORBA Ref. CORBA::Object_ptr ref (ACE_ENV_SINGLE_ARG_DECL); @@ -69,46 +71,89 @@ public: /// Get the POA assigned to us. TAO_NS_POA_Helper* poa (void); + /// Setting the proxy_poa_ gives ownership to this class. + void proxy_poa_own (TAO_NS_POA_Helper* proxy_poa); + + /// Accessor for the proxy_poa_ + TAO_NS_POA_Helper* proxy_poa (void); + + /// Setting the object_poa_ gives ownership to this class. + void object_poa_own (TAO_NS_POA_Helper* object_poa); + + /// Accessor for the object_poa_ + TAO_NS_POA_Helper* object_poa (void); + /// Set Worker Task. This object assume ownership of the set object. void worker_task_own (TAO_NS_Worker_Task* worker_task); /// Set Worker Task. Does not assume ownership. void worker_task (TAO_NS_Worker_Task* worker_task); + /// Set the QoS Properties. + virtual void set_qos (const CosNotification::QoSProperties & qos ACE_ENV_ARG_DECL); + + /// Get the QoS Properties. + CosNotification::QoSProperties* get_qos (ACE_ENV_SINGLE_ARG_DECL); + + /// Obtain the Timer manager associated with this object. + virtual TAO_NS_Timer* timer (void); + + /// shutdown. Returns 1 ifif the shutdown was already run once before. + virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); + protected: - /// Servant which we use. - virtual PortableServer::Servant servant (void) = 0; + /// Init this object with data from <rhs>. + void init (TAO_NS_Object* parent); /// Shutdown the current worker task and delete it if we own it. void shutdown_worker_task (void); + /// Shutdown the current proxy poa. + void shutdown_proxy_poa (void); + + /// Shutdown the current object poa. + void shutdown_object_poa (void); + + /// Notification that can be overridden by subclasses to be informed that <qos_properties_> have been modified. + virtual void qos_changed (const TAO_NS_QoSProperties& qos_properties); + ///= Protected data members. /// The event manager. TAO_NS_Event_Manager* event_manager_; - /// Administer Qos functionality. - TAO_NS_QoSAdmin* qos_admin_; - - ///=Attributes - /// Admin Properties. - TAO_NS_AdminProperties* admin_properties_; + TAO_NS_AdminProperties_var admin_properties_; /// QoS Properties. - TAO_NS_PropertySeq qos_properties_; + TAO_NS_QoSProperties qos_properties_; /// Id assigned to this object - TAO_NS_Object_Id id_; + ID id_; /// The POA in which the object is activated. TAO_NS_POA_Helper* poa_; + /// The POA in which the proxys are activated. + TAO_NS_POA_Helper* proxy_poa_; + + /// Flag that indicates if we own <proxy_poa_> + int own_proxy_poa_; + + /// The POA in which the object's children are activated. + TAO_NS_POA_Helper* object_poa_; + + /// Flag that indicates if we own <object_poa_> + int own_object_poa_; + /// Worker Task. TAO_NS_Worker_Task* worker_task_; /// Ownership flag - int delete_worker_task_; + int own_worker_task_; + + /// Are we shutdown (i,e. scheduled for destroy). + int shutdown_; }; #if defined (__ACE_INLINE__) |