- Model question
Event notification among distributed objects
Short answer
Distributed objects encapsulate state accessible via remote interface methods. Event notification enables asynchronous, loosely-coupled reactions to changes and one-to-many delivery without polling. The architecture uses event generators, an intermediate event service for filtering and routing, and subscribers that register for notifications via RMI in a push or pull model.
Define distributed objects. What are the needs of event notification during the communication among distributed objects? Explain the distributed event notification architecture in detail.
Distributed objects
A distributed object is an object whose methods can be invoked by processes on other computers. Its state is encapsulated and is accessible only through methods defined in a remote interface, and each remote object has a unique remote object reference (network address, object id, interface) that can be passed as a parameter or result. Examples are Java RMI remote objects and CORBA objects.
Need of event notification
- Objects must react to changes in other objects (a stock price changes, a document is edited, a sensor value passes a threshold) without constant polling, which wastes network and CPU.
- It gives asynchronous, loosely coupled communication: publishers and subscribers need not know each other.
- It supports one-to-many delivery to many subscribers at once.
- It supports heterogeneous systems, and scales better than polling.
- Typical uses: collaborative editing, stock-trading, monitoring, mobile and ubiquitous computing, alarms.
Distributed event notification architecture
Event generators Event service Subscribers
(objects of interest) +-----------------+ +-------------+
[Obj A] --event--> | filter, route, | -->| Observer 1 |
[Obj B] --event--> | store (mailbox) | -->| Observer 2 |
+-----------------+ +-------------+
<---- register / unregister (subscribe) ----
Components
- Event generators (objects of interest): objects whose state change produces an event.
- Events / notifications: objects holding type, source, time and attributes.
- Subscribers (listeners): register their interest and receive notifications by remote method call.
- Observers / event service (notifier): an intermediate object which separates generator from subscriber; can forward, filter by pattern, and store events in a mailbox for later delivery.
Operation
- The subscriber registers with the event generator (or event service) for given event types. A lease (time limit) may be given.
- An event occurs in the generator; a notification object is created.
- The generator (or event service) invokes
notifyon every registered subscriber by RMI. - The subscriber acts on it; it unsubscribes when it no longer needs the events or lets its lease expire.
Models: push (the generator sends events) and pull (the subscriber asks for events). Examples: Jini distributed event specification, CORBA Event/Notification Service.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- RMI functionalities; event notification · Distributed System, chapter 2
- Distributed objects and communication · Distributed System, chapter 2 · asked 2×
- Short note: JINI distributed event spec · Distributed System, chapter 2
- DFS; RMI communication between objects · Distributed System, chapter 2
- Event, causal and global ordering · Distributed System, chapter 5
- Distributed object versus multiprocessor architecture · Software Engineering, chapter 3
- Client-server versus distributed object architecture · Software Engineering, chapter 3
- Communication protocol and OSI architecture · Telecommunications, chapter 8
- Event management system summary and class diagram · Object Oriented Analysis and Design, chapter 2