Thread_Per_Connection_Handler.h

Go to the documentation of this file.
00001 //x -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file Thread_Per_Connection_Handler.h
00006  *
00007  *  Thread_Per_Connection_Handler.h,v 1.9 2005/11/02 11:03:27 ossama Exp
00008  *
00009  *  Definition of a connection handler for the thread-per-connection
00010  *  strategy.
00011  *
00012  *  @author  Balachandran Natarajan <bala@dre.vanderbilt.edu>
00013  */
00014 //=============================================================================
00015 
00016 #ifndef TAO_THREAD_PER_CONNECTION_HANDLER_H
00017 #define TAO_THREAD_PER_CONNECTION_HANDLER_H
00018 
00019 #include /**/ "ace/pre.h"
00020 #include "ace/Task_T.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "tao/TAO_Export.h"
00027 #include "tao/Versioned_Namespace.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 class TAO_Connection_Handler;
00032 class TAO_ORB_Core;
00033 
00034 typedef ACE_Task<ACE_NULL_SYNCH> TAO_TPC_BASE;
00035 
00036 /**
00037  * @class TAO_Thread_Per_Connection_Handler
00038  *
00039  * @brief Definition for the thread-per-connection strategy.
00040  *
00041  * This object acts as an active object, encapsulating the protocol
00042  * specific handler which the active thread uses to process incoming
00043  * messages.
00044  *
00045  */
00046 class TAO_Export TAO_Thread_Per_Connection_Handler : public TAO_TPC_BASE
00047 {
00048 public:
00049   TAO_Thread_Per_Connection_Handler (TAO_Connection_Handler *ch,
00050                                      TAO_ORB_Core *oc);
00051 
00052   ~TAO_Thread_Per_Connection_Handler (void);
00053 
00054   /// = Active object activation method.
00055   /**
00056    * @todo This probably needs to go after x.4.1
00057    */
00058   virtual int activate (long flags = THR_NEW_LWP,
00059                         int n_threads = 1,
00060                         int force_active = 0,
00061                         long priority = ACE_DEFAULT_THREAD_PRIORITY,
00062                         int grp_id = -1,
00063                         ACE_Task_Base *task = 0,
00064                         ACE_hthread_t thread_handles[] = 0,
00065                         void *stack[] = 0,
00066                         size_t stack_size[] = 0,
00067                         ACE_thread_t  thread_names[] = 0);
00068 
00069   /// Template hook method that the thread uses...
00070   /**
00071    * Please see the documentation in ace/Task.h for details.
00072    */
00073   virtual int svc (void);
00074   virtual int open (void *);
00075   virtual int close (u_long);
00076 
00077 private:
00078   /// Pointer to protocsol specific code that does the bunch of the
00079   /// job.
00080   TAO_Connection_Handler *ch_;
00081 };
00082 
00083 TAO_END_VERSIONED_NAMESPACE_DECL
00084 
00085 #include /**/ "ace/post.h"
00086 
00087 #endif /*TAO_THREAD_PER_CONNECTION_HANDLER_H*/

Generated on Thu Nov 9 11:54:25 2006 for TAO by doxygen 1.3.6