org.apache.cocoon.portal.event
Interface EventManager

All Superinterfaces:
Component
All Known Implementing Classes:
DefaultEventManager

public interface EventManager
extends Component

This component manages the event handling mechanism in the portal. The event mechanism is based on the publisher/subscriber principle. An interested component (a Receiver can subscribe itself for a specific class (or classes) of events. All Events have a common ancestor type Event and the event types are identified by a (sub)class The old design which is now deprecated has been inspired by the paper by Gupta, S., J. M. Hartkopf, and S. Ramaswamy, in Java Report, Vol. 3, No. 7, July 1998, 19-36, "Event Notifier: A Pattern for Event Notification". EventManager brokers events between a Publisher, which produces events, and a Subscriber, which handles the notification of events. A Filter discards events not of interest to a subscriber.

Version:
CVS $Id: EventManager.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler, Volker Schmitt, Mauro Talevi

Field Summary
static String ROLE
          Represents the role of the service
 
Method Summary
 Publisher getPublisher()
          Deprecated. Use send(Event) instead.
 Register getRegister()
          Deprecated. Use subscribe(Receiver) and unsubscribe(Receiver).
 void processEvents()
          Process the events
 void send(Event event)
          Publish an event.
 void subscribe(Receiver receiver)
          Subscribes a receiver for a specific type of event.
 void unsubscribe(Receiver receiver)
          Unsubscribes a receiver for all events.
 

Field Detail

ROLE

static final String ROLE
Represents the role of the service

Method Detail

getPublisher

Publisher getPublisher()
Deprecated. Use send(Event) instead.

Returns the Publisher with which events can be published.


getRegister

Register getRegister()
Deprecated. Use subscribe(Receiver) and unsubscribe(Receiver).

Returns the Register with which subscribers can subscribe and unsubscribe interest to given Events.


processEvents

void processEvents()
                   throws ProcessingException
Process the events

Throws:
ProcessingException

send

void send(Event event)
Publish an event. All registered receivers get notified.

Parameters:
event - The event to broadcast.

subscribe

void subscribe(Receiver receiver)
Subscribes a receiver for a specific type of event.


unsubscribe

void unsubscribe(Receiver receiver)
Unsubscribes a receiver for all events.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.