TAO_RTEvent  2.0.8
Classes | Public Member Functions | Static Public Member Functions
TAO_ECG_Mcast_Gateway Class Reference

Implement the builder for setting up Event Channel multicast gateway. NOT THREAD-SAFE. More...

#include <ECG_Mcast_Gateway.h>

Inheritance diagram for TAO_ECG_Mcast_Gateway:
Inheritance graph
[legend]
Collaboration diagram for TAO_ECG_Mcast_Gateway:
Collaboration graph
[legend]

List of all members.

Classes

struct  Attributes
 Helper class to initialize a TAO_ECG_Mcast_Gateway. More...

Public Types

enum  Service_Type { ECG_MCAST_SENDER, ECG_MCAST_RECEIVER, ECG_MCAST_TWO_WAY }
 Values for some configuration parameters to init (). More...
enum  Address_Server_Type { ECG_ADDRESS_SERVER_BASIC, ECG_ADDRESS_SERVER_SOURCE, ECG_ADDRESS_SERVER_TYPE }
 Values for some configuration parameters to init (). More...
enum  Handler_Type { ECG_HANDLER_BASIC, ECG_HANDLER_COMPLEX, ECG_HANDLER_UDP }
 Values for some configuration parameters to init (). More...

Public Member Functions

 TAO_ECG_Mcast_Gateway (void)
 Constructor.
int init (const char *address_server_arg, const Attributes &attributes=Attributes())
int init (const RtecEventChannelAdmin::ConsumerQOS &consumer_qos, const char *address_server_arg, const Attributes &attributes=Attributes())
void run (CORBA::ORB_ptr orb, RtecEventChannelAdmin::EventChannel_ptr ec)
virtual int init (int argc, ACE_TCHAR *argv[])
 The Service_Object entry points.
virtual int fini (void)
 The Service_Object entry points.

Static Public Member Functions

static int init_svcs (void)

Private Member Functions

void verify_args (CORBA::ORB_ptr orb, RtecEventChannelAdmin::EventChannel_ptr ec)
 Helpers.
int validate_configuration (void)
 Verifies configuration values specified through init() make sense.
PortableServer::ServantBaseinit_address_server (void)
 Allocate and initialize appropriate objects.
PortableServer::Servant_var
< TAO_ECG_UDP_Sender
init_sender (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr)
 Allocate and initialize appropriate objects.
PortableServer::Servant_var
< TAO_ECG_UDP_Receiver
init_receiver (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr)
 Allocate and initialize appropriate objects.
TAO_ECG_Refcounted_Endpoint init_endpoint (void)
 Allocate and initialize appropriate objects.
TAO_ECG_Refcounted_Handler init_handler (TAO_ECG_Dgram_Handler *recv, RtecEventChannelAdmin::EventChannel_ptr ec, ACE_Reactor *reactor)
 Allocate and initialize appropriate objects.

Private Attributes

Service_Type service_type_
 Flags controlling configuration.
Handler_Type handler_type_
 Flags controlling configuration.
Address_Server_Type address_server_type_
 Flags controlling configuration.
ACE_CString address_server_arg_
 Flags controlling configuration.
u_char ttl_value_
 Flags controlling configuration.
ACE_TString nic_
 Flags controlling configuration.
int ip_multicast_loop_
 Flags controlling configuration.
int non_blocking_
 Flags controlling configuration.
RtecEventChannelAdmin::ConsumerQOS consumer_qos_
 Flags controlling configuration.

Detailed Description

Implement the builder for setting up Event Channel multicast gateway. NOT THREAD-SAFE.

This class simplifies creation of federated Event Channels by presenting a simple unified interface for creating and configuring all components needed to federate an Event Channel. Configuration options are described below.

NOTE: This class does not own any of the components it creates and its lifetime is independent of theirs. This class acts purely as a wrapper facade for creating and wiring appropriate components together.

Todo:
This class is an ACE_Service_Object, but the only reason for it is the need for easy configuration using files. Since ACE_Service_Object provides much more than that, we should look into replacing it with a more lightweight utility that would serve our needs.

CONFIGURATION OPTIONS There are two ways to use this class: 1) Use service config file to specify configuration options (which are described below), and use service configurator to obtain a an instance of configured TAO_ECG_Mcast_Gateway in your program. (See TAO/orbsvcs/tests/Event/Mcast/Common and TAO/orbsvcs/tests/Event/Mcast/Simple for an example.)

Service config file options:

-ECGService <service> Valid values: sender, receiver, two_way Specifies whether this gateway should act as a multicast sender of the events or multicast receiver, or both.

-ECGAddressServer <server_type> Valid values: basic, source, type Specifies what implementation of the address server should be used by the gateway. basic - the same multicast address is returned for all event headers. source - multicast addresses are returned based on the event source, according to the mapping provided at initialization. type - multicast addresses are returned based on the event type, according to the mapping provided at initialization.

-ECGAddressServerArg <arg> Valid value: arg is a string, whose format requirements are specific to the implementation of address server used. Arg is not interpreted by the gateway, but simply passed to the address server specified by -ECGAddressServer during initialization. THIS OPTION MUST ALWAYS BE SPECIFIED BY THE USER (there is no default value for it)

