TAO_EC_Gateway_IIOP_Factory Class Reference

Factory for the EC_Gateway_IIOP settings. More...

#include <EC_Gateway_IIOP_Factory.h>

Inheritance diagram for TAO_EC_Gateway_IIOP_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Gateway_IIOP_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_Gateway_IIOP_Factory (void)
virtual ~TAO_EC_Gateway_IIOP_Factory (void)
TAO_ECG_ConsumerEC_Controlcreate_consumerec_control (TAO_EC_Gateway_IIOP *gateway)
 Create the consumer event channel control.

void destroy_consumerec_control (TAO_ECG_ConsumerEC_Control *x)
 Destroy consumer event channel control.

int use_ttl (void) const
 Accessors to use_ttl flag.

int use_consumer_proxy_map (void) const
 Accessors to use_consumer_proxy_map flag.

virtual int init (int argc, char *argv[])
virtual int fini (void)

Static Public Member Functions

int init_svcs (void)

Protected Attributes

ACE_CString orbid_
 Use this ORB to locate global resources.

int consumer_ec_control_
 The control policy for the consumer event channel.

int consumer_ec_control_period_
 The consumer event channel control periods in usecs.

ACE_Time_Value consumer_ec_control_timeout_
 The control timeout in usecs for the consumer event channel.

int use_ttl_
int use_consumer_proxy_map_

Private Member Functions

void unsupported_option_value (const char *option_name, const char *option_value)

Detailed Description

Factory for the EC_Gateway_IIOP settings.

Default configuration values can be found in ECG_Defaults.h

Definition at line 42 of file EC_Gateway_IIOP_Factory.h.


Constructor & Destructor Documentation

TAO_EC_Gateway_IIOP_Factory::TAO_EC_Gateway_IIOP_Factory void   ) 
 

Definition at line 34 of file EC_Gateway_IIOP_Factory.cpp.

References TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL, TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD, TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT, TAO_ECG_DEFAULT_IIOP_ORB_ID, TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP, and TAO_ECG_DEFAULT_IIOP_USE_TTL.

00035   :  orbid_ (TAO_ECG_DEFAULT_IIOP_ORB_ID),
00036      consumer_ec_control_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL),
00037      consumer_ec_control_period_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_PERIOD),
00038      consumer_ec_control_timeout_ (TAO_ECG_DEFAULT_IIOP_CONSUMEREC_CONTROL_TIMEOUT),
00039      use_ttl_ (TAO_ECG_DEFAULT_IIOP_USE_TTL),
00040      use_consumer_proxy_map_ (TAO_ECG_DEFAULT_IIOP_USE_CONSUMER_PROXY_MAP)
00041 {
00042 }

TAO_EC_Gateway_IIOP_Factory::~TAO_EC_Gateway_IIOP_Factory void   )  [virtual]
 

Definition at line 44 of file EC_Gateway_IIOP_Factory.cpp.

00045 {
00046 }


Member Function Documentation

TAO_ECG_ConsumerEC_Control * TAO_EC_Gateway_IIOP_Factory::create_consumerec_control TAO_EC_Gateway_IIOP gateway  ) 
 

Create the consumer event channel control.

Definition at line 172 of file EC_Gateway_IIOP_Factory.cpp.

References consumer_ec_control_, consumer_ec_control_timeout_, CORBA::ORB_init(), TAO_ECG_ConsumerEC_Control, TAO_ECG_Reactive_ConsumerEC_Control, and TAO_ECG_Reconnect_ConsumerEC_Control.

Referenced by TAO_EC_Gateway_IIOP::init_i().

00173 {
00174   if (this->consumer_ec_control_ == 0)
00175     return new TAO_ECG_ConsumerEC_Control ();
00176   else if (this->consumer_ec_control_ == 1)
00177     {
00178       int argc = 0;
00179       char **argv = 0;
00180       CORBA::ORB_var orb =
00181         CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
00182       ACE_Time_Value rate (0, this->consumer_ec_control_period_);
00183       return new TAO_ECG_Reactive_ConsumerEC_Control (rate, consumer_ec_control_timeout_, gateway, orb.in ());
00184     }
00185   else if (this->consumer_ec_control_ == 2)
00186     {
00187       int argc = 0;
00188       char **argv = 0;
00189       CORBA::ORB_var orb =
00190         CORBA::ORB_init (argc, argv, this->orbid_.c_str ());
00191       ACE_Time_Value rate (0, this->consumer_ec_control_period_);
00192       return new TAO_ECG_Reconnect_ConsumerEC_Control (rate, consumer_ec_control_timeout_, gateway, orb.in ());
00193     }
00194   return 0;
00195 }

