Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Strategy_Acceptor Class Template Reference

Abstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER. More...

#include <Acceptor.h>

Inheritance diagram for ACE_Strategy_Acceptor:

Inheritance graph
[legend]
Collaboration diagram for ACE_Strategy_Acceptor:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Strategy_Acceptor (const ACE_TCHAR service_name[]=0, const ACE_TCHAR service_description[]=0, int use_select=1)
 Default constructor. More...

 ACE_Strategy_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, ACE_Reactor *=ACE_Reactor::instance(), ACE_Creation_Strategy< SVC_HANDLER > *=0, ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > *=0, ACE_Concurrency_Strategy< SVC_HANDLER > *=0, ACE_Scheduling_Strategy< SVC_HANDLER > *=0, const ACE_TCHAR service_name[]=0, const ACE_TCHAR service_description[]=0, int use_select=1)
int open (const ACE_PEER_ACCEPTOR_ADDR &, ACE_Reactor *=ACE_Reactor::instance(), ACE_Creation_Strategy< SVC_HANDLER > *=0, ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > *=0, ACE_Concurrency_Strategy< SVC_HANDLER > *=0, ACE_Scheduling_Strategy< SVC_HANDLER > *=0, const ACE_TCHAR *service_name=0, const ACE_TCHAR *service_description=0, int use_select=1)
virtual ~ACE_Strategy_Acceptor (void)
 Close down the Strategy_Acceptor's resources. More...

virtual operator ACE_PEER_ACCEPTOR & () const
 Return the underlying PEER_ACCEPTOR object. More...

virtual ACE_PEER_ACCEPTOR & acceptor (void) const
 Return the underlying PEER_ACCEPTOR object. More...

virtual ACE_HANDLE get_handle (void) const
 Returns the listening acceptor's <ACE_HANDLE>. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Types

typedef ACE_Creation_Strategy<
SVC_HANDLER > 
CREATION_STRATEGY
typedef ACE_Accept_Strategy<
SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > 
ACCEPT_STRATEGY
typedef ACE_Concurrency_Strategy<
SVC_HANDLER > 
CONCURRENCY_STRATEGY
typedef ACE_Scheduling_Strategy<
SVC_HANDLER > 
SCHEDULING_STRATEGY

Protected Methods

virtual int suspend (void)
 This method delegates to the <Scheduling_Strategy>'s <suspend> method. More...

virtual int resume (void)
 This method delegates to the <Scheduling_Strategy>'s <resume> method. More...

virtual int fini (void)
 Calls <handle_close> when dynamically unlinked. More...

virtual int info (ACE_TCHAR **buf, size_t) const
 Default version returns address info in <buf>. More...

virtual int make_svc_handler (SVC_HANDLER *&)
virtual int accept_svc_handler (SVC_HANDLER *svc_handler)
virtual int activate_svc_handler (SVC_HANDLER *svc_handler)
virtual int handle_close (ACE_HANDLE=ACE_INVALID_HANDLE, ACE_Reactor_Mask=ACE_Event_Handler::ALL_EVENTS_MASK)
 Perform termination activities when <this> is removed from the <Reactor>. More...

virtual int handle_signal (int signum, siginfo_t *, ucontext_t *)
 Handle SIGINT. More...


Protected Attributes

CREATION_STRATEGYcreation_strategy_
 Creation strategy for an Acceptor. More...

int delete_creation_strategy_
 1 if <Acceptor> created the creation strategy and thus should delete it, else 0. More...

ACCEPT_STRATEGYaccept_strategy_
 Accept strategy for an <Acceptor>. More...

int delete_accept_strategy_
 1 if <Acceptor> created the accept strategy and thus should delete it, else 0. More...

CONCURRENCY_STRATEGYconcurrency_strategy_
 Concurrency strategy for an <Acceptor>. More...

int delete_concurrency_strategy_
 1 if <Acceptor> created the concurrency strategy and thus should delete it, else 0. More...

SCHEDULING_STRATEGYscheduling_strategy_
 Scheduling strategy for an <Acceptor>. More...

