00001 //x -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Thread_Per_Connection_Handler.h 00006 * 00007 * $Id: Thread_Per_Connection_Handler.h 80114 2007-11-27 15:56:54Z johnnyw $ 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.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 /** 00035 * @class TAO_Thread_Per_Connection_Handler 00036 * 00037 * @brief Definition for the thread-per-connection strategy. 00038 * 00039 * This object acts as an active object, encapsulating the protocol 00040 * specific handler which the active thread uses to process incoming 00041 * messages. 00042 * 00043 */ 00044 class TAO_Export TAO_Thread_Per_Connection_Handler : public ACE_Task_Base 00045 { 00046 public: 00047 TAO_Thread_Per_Connection_Handler (TAO_Connection_Handler *ch, 00048 TAO_ORB_Core *oc); 00049 00050 ~TAO_Thread_Per_Connection_Handler (void); 00051 00052 /// Template hook method that the thread uses... 00053 /** 00054 * Please see the documentation in ace/Task.h for details. 00055 */ 00056 virtual int svc (void); 00057 virtual int open (void *); 00058 virtual int close (u_long); 00059 00060 private: 00061 /// Pointer to protocsol specific code that does the bunch of the 00062 /// job. 00063 TAO_Connection_Handler *ch_; 00064 }; 00065 00066 TAO_END_VERSIONED_NAMESPACE_DECL 00067 00068 #include /**/ "ace/post.h" 00069 00070 #endif /*TAO_THREAD_PER_CONNECTION_HANDLER_H*/