ThreadPool_Task.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /**
00004  *  @file ThreadPool_Task.h
00005  *
00006  *  ThreadPool_Task.h,v 1.22 2006/03/14 06:14:34 jtc Exp
00007  *
00008  *  @author Pradeep Gore <pradeep@oomworks.com>
00009  */
00010 
00011 #ifndef TAO_Notify_THREADPOOL_TASK_H
00012 #define TAO_Notify_THREADPOOL_TASK_H
00013 
00014 #include /**/ "ace/pre.h"
00015 
00016 #include "orbsvcs/Notify/notify_serv_export.h"
00017 
00018 #include "orbsvcs/Notify/Timer_Queue.h"
00019 #include "orbsvcs/Notify/AdminProperties.h"
00020 #include "orbsvcs/Notify/Worker_Task.h"
00021 
00022 #include "ace/Task.h"
00023 #include "ace/Message_Queue.h"
00024 #include "ace/Reactor.h"
00025 #include "ace/Null_Condition.h"
00026 
00027 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00028 # pragma once
00029 #endif /* ACE_LACKS_PRAGMA_ONCE */
00030 
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032 
00033 class TAO_Notify_Buffering_Strategy;
00034 
00035 /**
00036  * @class TAO_Notify_ThreadPool_Task
00037  *
00038  * @brief Implements a Thread Pool Worker Task.
00039  *
00040  */
00041 class TAO_Notify_Serv_Export TAO_Notify_ThreadPool_Task
00042   : public TAO_Notify_Worker_Task
00043   , public ACE_Task<ACE_NULL_SYNCH>
00044 {
00045   friend class TAO_Notify_Method_Request_Shutdown;
00046 
00047 public:
00048   /// Constuctor
00049   TAO_Notify_ThreadPool_Task (void);
00050 
00051   /// Destructor
00052   virtual ~TAO_Notify_ThreadPool_Task ();
00053 
00054   /// Call the base class init
00055   virtual int init (int argc, ACE_TCHAR **argv);
00056 
00057   /// release reference to my self.
00058   virtual int close (u_long flags);
00059 
00060   /// Activate the threadpool
00061   void init (const NotifyExt::ThreadPoolParams& tp_params, const TAO_Notify_AdminProperties::Ptr& admin_properties ACE_ENV_ARG_DECL);
00062 
00063   /// Queue the request
00064   virtual void execute (TAO_Notify_Method_Request& method_request ACE_ENV_ARG_DECL);
00065 
00066   /// Shutdown task
00067   virtual void shutdown ();
00068 
00069   /// Update QoS Properties.
00070   virtual void update_qos_properties (const TAO_Notify_QoSProperties& qos_properties);
00071 
00072   /// The object used by clients to register timers.
00073   virtual TAO_Notify_Timer* timer (void);
00074 
00075 protected:
00076   /// Task svc
00077   virtual int svc (void);
00078 
00079 private:
00080   /// Release
00081   virtual void release (void);
00082 
00083   /// The buffering strategy to use.
00084   ACE_Auto_Ptr< TAO_Notify_Buffering_Strategy > buffering_strategy_;
00085 
00086   /// Shutdown
00087   bool shutdown_;
00088 
00089   /// The Queue based timer.
00090   TAO_Notify_Timer_Queue::Ptr timer_;
00091 };
00092 
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 #include /**/ "ace/post.h"
00097 
00098 #endif /* TAO_Notify_THREADPOOL_TASK_H */

Generated on Thu Nov 9 13:24:17 2006 for TAO_CosNotification by doxygen 1.3.6