Download presentation
1
Event Service Outline Events Channels Event Services Examples
2
Event Event: occurrence of some sort, atomic
Event notification: actual data is transferred Event-driven communication Each notification is sent by a single supplier Each notification may be delivered to potentially multiple consumers Each consumer may receive multiple notifications from multiple suppliers M-to-m communication Communication partners are anonymous (implicit invocation) Sending notification is nonblocking Event notifications must be parsed and checked explicitly by consumer Invocation-based communication Event Service
3
Decoupling Supplier and Consumer
Special Temporal Syntactic Semantic Event Service
4
Decoupling Supplier and Consumer
The decoupling provides several important benefits: Suppliers and consumers do not themselves physically have to handle the communication, nor must they have any specific knowledge of each other Message passing between the supplier and consumer takes place asynchronously Event channels will automatically buffer events they receive until a suitable consumer expresses interest in the events Events may be confirmed and their delivery guaranteed if the vendor has implemented this capability Suppliers can choose either to push events onto the channel (push) or have the channel itself to request events from them (pull) Similarly choice for the consumer A 1-to-1 correspondence between suppliers and consumers is not necessary: there can be multiple suppliers connected to a single consumer via the service, visa versa Event Service
5
CORBA Event Service Concepts
Mediator Pattern CollaboratingObject ConcreateCollaborator1 ConcreateCollaborator2 ConcreteMediator ConcreteMediator Event Service
6
Push Model Communication
Supplier Consumer event data event flow Event Service
7
Push Model Communication
Event channel push push() push() Supplier Event Channel Consumer event data event data event flow Event Service
8
Pull Model Communication
Supplier Consumer event data event flow Event Service
9
Pull Model Communication
Event channel push pull() pull() Supplier Event Channel Consumer event data event data event flow Event Service
10
Mixed-Mode Communication
push() push() Supplier Event Channel Consumer event data event data pull() event data pull() Supplier Consumer event data event flow Event Service
11
Event Flow Models Push Supplier Push Consumer Event Channel Pull
ProxyPushConsumer ProxyPushSupplier ProxyPullConsumer ProxyPullSupplier Pull Supplier pull() pull() Pull Consumer try_pull() try_pull() Event Direction Event Service
12
Event Type Typed Untyped (Any) Event Service
13
Interface Specifications: Module CosEventComm
exception Disconnected {}; interface PushConsumer { void push (in any data) raises (Disconnected); void disconnect_push_consumer (); }; interface PushSupplier { void disconnect_push_supplier (); }; interface PullSupplier { any pull () raises (Disconnected); any try_pull (out boolean has_event) raises (Disconnected); void disconnect_pull_supplier (); }; interface PullConsumer { void disconnect_pull_consumer (); }; }; Event Service
14
Interface Specifications Module: CosEventChannelAdmin
exception AlreadyConnected {}; exception TypeError {}; interface ProxyPushConsumer: CosEventComm::PushConsumer { void connect_push_supplier(in CosEventComm::PushSupplier push_supplier) raises(AlreadyConnected); }; interface ProxyPullSupplier: CosEventComm::PullSupplier { void connect_pull_consumer(in CosEventComm::PullConsumer pull_consumer) raises(AlreadyConnected); }; interface ProxyPullConsumer: CosEventComm::PullConsumer { void connect_pull_supplier(in CosEventComm::PullSupplier pull_supplier) raises(AlreadyConnected,TypeError); }; interface ProxyPushSupplier: CosEventComm::PushSupplier { void connect_push_consumer(in CosEventComm::PushConsumer push_consumer) raises(AlreadyConnected, TypeError); }; }; Event Service
15
Interface Specifications Module: CosEventChannelAdmin
interface ConsumerAdmin { ProxyPushSupplier obtain_push_supplier(); ProxyPullSupplier obtain_pull_supplier();}; interface SupplierAdmin { ProxyPushConsumer obtain_push_consumer(); ProxyPullConsumer obtain_pull_consumer();}; interface EventChannel { ConsumerAdmin for_consumers(); SupplierAdmin for_suppliers(); void destory();}; }; Event Service
16
Using an Event Channel Client (Supplier or Consumer) first binds to the Event Channel (which must be created already) Client obtains an Admin object from the Event Channel Consumer needs ConsumerAdmin Supplier needs SupplierAdmin Client obtains an proxy object from the Admin object ComsumerPloxy for Supplier client SupplierProxy for Consumer client Client adds the Supplier or Consumer to the Event Channel via a connect() call Client and/or the Event Channel transfer data via the push(), pull(), and/or try_pull() calls Event Service
17
An Example Printer Service push() Printer Supplier Event Channel event
data pull() Client Consumer event data event flow Event Service
18
Printer Interface module office { enum Status { CANCELLED, PRINTED, ONLINE, OFFLINE, JAMMED, OUT_OF_PAPER }; typedef long JobID; typedef string UserID; struct Job { JobID job_id; UserID user_id; }; union PrinterStatus switch( Status ) { case CANCELLED: case PRINTED: Job the_job; case OFFLINE: case ONLINE: boolean dummy; }; interface Printer { typedef string Document; exception OffLine {}; exception AlreadyPrinted {}; exception UnknownJobID {}; JobID print(in Document text, in UserID uid) raises (OffLine); void cancel(in JobID id, in UserID uid) raises (AlreadyPrinted, UnknownJobID); void setOffLine(in boolean flag); }; The IDL definition does not contain event notification information. Event Service
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.