TAO_Thread_Per_Connection_Handler Class Reference

Definition for the thread-per-connection strategy. More...

#include <Thread_Per_Connection_Handler.h>

Inheritance diagram for TAO_Thread_Per_Connection_Handler:

Inheritance graph
[legend]
Collaboration diagram for TAO_Thread_Per_Connection_Handler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Thread_Per_Connection_Handler (TAO_Connection_Handler *ch, TAO_ORB_Core *oc)
 ~TAO_Thread_Per_Connection_Handler (void)
virtual int activate (long flags=THR_NEW_LWP, int n_threads=1, int force_active=0, long priority=ACE_DEFAULT_THREAD_PRIORITY, int grp_id=-1, ACE_Task_Base *task=0, ACE_hthread_t thread_handles[]=0, void *stack[]=0, size_t stack_size[]=0, ACE_thread_t thread_names[]=0)
 = Active object activation method.

virtual int svc (void)
 Template hook method that the thread uses...

virtual int open (void *)
virtual int close (u_long)

Private Attributes

TAO_Connection_Handlerch_

Detailed Description

Definition for the thread-per-connection strategy.

This object acts as an active object, encapsulating the protocol specific handler which the active thread uses to process incoming messages.

Definition at line 46 of file Thread_Per_Connection_Handler.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Thread_Per_Connection_Handler::TAO_Thread_Per_Connection_Handler TAO_Connection_Handler ch,
TAO_ORB_Core oc
 

Definition at line 15 of file Thread_Per_Connection_Handler.cpp.

References TAO_Transport::add_reference(), ch_, TAO_TPC_BASE, and TAO_Connection_Handler::transport().

00018   : TAO_TPC_BASE (oc->thr_mgr ())
00019   , ch_ (ch)
00020 {
00021   this->ch_->transport ()->add_reference ();
00022 }

TAO_Thread_Per_Connection_Handler::~TAO_Thread_Per_Connection_Handler void   ) 
 

Definition at line 24 of file Thread_Per_Connection_Handler.cpp.

References ch_, TAO_Connection_Handler::close_connection(), TAO_Transport::remove_reference(), and TAO_Connection_Handler::transport().

00025 {
00026   this->ch_->close_connection ();
00027   this->ch_->transport ()->remove_reference ();
00028 }


Member Function Documentation

int TAO_Thread_Per_Connection_Handler::activate long  flags = THR_NEW_LWP,
int  n_threads = 1,
int  force_active = 0,
long  priority = ACE_DEFAULT_THREAD_PRIORITY,
int  grp_id = -1,
ACE_Task_Base task = 0,
ACE_hthread_t  thread_handles[] = 0,
void *  stack[] = 0,
size_t  stack_size[] = 0,
ACE_thread_t  thread_names[] = 0
[virtual]
 

= Active object activation method.

Todo:
This probably needs to go after x.4.1

Reimplemented from ACE_Task_Base.

Definition at line 31 of file Thread_Per_Connection_Handler.cpp.

References ACE_DEBUG, ACE_TEXT, ACE_Task_Base::activate(), LM_DEBUG, and TAO_debug_level.

Referenced by TAO_Concurrency_Strategy< SVC_HANDLER >::activate_svc_handler().

00041 {
00042   if (TAO_debug_level)
00043     {
00044       ACE_DEBUG  ((LM_DEBUG,
00045                    ACE_TEXT ("TAO (%P|%t) - Thread_Per_Connection_Handler::")
00046                    ACE_TEXT ("activate %d threads, flags = %d\n"),
00047                    n_threads,
00048                    flags));
00049     }
00050 
00051   return TAO_TPC_BASE::activate (flags,
00052                                  n_threads,
00053                                  force_active,
00054                                  priority,
00055                                  grp_id,
00056                                  task,
00057                                  thread_handles,
00058                                  stack,
00059                                  stack_size,
00060                                  thread_names);
00061 }

int TAO_Thread_Per_Connection_Handler::close u_long   )  [virtual]
 

Reimplemented from ACE_Task_Base.

Definition at line 80 of file Thread_Per_Connection_Handler.cpp.

00081 {
00082   delete this;
00083 
00084   return 0;
00085 }

int TAO_Thread_Per_Connection_Handler::open void *   )  [virtual]
 

Reimplemented from ACE_Task_Base.

Definition at line 74 of file Thread_Per_Connection_Handler.cpp.

References ch_, TAO_Connection_Handler::open_handler(), and v.

00075 {
00076   return this->ch_->open_handler (v);
00077 }

int TAO_Thread_Per_Connection_Handler::svc void   )  [virtual]
 

Template hook method that the thread uses...

Please see the documentation in ace/Task.h for details.

Reimplemented from ACE_Task_Base.

Definition at line 64 of file Thread_Per_Connection_Handler.cpp.

References ACE_NONBLOCK, ch_, ACE::clr_flags(), and TAO_Connection_Handler::svc_i().

00065 {
00066   ACE::clr_flags (this->ch_->transport ()->event_handler_i ()->get_handle (),
00067                   ACE_NONBLOCK);
00068 
00069   // Call the implementation here
00070   return this->ch_->svc_i ();
00071 }


Member Data Documentation

TAO_Connection_Handler* TAO_Thread_Per_Connection_Handler::ch_ [private]
 

Pointer to protocsol specific code that does the bunch of the job.

Definition at line 80 of file Thread_Per_Connection_Handler.h.

Referenced by open(), svc(), TAO_Thread_Per_Connection_Handler(), and ~TAO_Thread_Per_Connection_Handler().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:24:01 2006 for TAO by doxygen 1.3.6