The Event Service is the CORBA service which allows
to dispatch events from suppliers to consumers. An event channel is
the medium of this dispatching. Each event supplier communicates its
events to a single event channel through a proxy consumer attached to
the channel. Each event consumer gets events from the event channel
from a proxy supplier attached to the channel. Each end point of the
communication can use the push or the pull model (see OMG
Technical Library for detailed description).
In this
implementation, at event channel creation time, you can decide if a
channel keeps an history of events to be delivered to consumers at
connection time, or if each event is discarded once dispatched to
connected consumers.
The whole OMG IDL specification of the
Event Service is implemented.
To simplify the use of the Event Service, Top Graph'X added some
extra usefull facilities like an event channel factory (see Top
Graph'X additions).
The Event Service is an initial
service which runs as a standalone program, its object id is
"TgxEventService". Its use is protected by a license key.
No limitation is known for this service.
To make easier the use of the Event Service, the module TgxEventAdmin has been added. It contains four interfaces:
Link
To link two event channels
Sender
Implementation of a
push supplier
Receiver
Implementation of a
pull consumer
EventChannelFactory
To create
event channels, links, push suppliers and pull consumers
The IDL description of this interface is:
interface Link { void link () raises(Linked); void unlink() raises(Unlinked); void destroy(); readonly attribute CosEventChannelAdmin::EventChannel from; readonly attribute CosEventChannelAdmin::EventChannel to; };
link
To start the dispatching of events from the source event channel to the destination event channel. Each consumer of the destination channel will then reveive any event sent to the source event channel.
unlink
To stop the dispatching of events. Consumers of the destination channel will no longer reveive any event sent to the source event channel.
destroy
Destroy the link object
from
To get the source event channel
to
To get the destination event channel
The IDL description of this interface is:
interface Sender: CosEventComm::PushSupplier { void send(in any data) raises(CosEventComm::Disconnected); void destroy(); };
send
To send an event to the event channel
destroy
To destroy the Sender object
The IDL description of this interface is:
interface Receiver: CosEventComm::PullConsumer { Event_List get_event_queue() raises(CosEventComm::Disconnected); void destroy(); };
get_event_queue
This operation retrieves the whole list of pending events.
destroy
To destroy the Receiver object
The IDL description of this interface is:
interface EventChannelFactory { CosEventChannelAdmin::EventChannel create_channel( in boolean Get_Old_Events, in unsigned long queue_length); Link create_link ( in CosEventChannelAdmin::EventChannel from, in CosEventChannelAdmin::EventChannel to); Sender create_sender (in CosEventChannelAdmin::EventChannel channel); Receiver create_receiver (in CosEventChannelAdmin::EventChannel channel); };
Its operations do the following:
create_channel
to create an event channel
Get_Old_Events indicates whether, once an event is received from a supplier, it should be discarded after its dispatching to the connected consumers (False) or kept for delivery to newly connected consumers (True). In the latter case, queue_length indicates the length of the old events queue. When this queue is full, the oldest event is discarded when a new event is received.
create_link
to create a link between two event channels
"from" indicates the source channel and "to" the target channel
create_sender
to create a push supplier of the given event channel
create_receiver
to create a pull consumer of the given event channel
The Event Service has no starting particularities.
You will have to get first the reference of the event channel factory which is the initial reference of the Event_Service:
Corba.Object.Ref (Factory) := Corba.Orb.Resolve_Initial_References (This_Orb, TgxEventAdmin.Tgx_Service_Name);
Then, you can create the necessary event channel(s). In
order for the suppliers or consumers clients to easily retrieve their
channel, it is wise to store its reference in the Naming Service.
In
each supplier or consumer client, you will create the appropriate
Sender or Receiver object using the convenient event channel.
Copyright
Micro Focus 2002-2014. All rights reserved.