Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ACE_Process_Strategy< SVC_HANDLER > Class Template Reference

Defines the interface for specifying a concurrency strategy for a <svc_handler> based on multiprocessing. More...

#include <Strategies_T.h>

Inheritance diagram for ACE_Process_Strategy< SVC_HANDLER >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Process_Strategy< SVC_HANDLER >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Concurrency_Strategy<
SVC_HANDLER > 
base_type

Public Member Functions

 ACE_Process_Strategy (size_t n_processes=1, ACE_Event_Handler *acceptor=0, ACE_Reactor *=0, int avoid_zombies=0)
virtual int open (size_t n_processes=1, ACE_Event_Handler *acceptor=0, ACE_Reactor *=0, int avoid_zombies=0)
virtual ~ACE_Process_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

size_t n_processes_
 Number of processes to spawn.
ACE_Event_Handleracceptor_
ACE_Reactorreactor_

Detailed Description

template<class SVC_HANDLER>
class ACE_Process_Strategy< SVC_HANDLER >

Defines the interface for specifying a concurrency strategy for a <svc_handler> based on multiprocessing.

This class provides a strategy that manages the creation of processes to handle requests from clients concurrently using a process-per-connection model. It behaves as a "process factory", using <ACE::fork> to fork threads "on-demand" to run the service specified by a user-supplied <svc_handler> in a separate process.


Member Typedef Documentation

template<class SVC_HANDLER>
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Process_Strategy< SVC_HANDLER >::base_type
 

template<class SVC_HANDLER>
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Process_Strategy< SVC_HANDLER >::inherited [protected]
 


Constructor & Destructor Documentation

template<class SVC_HANDLER>
ACE_INLINE ACE_Process_Strategy< SVC_HANDLER >::ACE_Process_Strategy size_t  n_processes = 1,
ACE_Event_Handler acceptor = 0,
ACE_Reactor = 0,
int  avoid_zombies = 0
 

Initialize the strategy. If <avoid_zombies> is non-0 then set a flag to <ACE::fork> to avoid zombies.

template<class SVC_HANDLER>
ACE_INLINE ACE_Process_Strategy< SVC_HANDLER >::~ACE_Process_Strategy void   )  [virtual]
 


Member Function Documentation

template<class SVC_HANDLER>
int ACE_Process_Strategy< SVC_HANDLER >::activate_svc_handler SVC_HANDLER *  svc_handler,
void *  arg = 0
[virtual]
 

Activate the <svc_handler> with an appropriate concurrency strategy. This method activates the SVC_HANDLER by first forking and then calling the <open> method of the SVC_HANDLER in the child.

Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >.

template<class SVC_HANDLER>
void ACE_Process_Strategy< SVC_HANDLER >::dump void   )  const
 

Dump the state of an object.

Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >.

template<class SVC_HANDLER>
int ACE_Process_Strategy< SVC_HANDLER >::open size_t  n_processes = 1,
ACE_Event_Handler acceptor = 0,
ACE_Reactor = 0,
int  avoid_zombies = 0
[virtual]
 

Initialize the strategy. If <avoid_zombies> is non-0 then set a flag to <ACE::fork> to avoid zombies.


Member Data Documentation

template<class SVC_HANDLER>
ACE_Event_Handler* ACE_Process_Strategy< SVC_HANDLER >::acceptor_ [protected]
 

This is the <acceptor> in the parent is listening on. We need to make sure that we remove it from the Reactor and close it down in the child.

template<class SVC_HANDLER>
ACE_Process_Strategy< SVC_HANDLER >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Concurrency_Strategy< SVC_HANDLER >.

template<class SVC_HANDLER>
size_t ACE_Process_Strategy< SVC_HANDLER >::n_processes_ [protected]
 

Number of processes to spawn.

template<class SVC_HANDLER>
ACE_Reactor* ACE_Process_Strategy< SVC_HANDLER >::reactor_ [protected]
 

This is the <reactor> the child is using in conjunction with the <acceptor>. We need to remove the <acceptor> from this <reactor> in the child.


The documentation for this class was generated from the following files:
Generated on Sun May 15 12:51:21 2005 for ACE by  doxygen 1.3.9.1