Package org.dspace.event
Class Dispatcher
- java.lang.Object
-
- 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$
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,ConsumerProfile>consumersMap of consumers by their configured name.protected intidentifierunique identifier of this dispatcher - cached hash of its text Nameprotected Stringname
-
Constructor Summary
Constructors Modifier Constructor Description protectedDispatcher(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddConsumerProfile(ConsumerProfile cp)Add a consumer profile to the end of the list.abstract voiddispatch(Context ctx)Dispatch all events added to this Context according to configured consumers.CollectiongetConsumers()intgetIdentifier()
-
-
-
Field Detail
-
name
protected String name
-
identifier
protected int identifier
unique identifier 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()
- Returns:
- unique integer that identifies this Dispatcher configuration.
-
addConsumerProfile
public abstract void addConsumerProfile(ConsumerProfile cp) throws IllegalArgumentException
Add a consumer profile to the end of the list.- Parameters:
cp- the event consumer profile to add- 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
-
-