void TAO_EC_Gateway_IIOP_Factory::destroy_consumerec_control TAO_ECG_ConsumerEC_Control x  ) 
 

Destroy consumer event channel control.

Definition at line 198 of file EC_Gateway_IIOP_Factory.cpp.

00200 {
00201    delete x;
00202 }

int TAO_EC_Gateway_IIOP_Factory::fini void   )  [virtual]
 

Reimplemented from ACE_Shared_Object.

Definition at line 49 of file EC_Gateway_IIOP_Factory.cpp.

00050 {
00051   return 0;
00052 }

int TAO_EC_Gateway_IIOP_Factory::init int  argc,
char *  argv[]
[virtual]
 

Definition at line 55 of file EC_Gateway_IIOP_Factory.cpp.

References ACE_Arg_Shifter, ACE_DEBUG, ACE_TCHAR, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, ACE_OS::atoi(), consumer_ec_control_, consumer_ec_control_period_, consumer_ec_control_timeout_, LM_WARNING, ACE_OS::strcasecmp(), ACE_OS::strtoul(), unsupported_option_value(), and ACE_Time_Value::usec().

00056 {
00057   int result = 0;
00058 
00059   ACE_Arg_Shifter arg_shifter (argc, argv);
00060 
00061   while (arg_shifter.is_anything_left ())
00062     {
00063       const char *arg = arg_shifter.get_current ();
00064 
00065       if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPConsumerECControl")) == 0)
00066         {
00067           arg_shifter.consume_arg ();
00068 
00069           if (arg_shifter.is_parameter_next ())
00070             {
00071               const ACE_TCHAR* opt = arg_shifter.get_current ();
00072               if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0)
00073                 this->consumer_ec_control_ = 0;
00074               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0)
00075                 this->consumer_ec_control_ = 1;
00076               else if (ACE_OS::strcasecmp (opt, ACE_TEXT("reconnect")) == 0)
00077                 this->consumer_ec_control_ = 2;
00078               else
00079                 this->unsupported_option_value ("-ECGIIOPConsumerECControl", opt);
00080               arg_shifter.consume_arg ();
00081             }
00082         }
00083 
00084       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPConsumerECControlPeriod")) == 0)
00085         {
00086           arg_shifter.consume_arg ();
00087 
00088           if (arg_shifter.is_parameter_next ())
00089             {
00090               const ACE_TCHAR* opt = arg_shifter.get_current ();
00091               this->consumer_ec_control_period_ = ACE_OS::atoi (opt);
00092               arg_shifter.consume_arg ();
00093             }
00094         }
00095 
00096       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPConsumerECControlTimeout")) == 0)
00097         {
00098           arg_shifter.consume_arg ();
00099 
00100           if (arg_shifter.is_parameter_next ())
00101             {
00102               const ACE_TCHAR* opt = arg_shifter.get_current ();
00103               unsigned long timeout = ACE_OS::strtoul(opt, 0, 10);
00104               this->consumer_ec_control_timeout_.usec(timeout);
00105               arg_shifter.consume_arg ();
00106             }
00107         }
00108 
00109       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseORBId")) == 0)
00110         {
00111           arg_shifter.consume_arg ();
00112 
00113           if (arg_shifter.is_parameter_next ())
00114             {
00115               // Save argument for later use
00116               this->orbid_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
00117               arg_shifter.consume_arg ();
00118             }
00119         }
00120 
00121       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseTTL")) == 0)
00122         {
00123           arg_shifter.consume_arg ();
00124 
00125           if (arg_shifter.is_parameter_next ())
00126             {
00127               const ACE_TCHAR* opt = arg_shifter.get_current ();
00128               this->use_ttl_ = ACE_OS::atoi (opt);
00129               arg_shifter.consume_arg ();
00130             }
00131         }
00132 
00133       else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECGIIOPUseConsumerProxyMap")) == 0)
00134         {
00135           arg_shifter.consume_arg ();
00136 
00137           if (arg_shifter.is_parameter_next ())
00138             {
00139               const ACE_TCHAR* opt = arg_shifter.get_current ();
00140               this->use_consumer_proxy_map_ = ACE_OS::atoi (opt);
00141               arg_shifter.consume_arg ();
00142             }
00143         }
00144 
00145       else
00146         {
00147           arg_shifter.ignore_arg ();
00148           ACE_DEBUG ((LM_WARNING,
00149                              "Ignoring <%s> option "
00150                              "during initialization.\n",
00151                       arg));
00152           result = -1;
00153         }
00154     }
00155 
00156     return result;
00157 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_EC_Gateway_IIOP_Factory::init_svcs void   )  [static]
 