int delete_scheduling_strategy_
 1 if <Acceptor> created the scheduling strategy and thus should delete it, else 0. More...

ACE_TCHARservice_name_
 Name of the service. More...

ACE_TCHARservice_description_
 Description of the service. More...

u_short service_port_
 Port number for the server. More...

ACE_PEER_ACCEPTOR_ADDR service_addr_
 Address that the <Strategy_Acceptor> uses to listen for connections. More...


Detailed Description

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
class ACE_Strategy_Acceptor< SVC_HANDLER, >

Abstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER.

Implements a flexible and extensible set of strategies for passively establishing connections with clients. There are three main strategies: (1) creating a SVC_HANDLER, (2) passively accepting a new connection from a client into the SVC_HANDLER, and (3) activating the SVC_HANDLER with a particular concurrency mechanism.


Member Typedef Documentation

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
typedef ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACE_Strategy_Acceptor::ACCEPT_STRATEGY [protected]
 

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor::CONCURRENCY_STRATEGY [protected]
 

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor::CREATION_STRATEGY [protected]
 

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
typedef ACE_Scheduling_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor::SCHEDULING_STRATEGY [protected]
 


Constructor & Destructor Documentation

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor const ACE_TCHAR    service_name[] = 0,
const ACE_TCHAR    service_description[] = 0,
int    use_select = 1
 

Default constructor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor const ACE_PEER_ACCEPTOR_ADDR &    addr,
ACE_Reactor   reactor = ACE_Reactor::instance (),
ACE_Creation_Strategy< SVC_HANDLER > *    cre_s = 0,
ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > *    acc_s = 0,
ACE_Concurrency_Strategy< SVC_HANDLER > *    con_s = 0,
ACE_Scheduling_Strategy< SVC_HANDLER > *    sch_s = 0,
const ACE_TCHAR    service_name[] = 0,
const ACE_TCHAR    service_description[] = 0,
int    use_select = 1
 

Initialize the appropriate strategies for creation, passive connection acceptance, and concurrency, and then register <this> with the Reactor and listen for connection requests at the designated <local_addr>.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_Strategy_Acceptor< SVC_HANDLER, >::~ACE_Strategy_Acceptor void    [virtual]
 

Close down the Strategy_Acceptor's resources.


Member Function Documentation

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::accept_svc_handler SVC_HANDLER *    svc_handler [protected, virtual]
 

Bridge method for accepting the new connection into the <SVC_HANDLER>. The default behavior delegates to the <PEER_ACCEPTOR::accept> in the <Acceptor_Strategy>.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_PEER_ACCEPTOR & ACE_Strategy_Acceptor< SVC_HANDLER, >::acceptor void    const [virtual]
 

Return the underlying PEER_ACCEPTOR object.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::activate_svc_handler SVC_HANDLER *    svc_handler [protected, virtual]
 

Bridge method for activating a <SVC_HANDLER> with the appropriate concurrency strategy. The default behavior of this method is to activate the <SVC_HANDLER> by calling its <open> method (which allows the <SVC_HANDLER> to define its own concurrency strategy). However, subclasses can override this strategy to do more sophisticated concurrency activations (such as creating the <SVC_HANDLER> as an "active object" via multi-threading or multi-processing).

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
void ACE_Strategy_Acceptor< SVC_HANDLER, >::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::fini void    [protected, virtual]
 

Calls <handle_close> when dynamically unlinked.

Reimplemented from ACE_Shared_Object.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_HANDLE ACE_Strategy_Acceptor< SVC_HANDLER, >::get_handle void    const [virtual]
 

Returns the listening acceptor's <ACE_HANDLE>.

Reimplemented from ACE_Event_Handler.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::handle_close ACE_HANDLE    handle = ACE_INVALID_HANDLE,
ACE_Reactor_Mask    close_mask = ACE_Event_Handler::ALL_EVENTS_MASK
[protected, virtual]
 

Perform termination activities when <this> is removed from the <Reactor>.

