Outline - PowerPoint PPT Presentation

About This Presentation
Title:

Outline

Description:

Communication partners are anonymous (implicit invocation) Sending notification is nonblocking ... Client obtains an proxy object from the Admin object ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 19
Provided by: shangp
Learn more at: http://www.cs.iit.edu
Category:

less

Transcript and Presenter's Notes

Title: Outline


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

3
Decoupling Supplier and Consumer
  • Special
  • Temporal
  • Syntactic
  • Semantic

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

5
CORBA Event Service Concepts
  • Mediator Pattern

CollaboratingObject
ConcreateCollaborator1
ConcreateCollaborator2
ConcreteMediator
ConcreteMediator
6
Push Model Communication
  • Push Model Communication

push()
Supplier
Consumer
event data
event flow
7
Push Model Communication
  • Event channel push

push()
push()
Consumer
Supplier
Event Channel
event data
event data
event flow
8
Pull Model Communication
  • Pull Model Communication

pull()
Supplier
Consumer
event data
event flow
9
Pull Model Communication
  • Event channel push

pull()
pull()
Supplier
Event Channel
Consumer
event data
event data
event flow
10
Mixed-Mode Communication

push()
push()
Consumer
Supplier
Event Channel
event data
event data
pull()
event data
pull()
Supplier
Consumer
event data
event flow
11
Event Flow Models

Push Supplier
Push Consumer
push()
push()
Event Channel
ProxyPushConsumer
ProxyPushSupplier
ProxyPullConsumer
ProxyPullSupplier
Pull Supplier
pull()
Pull Consumer
pull()
try_pull()
try_pull()
Event Direction
12
Event Type
  • Typed
  • Untyped (Any)

13
Interface Specifications Module CosEventComm
  • 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 ()

14
Interface SpecificationsModule
CosEventChannelAdmin
  • module CosEventChannelAdmin
  • exception AlreadyConnected
  • exception TypeError
  • interface ProxyPushConsumer
    CosEventCommPushConsumer
  • void connect_push_supplier(in CosEventCommPushS
    upplier push_supplier)
  • raises(AlreadyConnected)
  • interface ProxyPullSupplier CosEventCommPullS
    upplier
  • void connect_pull_consumer(in CosEventCommPullC
    onsumer pull_consumer)
  • raises(AlreadyConnected)
  • interface ProxyPullConsumer CosEventCommPullC
    onsumer
  • void connect_pull_supplier(in CosEventCommPullS
    upplier pull_supplier)
  • raises(AlreadyConnected,TypeError)
  • interface ProxyPushSupplier CosEventCommPushS
    upplier
  • void connect_push_consumer(in CosEventCommPushC
    onsumer push_consumer)
  • raises(AlreadyConnected, TypeError)

15
Interface SpecificationsModule
CosEventChannelAdmin
  • 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()

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

17
An Example
  • Printer Service

push()
Printer Supplier
Event Channel
event data
pull()
Client Consumer
event data
event flow
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

The IDL definition does not contain event
notification information.
Write a Comment
User Comments (0)
About PowerShow.com