-ECGHandler <handler_type> Valid values: basic, complex, udp Specifies what implementation of event handler should be used if gateway is acting as events receiver. basic - a simple event handler listening on a single mcast address. complex - event handler listening on multiple mcast addresses based on events of interest to consumers. udp - similar to basic handler, except listens on udp address as opposed to a multicast group.

-ECGTTL <ttl> Valid values: a number > 0 IP_Multicast time to live value that should be set on a sending socket. This option matters only if the gateway is acting as a sender of mcast messages.

-ECGNIC <nic> Valid values: name of the network interface This interface is used for sending and/or receiving multicast messages.

-ECGNonBlocking Boolean flag to configure if the socket is in blocking or non-blocking code. The default is non-blocking. NOTE: Certain device drivers block the process if the physical link fails.

2) Create an instance of TAO_ECG_Mcast_Gateway in your code, on the stack or dynamically, and use init () method to configure it. No configuration files involved. See service config options above for the description of configurable options, and init() method below for how to specify them.

Default configuration values (for either use case) can be found in ECG_Defaults.h


Member Enumeration Documentation

Values for some configuration parameters to init ().

Enumerator:
ECG_ADDRESS_SERVER_BASIC 
ECG_ADDRESS_SERVER_SOURCE 
ECG_ADDRESS_SERVER_TYPE 

Values for some configuration parameters to init ().

Enumerator:
ECG_HANDLER_BASIC 
ECG_HANDLER_COMPLEX 
ECG_HANDLER_UDP 

Values for some configuration parameters to init ().

Enumerator:
ECG_MCAST_SENDER 
ECG_MCAST_RECEIVER 
ECG_MCAST_TWO_WAY 

Constructor & Destructor Documentation

TAO_ECG_Mcast_Gateway::TAO_ECG_Mcast_Gateway ( void  )

Constructor.


Member Function Documentation

int TAO_ECG_Mcast_Gateway::fini ( void  ) [virtual]

The Service_Object entry points.

Reimplemented from ACE_Shared_Object.

int TAO_ECG_Mcast_Gateway::init ( int  argc,
ACE_TCHAR argv[] 
) [virtual]

The Service_Object entry points.

Reimplemented from ACE_Shared_Object.

int TAO_ECG_Mcast_Gateway::init ( const char *  address_server_arg,
const Attributes attributes = Attributes() 
)

Configure TAO_ECG_Mcast_Gateway programatically. This method should be used when NOT using service configurator to obtain/configure TAO_ECG_Mcast_Gateway. See class documentation above for more info.

int TAO_ECG_Mcast_Gateway::init ( const RtecEventChannelAdmin::ConsumerQOS consumer_qos,
const char *  address_server_arg,
const Attributes attributes = Attributes() 
)

Same as the method above, but also gives the client an opportunity to specify consumer qos, i.e., which EC traffic should get multicasted.

PortableServer::ServantBase * TAO_ECG_Mcast_Gateway::init_address_server ( void  ) [private]

Allocate and initialize appropriate objects.

TAO_ECG_Refcounted_Endpoint TAO_ECG_Mcast_Gateway::init_endpoint ( void  ) [private]

Allocate and initialize appropriate objects.

TAO_ECG_Refcounted_Handler TAO_ECG_Mcast_Gateway::init_handler ( TAO_ECG_Dgram_Handler recv,
RtecEventChannelAdmin::EventChannel_ptr  ec,
ACE_Reactor reactor 
) [private]

Allocate and initialize appropriate objects.

PortableServer::Servant_var< TAO_ECG_UDP_Receiver > TAO_ECG_Mcast_Gateway::init_receiver ( RtecEventChannelAdmin::EventChannel_ptr  ec,
RtecUDPAdmin::AddrServer_ptr  address_server,
TAO_ECG_Refcounted_Endpoint  endpoint_rptr 
) [private]

Allocate and initialize appropriate objects.

PortableServer::Servant_var< TAO_ECG_UDP_Sender > TAO_ECG_Mcast_Gateway::init_sender ( RtecEventChannelAdmin::EventChannel_ptr  ec,
RtecUDPAdmin::AddrServer_ptr  address_server,
TAO_ECG_Refcounted_Endpoint  endpoint_rptr 
) [private]

Allocate and initialize appropriate objects.

int TAO_ECG_Mcast_Gateway::init_svcs ( void  ) [static]

Helper function to register the Gateway into the service configurator.

void TAO_ECG_Mcast_Gateway::run ( CORBA::ORB_ptr  orb,
RtecEventChannelAdmin::EventChannel_ptr  ec 
)

The main method - create, configure and run federation components according to the specified configuration.

int TAO_ECG_Mcast_Gateway::validate_configuration ( void  ) [private]

Verifies configuration values specified through init() make sense.

void TAO_ECG_Mcast_Gateway::verify_args ( CORBA::ORB_ptr  orb,
RtecEventChannelAdmin::EventChannel_ptr  ec 
) [private]

Helpers.

Check that arguments to run() are not nil.


Member Data Documentation

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.

Flags controlling configuration.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines