Package org.xwiki.observation.event
Class AbstractCancelableEvent
java.lang.Object
org.xwiki.observation.event.AbstractFilterableEvent
org.xwiki.observation.event.AbstractCancelableEvent
- All Implemented Interfaces:
Serializable,CancelableEvent,Event,FilterableEvent
public abstract class AbstractCancelableEvent
extends AbstractFilterableEvent
implements CancelableEvent
Abstract base class for cancelable events.
- Since:
- 2.5M1
- Version:
- $Id: ff0c3681ca9f9a86904b02336b230103e50dd5f0 $
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor initializing the event filter with anAlwaysMatchingEventFilter, meaning that this event will match any other event of the same type.protectedConstructor initializing the event filter with aFixedNameEventFilter, meaning that this event will match only events of the same type affecting the same passed name.protectedAbstractCancelableEvent(EventFilter eventFilter) Constructor using a customEventFilter. -
Method Summary
Methods inherited from class org.xwiki.observation.event.AbstractFilterableEvent
equals, getEventFilter, hashCode, matches
-
Constructor Details
-
AbstractCancelableEvent
protected AbstractCancelableEvent()Constructor initializing the event filter with anAlwaysMatchingEventFilter, meaning that this event will match any other event of the same type. -
AbstractCancelableEvent
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
-
AbstractCancelableEvent
Constructor using a customEventFilter.- Parameters:
eventFilter- the filter to use for matching events
-
-
Method Details
-
isCanceled
public boolean isCanceled()Description copied from interface:CancelableEventCheck if this event was canceled by one of the receivers.- Specified by:
isCanceledin interfaceCancelableEvent- Returns:
- true if the event was canceled, false otherwise
-
cancel
public void cancel()Description copied from interface:CancelableEventCancel the event. The actual canceling will be performed by the sender.- Specified by:
cancelin interfaceCancelableEvent
-
cancel
Description copied from interface:CancelableEventCancel the event, giving a reason why. The actual canceling will be performed by the sender.- Specified by:
cancelin interfaceCancelableEvent- Parameters:
reason- the reason why the event was canceled
-
getReason
Description copied from interface:CancelableEventGet the reason why the event was canceled.- Specified by:
getReasonin interfaceCancelableEvent- Returns:
- reason for cancel or null of the event was not canceled or canceled using
CancelableEvent.cancel()
-