Reimplemented from ACE_Event_Handler.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::handle_signal int    signum,
siginfo_t   siginfo,
ucontext_t   ucontext
[protected, virtual]
 

Handle SIGINT.

Reimplemented from ACE_Event_Handler.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::info ACE_TCHAR **    strp,
size_t    length
const [protected, virtual]
 

Default version returns address info in <buf>.

Reimplemented from ACE_Shared_Object.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::make_svc_handler SVC_HANDLER *&    sh [protected, virtual]
 

Bridge method for creating a <SVC_HANDLER>. The strategy for creating a <SVC_HANDLER> are configured into the Acceptor via it's <creation_strategy_>. The default is to create a new <SVC_HANDLER> if <sh> == 0, else <sh> is unchanged. However, subclasses can override this policy to perform <SVC_HANDLER> creation in any way that they like (such as creating subclass instances of <SVC_HANDLER>, using a singleton, dynamically linking the handler, etc.). Returns -1 on failure, else 0.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::open const ACE_PEER_ACCEPTOR_ADDR &    local_addr,
ACE_Reactor   reactor = ACE_Reactor::instance (),
ACE_Creation_Strategy< SVC_HANDLER > *    cre_s = 0,
ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > *    acc_s = 0,
ACE_Concurrency_Strategy< SVC_HANDLER > *    con_s = 0,
ACE_Scheduling_Strategy< SVC_HANDLER > *    sch_s = 0,
const ACE_TCHAR   service_name = 0,
const ACE_TCHAR   service_description = 0,
int    use_select = 1
 

Initialize the appropriate strategies for creation, passive connection acceptance, and concurrency, and then register <this> with the Reactor and listen for connection requests at the designated <local_addr>.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_Strategy_Acceptor< SVC_HANDLER, >::operator ACE_PEER_ACCEPTOR &   const [virtual]
 

Return the underlying PEER_ACCEPTOR object.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::resume void    [protected, virtual]
 

This method delegates to the <Scheduling_Strategy>'s <resume> method.

Reimplemented from ACE_Service_Object.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor< SVC_HANDLER, >::suspend void    [protected, virtual]
 

This method delegates to the <Scheduling_Strategy>'s <suspend> method.

Reimplemented from ACE_Service_Object.


Member Data Documentation

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACCEPT_STRATEGY* ACE_Strategy_Acceptor::accept_strategy_ [protected]
 

Accept strategy for an <Acceptor>.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_Strategy_Acceptor::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
CONCURRENCY_STRATEGY* ACE_Strategy_Acceptor::concurrency_strategy_ [protected]
 

Concurrency strategy for an <Acceptor>.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
CREATION_STRATEGY* ACE_Strategy_Acceptor::creation_strategy_ [protected]
 

Creation strategy for an Acceptor.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor::delete_accept_strategy_ [protected]
 

1 if <Acceptor> created the accept strategy and thus should delete it, else 0.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor::delete_concurrency_strategy_ [protected]
 

1 if <Acceptor> created the concurrency strategy and thus should delete it, else 0.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor::delete_creation_strategy_ [protected]
 

1 if <Acceptor> created the creation strategy and thus should delete it, else 0.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
int ACE_Strategy_Acceptor::delete_scheduling_strategy_ [protected]
 

1 if <Acceptor> created the scheduling strategy and thus should delete it, else 0.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
SCHEDULING_STRATEGY* ACE_Strategy_Acceptor::scheduling_strategy_ [protected]
 

Scheduling strategy for an <Acceptor>.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_PEER_ACCEPTOR_ADDR ACE_Strategy_Acceptor::service_addr_ [protected]
 

Address that the <Strategy_Acceptor> uses to listen for connections.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_TCHAR* ACE_Strategy_Acceptor::service_description_ [protected]
 

Description of the service.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
ACE_TCHAR* ACE_Strategy_Acceptor::service_name_ [protected]
 

Name of the service.

template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1 >
u_short ACE_Strategy_Acceptor::service_port_ [protected]
 

Port number for the server.


The documentation for this class was generated from the following files:
Generated on Sun Feb 17 17:43:26 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001