#include <Strategies_T.h>
Inheritance diagram for ACE_Thread_Strategy< SVC_HANDLER >:


| Public Types | |
| typedef ACE_Concurrency_Strategy< SVC_HANDLER > | base_type | 
| Public Member Functions | |
| ACE_Thread_Strategy (int flags=0) | |
| "Do-nothing constructor" | |
| ACE_Thread_Strategy (ACE_Thread_Manager *tm, long thr_flags, int n_threads=1, int flags=0) | |
| Initialize the strategy. | |
| virtual int | open (ACE_Thread_Manager *tm, long thr_flags, int n_threads=1, int flags=0) | 
| Initialize the strategy. | |
| virtual | ~ACE_Thread_Strategy (void) | 
| virtual int | activate_svc_handler (SVC_HANDLER *svc_handler, void *arg=0) | 
| void | dump (void) const | 
| Dump the state of an object. | |
| Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
| Protected Types | |
| typedef ACE_Concurrency_Strategy< SVC_HANDLER > | inherited | 
| Protected Attributes | |
| ACE_Thread_Manager * | thr_mgr_ | 
| Thread manager for this class (must be provided). | |
| long | thr_flags_ | 
| Flags to pass into the <SVC_HANDLER::activate> method. | |
| int | n_threads_ | 
| Number of threads to spawn. | |
This class provides a strategy that manages the creation of threads to handle requests from clients concurrently via a thread-per-connection model. It behaves as a "thread factory", spawning threads "on-demand" to run the service specified by a user-supplied .
Definition at line 359 of file Strategies_T.h.
| 
 | |||||
| 
 Definition at line 364 of file Strategies_T.h. | 
| 
 | |||||
| 
 Definition at line 401 of file Strategies_T.h. | 
| 
 | ||||||||||
| "Do-nothing constructor" 
 Definition at line 114 of file Strategies_T.inl. References ACE_TRACE. 
 00115 : ACE_Concurrency_Strategy<SVC_HANDLER> (flags), 00116 thr_mgr_ (0), 00117 thr_flags_ (0), 00118 n_threads_ (1) 00119 { 00120 ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy"); 00121 } | 
| 
 | ||||||||||||||||||||||||
| Initialize the strategy. 
 Definition at line 97 of file Strategies_T.inl. References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, and ACE_Thread_Strategy< SVC_HANDLER >::open(). 
 00101 {
00102   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy");
00103 
00104   if (this->open (thr_mgr,
00105                   thr_flags,
00106                   n_threads,
00107                   flags) == -1)
00108     ACE_ERROR ((LM_ERROR,
00109                 ACE_LIB_TEXT ("%p\n"),
00110                 ACE_LIB_TEXT ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy")));
00111 }
 | 
| 
 | ||||||||||
| 
 Definition at line 1272 of file Strategies_T.cpp. References ACE_TRACE. 
 01273 {
01274   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::~ACE_Thread_Strategy");
01275 }
 | 
| 
 | ||||||||||||||||
| Activate the with an appropriate concurrency strategy. This method activates the SVC_HANDLER by first calling its method and then calling its method to turn it into an active object. Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >. Definition at line 283 of file Strategies_T.cpp. References ACE_TRACE. 
 00285 {
00286   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::activate_svc_handler");
00287   // Call up to our parent to do the SVC_HANDLER initialization.
00288   if (this->inherited::activate_svc_handler (svc_handler,
00289                                              arg) == -1)
00290     return -1;
00291   else
00292     // Turn the <svc_handler> into an active object (if it isn't
00293     // already one as a result of the first activation...)
00294     return svc_handler->activate (this->thr_flags_,
00295                                   this->n_threads_);
00296 }
 | 
| 
 | ||||||||||
| Dump the state of an object. 
 Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >. Definition at line 1278 of file Strategies_T.cpp. References ACE_TRACE. 
 01279 {
01280 #if defined (ACE_HAS_DUMP)
01281   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::dump");
01282 #endif /* ACE_HAS_DUMP */
01283 }
 | 
| 
 | ||||||||||||||||||||||||
| Initialize the strategy. 
 Definition at line 262 of file Strategies_T.cpp. References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, ACE_Thread_Strategy< SVC_HANDLER >::n_threads_, and ACE_Thread_Strategy< SVC_HANDLER >::thr_flags_. Referenced by ACE_Thread_Strategy< SVC_HANDLER >::ACE_Thread_Strategy(). 
 00266 {
00267   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::open");
00268   this->thr_mgr_ = thr_mgr;
00269   this->n_threads_ = n_threads;
00270   this->thr_flags_ = thr_flags;
00271   this->flags_ = flags;
00272 
00273   // Must have a thread manager!
00274   if (this->thr_mgr_ == 0)
00275     ACE_ERROR_RETURN ((LM_ERROR,
00276                        ACE_LIB_TEXT ("error: must have a non-NULL thread manager\n")),
00277                       -1);
00278   else
00279     return 0;
00280 }
 | 
| 
 | |||||
| Declare the dynamic allocation hooks. 
 Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >. Definition at line 398 of file Strategies_T.h. | 
| 
 | |||||
| Number of threads to spawn. 
 Definition at line 410 of file Strategies_T.h. Referenced by ACE_Thread_Strategy< SVC_HANDLER >::open(). | 
| 
 | |||||
| Flags to pass into the <SVC_HANDLER::activate> method. 
 Definition at line 407 of file Strategies_T.h. Referenced by ACE_Thread_Strategy< SVC_HANDLER >::open(). | 
| 
 | |||||
| Thread manager for this class (must be provided). 
 Definition at line 404 of file Strategies_T.h. | 
 1.3.6
 
1.3.6