Package org.xwiki.observation.event
Class AbstractFilterableEvent
java.lang.Object
org.xwiki.observation.event.AbstractFilterableEvent
- All Implemented Interfaces:
Serializable,Event,FilterableEvent
- Direct Known Subclasses:
AbstractCancelableEvent
public abstract class AbstractFilterableEvent
extends Object
implements FilterableEvent, Serializable
An helper to extend for all Events associated to a single
String value.
If the event value is not a String extending this class should be avoided.
- Since:
- 2.4M2
- Version:
- $Id: 80fd93c424a24140843a6adc84145a9e8dd1d773 $
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor initializing the event filter with anAlwaysMatchingEventFilter, meaning that this event will match any other event of the same type.Constructor initializing the event filter with aFixedNameEventFilter, meaning that this event will match only events of the same type affecting the same passed name.AbstractFilterableEvent(EventFilter eventFilter) Constructor using a customEventFilter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the filter used to match this event against other events, used inEvent.matches(Object).inthashCode()booleanCompares two events to see if they match, meaning that a listener that registered to receive notifications likereferenceEventwill be notified of any occuring event for whichreferenceEvent.matches(occuringEvent)will returntrue.
-
Constructor Details
-
AbstractFilterableEvent
public AbstractFilterableEvent()Constructor initializing the event filter with anAlwaysMatchingEventFilter, meaning that this event will match any other event of the same type. -
AbstractFilterableEvent
Constructor initializing the event filter with aFixedNameEventFilter, meaning that this event will match only events of the same type affecting the same passed name.- Parameters:
name- a generic name that uniquely identifies an event type
-
AbstractFilterableEvent
Constructor using a customEventFilter.- Parameters:
eventFilter- the filter to use for matching events
-
-
Method Details
-
getEventFilter
Description copied from interface:FilterableEventRetrieves the filter used to match this event against other events, used inEvent.matches(Object).- Specified by:
getEventFilterin interfaceFilterableEvent- Returns:
- the event's filter
-
matches
Compares two events to see if they match, meaning that a listener that registered to receive notifications likereferenceEventwill be notified of any occuring event for whichreferenceEvent.matches(occuringEvent)will returntrue. The matching algorithm depends on the event implementation. For example for Document events two events match if they implement the same event class and if theirEventFiltermatch. Note that the implementation is left open in order to cater for all the possible ways this Observation component can be used.This type of events match only events of the same type, and only if the internal
eventFilters alsoEventFilter.matches(EventFilter)match. -
equals
-
hashCode
public int hashCode()
-