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 Details

    • AbstractCancelableEvent

      protected AbstractCancelableEvent()
      Constructor initializing the event filter with an AlwaysMatchingEventFilter, meaning that this event will match any other event of the same type.
    • AbstractCancelableEvent

      protected AbstractCancelableEvent(String name)
      Constructor initializing the event filter with a FixedNameEventFilter, 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

      protected AbstractCancelableEvent(EventFilter eventFilter)
      Constructor using a custom EventFilter.
      Parameters:
      eventFilter - the filter to use for matching events
  • Method Details

    • isCanceled

      public boolean isCanceled()
      Description copied from interface: CancelableEvent
      Check if this event was canceled by one of the receivers.
      Specified by:
      isCanceled in interface CancelableEvent
      Returns:
      true if the event was canceled, false otherwise
    • cancel

      public void cancel()
      Description copied from interface: CancelableEvent
      Cancel the event. The actual canceling will be performed by the sender.
      Specified by:
      cancel in interface CancelableEvent
    • cancel

      public void cancel(String reason)
      Description copied from interface: CancelableEvent
      Cancel the event, giving a reason why. The actual canceling will be performed by the sender.
      Specified by:
      cancel in interface CancelableEvent
      Parameters:
      reason - the reason why the event was canceled
    • getReason

      public String getReason()
      Description copied from interface: CancelableEvent
      Get the reason why the event was canceled.
      Specified by:
      getReason in interface CancelableEvent
      Returns:
      reason for cancel or null of the event was not canceled or canceled using CancelableEvent.cancel()