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

# 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:

[legend]
Collaboration diagram for TAO_ECG_Mcast_Gateway:

[legend]
List of all members.

## Public Types
enum | Service_Type { ECG_MCAST_SENDER, ECG_MCAST_RECEIVER, ECG_MCAST_TWO_WAY }
enum | Address_Server_Type { ECG_ADDRESS_SERVER_BASIC, ECG_ADDRESS_SERVER_SOURCE, ECG_ADDRESS_SERVER_TYPE }
enum | Handler_Type { ECG_HANDLER_BASIC, ECG_HANDLER_COMPLEX, ECG_HANDLER_UDP }
## Public Methods
| 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 ACE_ENV_ARG_DECL)
virtual int | init (int argc, char *argv[])
virtual int | fini (void)
## Static Public Methods
int | init_svcs (void)
## Private Methods
void | verify_args (CORBA::ORB_ptr orb, RtecEventChannelAdmin::EventChannel_ptr ec ACE_ENV_ARG_DECL)
| Check that arguments to run() are not nil.
int | validate_configuration (void)
| Verifies configuration values specified through init() make sense.
PortableServer::ServantBase * | init_address_server (void)
TAO_EC_Servant_Var< TAO_ECG_UDP_Sender > | init_sender (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr ACE_ENV_ARG_DECL)
TAO_EC_Servant_Var< TAO_ECG_UDP_Receiver > | init_receiver (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr ACE_ENV_ARG_DECL)
TAO_ECG_Refcounted_Endpoint | init_endpoint (void)
TAO_ECG_Refcounted_Handler | init_handler (TAO_ECG_Dgram_Handler *recv, RtecEventChannelAdmin::EventChannel_ptr ec, ACE_Reactor *reactor ACE_ENV_ARG_DECL)
## Private Attributes
Service_Type | service_type_
Handler_Type | handler_type_
Address_Server_Type | address_server_type_
ACE_CString | address_server_arg_
u_char | ttl_value_
ACE_CString | nic_
int | ip_multicast_loop_
int | non_blocking_
RtecEventChannelAdmin::ConsumerQOS | consumer_qos_

## 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

enum TAO_ECG_Mcast_Gateway::Address_Server_Type

  | Enumeration values:
  ECG_ADDRESS_SERVER_BASIC |
  ECG_ADDRESS_SERVER_SOURCE |
  ECG_ADDRESS_SERVER_TYPE |

enum TAO_ECG_Mcast_Gateway::Handler_Type

  | Enumeration values:
  ECG_HANDLER_BASIC |
  ECG_HANDLER_COMPLEX |
  ECG_HANDLER_UDP |

enum TAO_ECG_Mcast_Gateway::Service_Type

  | Enumeration values:
  ECG_MCAST_SENDER |
  ECG_MCAST_RECEIVER |
  ECG_MCAST_TWO_WAY |

## Constructor & Destructor Documentation

ACE_INLINE TAO_ECG_Mcast_Gateway::TAO_ECG_Mcast_Gateway | ( | void |  | ) |

| Constructor.

## Member Function Documentation

int TAO_ECG_Mcast_Gateway::fini | ( | void |  | ) | `[virtual]`

| Reimplemented from ACE_Shared_Object.

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.

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 | ( | int | argc,
|  | char * | argv[]
| ) | `[virtual]`

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

TAO_ECG_Refcounted_Endpoint TAO_ECG_Mcast_Gateway::init_endpoint | ( | void |  | ) | `[private]`

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

TAO_EC_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 | ACE_ENV_ARG_DECL
| ) | `[private]`

TAO_EC_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 | ACE_ENV_ARG_DECL
| ) | `[private]`

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 | ACE_ENV_ARG_DECL
| ) |

| 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 | ACE_ENV_ARG_DECL
| ) | `[private]`

| Check that arguments to run() are not nil.

## Member Data Documentation

ACE_CString TAO_ECG_Mcast_Gateway::address_server_arg_`[private]`

Address_Server_Type TAO_ECG_Mcast_Gateway::address_server_type_`[private]`

RtecEventChannelAdmin::ConsumerQOS TAO_ECG_Mcast_Gateway::consumer_qos_`[private]`

Handler_Type TAO_ECG_Mcast_Gateway::handler_type_`[private]`

int TAO_ECG_Mcast_Gateway::ip_multicast_loop_`[private]`

ACE_CString TAO_ECG_Mcast_Gateway::nic_`[private]`

int TAO_ECG_Mcast_Gateway::non_blocking_`[private]`

Service_Type TAO_ECG_Mcast_Gateway::service_type_`[private]`

u_char TAO_ECG_Mcast_Gateway::ttl_value_`[private]`

The documentation for this class was generated from the following files:

- ECG_Mcast_Gateway.h
- ECG_Mcast_Gateway.cpp
- ECG_Mcast_Gateway.i