Helper function to register the Gateway into the service configurator.

Definition at line 28 of file EC_Gateway_IIOP_Factory.cpp.

References ACE_Service_Config::static_svcs().

00029 {
00030   return ACE_Service_Config::static_svcs ()->
00031     insert (&ace_svc_desc_TAO_EC_Gateway_IIOP_Factory);
00032 }

void TAO_EC_Gateway_IIOP_Factory::unsupported_option_value const char *  option_name,
const char *  option_value
[private]
 

Helper for agrument parsing. Prints out an error message about unsupported option value.

Definition at line 160 of file EC_Gateway_IIOP_Factory.cpp.

References ACE_ERROR, and LM_ERROR.

Referenced by init().

00162 {
00163   ACE_ERROR ((LM_ERROR,
00164               "EC_Gateway_IIOP_Factory -"
00165               "Unsupported <%s> option value: <%s>. "
00166               "Ignoring this option - using defaults instead.\n",
00167               option_name,
00168               option_value));
00169 }

ACE_INLINE int TAO_EC_Gateway_IIOP_Factory::use_consumer_proxy_map void   )  const
 

Accessors to use_consumer_proxy_map flag.

Definition at line 14 of file EC_Gateway_IIOP_Factory.i.

Referenced by TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP().

00015 {
00016   return this->use_consumer_proxy_map_;
00017 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int TAO_EC_Gateway_IIOP_Factory::use_ttl void   )  const
 

Accessors to use_ttl flag.

Definition at line 8 of file EC_Gateway_IIOP_Factory.i.

Referenced by TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP().

00009 {
00010   return this->use_ttl_;
00011 }


Member Data Documentation

int TAO_EC_Gateway_IIOP_Factory::consumer_ec_control_ [protected]
 

The control policy for the consumer event channel.

Definition at line 83 of file EC_Gateway_IIOP_Factory.h.

Referenced by create_consumerec_control(), and init().

int TAO_EC_Gateway_IIOP_Factory::consumer_ec_control_period_ [protected]
 

The consumer event channel control periods in usecs.

Definition at line 86 of file EC_Gateway_IIOP_Factory.h.

Referenced by init().

ACE_Time_Value TAO_EC_Gateway_IIOP_Factory::consumer_ec_control_timeout_ [protected]
 

The control timeout in usecs for the consumer event channel.

Definition at line 89 of file EC_Gateway_IIOP_Factory.h.

Referenced by create_consumerec_control(), and init().

ACE_CString TAO_EC_Gateway_IIOP_Factory::orbid_ [protected]
 

Use this ORB to locate global resources.

Definition at line 80 of file EC_Gateway_IIOP_Factory.h.

int TAO_EC_Gateway_IIOP_Factory::use_consumer_proxy_map_ [protected]
 

The flag for using the consumer proxy map. With 1 the consumer proxy map is used, meaning that for each unique source id we use a different proxy push consumer, if 0, we only use one proxy push consumer for all source ids.

Definition at line 101 of file EC_Gateway_IIOP_Factory.h.

int TAO_EC_Gateway_IIOP_Factory::use_ttl_ [protected]
 

If 1, we use the TTL flags, if 0, we just ignore TTL.

Note:
When this flag is set to 0, make sure that no recursive structures exists in the gateway setup for the same source/type combination, else one event will flow continuosly through all gateways.

Definition at line 95 of file EC_Gateway_IIOP_Factory.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:14:51 2006 for TAO_RTEvent by doxygen 1.3.6