public interface Observer
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRIORITY
Maximum priority.
|
static int |
MIN_PRIORITY
Minimum priority.
|
Modifier and Type | Method and Description |
---|---|
int |
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers. |
void |
observe(Event event,
Map<String,Object> transientVars)
Observes an event.
|
boolean |
supports(Event event)
Checks if the event is supported.
|
static final int MIN_PRIORITY
static final int MAX_PRIORITY
boolean supports(Event event)
event
- the event.true
for observing this event, false
otherwise.int getPriority(Event event)
event
- the event.void observe(Event event, Map<String,Object> transientVars) throws Exception
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event.
This may allow optimizations between observers.Exception
- if an error occurs.
All exceptions will be logged but not propagated, as the observation mechanism should never fail.