TAO_OC_Endpoint_Selector_Factory Class Reference

Factory for initializing and obtaining appropriate . More...

#include <OC_Endpoint_Selector_Factory.h>

Inheritance diagram for TAO_OC_Endpoint_Selector_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_OC_Endpoint_Selector_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_OC_Endpoint_Selector_Factory (void)
 Constructor.

virtual ~TAO_OC_Endpoint_Selector_Factory (void)
 Destructor.

virtual int init (int argc, ACE_TCHAR *argv[])
virtual TAO_Invocation_Endpoint_Selectorget_selector ()

Protected Attributes

TAO_Optimized_Connection_Endpoint_Selectoroc_endpoint_selector_

Detailed Description

Factory for initializing and obtaining appropriate .

Used by Invocation classes to intialize its endpoint selection strategy and state based on the effective policies. Endpoint selection strategies are stateless objects - all the state they need is contained by Invocation in . Thus, rather than allocating an endpoint selection strategy object for each Invocation, the factory simply returns the appropriate one from the set preallocated in the ORB_Core. One endpoint selection strategy object can be used by many invocations concurrently.

Definition at line 54 of file OC_Endpoint_Selector_Factory.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_OC_Endpoint_Selector_Factory::TAO_OC_Endpoint_Selector_Factory void   ) 
 

Constructor.

Definition at line 15 of file OC_Endpoint_Selector_Factory.cpp.

00016   : oc_endpoint_selector_(0)
00017 {
00018 }

TAO_OC_Endpoint_Selector_Factory::~TAO_OC_Endpoint_Selector_Factory void   )  [virtual]
 

Destructor.

Definition at line 20 of file OC_Endpoint_Selector_Factory.cpp.

References oc_endpoint_selector_.

00021 {
00022   delete this->oc_endpoint_selector_;
00023 }


Member Function Documentation

TAO_Invocation_Endpoint_Selector * TAO_OC_Endpoint_Selector_Factory::get_selector  )  [virtual]
 

Get an Invocation's endpoint selection strategy and initialize the endpoint selection state instance.

Implements TAO_Endpoint_Selector_Factory.

Definition at line 51 of file OC_Endpoint_Selector_Factory.cpp.

References oc_endpoint_selector_.

00052 {
00053   // Trivial endpoint selector.  Just return the default selector.
00054   return this->oc_endpoint_selector_;
00055 }

int TAO_OC_Endpoint_Selector_Factory::init int  argc,
ACE_TCHAR argv[]
[virtual]
 

Reimplemented from ACE_Shared_Object.

Definition at line 26 of file OC_Endpoint_Selector_Factory.cpp.

References ACE_NEW_RETURN, ACE_TEXT, ACE_Time_Value::msec(), TAO_ORB_Core::set_endpoint_selector_factory(), ACE_OS::strcasecmp(), and ACE_OS::strtol().

00027 {
00028   ACE_Time_Value timeout(0,0);
00029 
00030   TAO_ORB_Core::set_endpoint_selector_factory ("OC_Endpoint_Selector_Factory");
00031   for (int count = 0; count < argc; count++)
00032     {
00033       if ((ACE_OS::strcasecmp (argv[count],
00034                                ACE_TEXT ("-connect_timeout")) == 0) &&
00035           count < argc-1)
00036         {
00037           count++;
00038           long ms = ACE_OS::strtol(argv[count],0,10);
00039           timeout.msec (ms);
00040         }
00041     }
00042 
00043   ACE_NEW_RETURN (this->oc_endpoint_selector_,
00044                   TAO_Optimized_Connection_Endpoint_Selector(timeout),
00045                   -1);
00046   return 0;
00047 }


Member Data Documentation

TAO_Optimized_Connection_Endpoint_Selector* TAO_OC_Endpoint_Selector_Factory::oc_endpoint_selector_ [protected]
 

The possible endpoint selector strategies that can be returned by this factory

Definition at line 76 of file OC_Endpoint_Selector_Factory.h.

Referenced by get_selector(), and ~TAO_OC_Endpoint_Selector_Factory().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:41:19 2006 for TAO_Strategies by doxygen 1.3.6