org.dspace.event
Class Dispatcher

java.lang.Object
  extended by org.dspace.event.Dispatcher
Direct Known Subclasses:
BasicDispatcher

public abstract class Dispatcher
extends Object

Interface for event dispatchers. The primary role of a dispatcher is to deliver a set of events to a configured list of consumers. It may also transform, consolidate, and otherwise optimize the event stream prior to delivering events to its consumers.

Version:
$Revision: 3762 $

Field Summary
protected  Map<String,ConsumerProfile> consumers
          Map of consumers by their configured name.
protected  int identifier
          unique identifer of this dispatcher - cached hash of its text Name
protected  String name
           
 
Constructor Summary
protected Dispatcher(String name)
           
 
Method Summary
abstract  void addConsumerProfile(ConsumerProfile cp)
          Add a consumer to the end of the list.
abstract  void dispatch(Context ctx)
          Dispatch all events added to this Context according to configured consumers.
 Collection getConsumers()
           
 int getIdentifier()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

identifier

protected int identifier
unique identifer of this dispatcher - cached hash of its text Name


consumers

protected Map<String,ConsumerProfile> consumers
Map of consumers by their configured name.

Constructor Detail

Dispatcher

protected Dispatcher(String name)
Method Detail

getConsumers

public Collection getConsumers()

getIdentifier

public int getIdentifier()

addConsumerProfile

public abstract void addConsumerProfile(ConsumerProfile cp)
                                 throws IllegalArgumentException
Add a consumer to the end of the list.

Parameters:
consumer - the event consumer to add
filter - the event filter to apply
Throws:
IllegalArgumentException

dispatch

public abstract void dispatch(Context ctx)
Dispatch all events added to this Context according to configured consumers.

Parameters:
ctx - the execution context object


Copyright © 2010 DuraSpace. All Rights Reserved.