Class StoreEvent

java.lang.Object
java.util.EventObject
org.apache.sis.storage.event.StoreEvent
All Implemented Interfaces:
Serializable, Localized
Direct Known Subclasses:
CascadedStoreEvent, WarningEvent

public abstract class StoreEvent extends EventObject implements Localized
Parent class of events happening in a data store resource. The event may be a warning or a change in the metadata, content or structure of a resource. Those events are created by Resource implementations and sent to all registered listeners.
Since:
1.0
Version:
1.3
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Whether this event has been consumed.
    private boolean
    Whether to consume this event after all listeners registered on the source resource but before listeners registered on the parent resource or data store.
    private static final long
    For cross-version compatibility.

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs an event that occurred in the given resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    consume(boolean later)
    Marks this event as consumed.
    Returns the locale associated to this event, or null if unspecified.
    Returns the resource where the event occurred.
    final boolean
    Indicates whether this event has been consumed by any listener.
    (package private) final boolean
    Returns true if the event propagation can continue with parent listeners.

    Methods inherited from class java.util.EventObject

    toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • consumed

      private boolean consumed
      Whether this event has been consumed. A consumed event is not propagated to other listeners.
    • consumeLater

      private boolean consumeLater
      Whether to consume this event after all listeners registered on the source resource but before listeners registered on the parent resource or data store.
  • Constructor Details

    • StoreEvent

      protected StoreEvent(Resource source)
      Constructs an event that occurred in the given resource.
      Parameters:
      source - the resource where the event occurred.
      Throws:
      IllegalArgumentException - if the given source is null.
  • Method Details

    • getSource

      public Resource getSource()
      Returns the resource where the event occurred. It is not necessarily the resource in which listeners have been registered; it may be one of the resource children.
      Overrides:
      getSource in class EventObject
      Returns:
      the resource where the event occurred.
    • getLocale

      public Locale getLocale()
      Returns the locale associated to this event, or null if unspecified. That locale may be used for formatting messages related to this event. The event locale is typically inherited from the DataStore locale.
      Specified by:
      getLocale in interface Localized
      Returns:
      the locale associated to this event (typically specified by the data store), or null if unknown.
      See Also:
    • isConsumed

      public final boolean isConsumed()
      Indicates whether this event has been consumed by any listener. A consumed event is not propagated further to other listeners.
      Returns:
      true if this event has been consumed, false otherwise.
      Since:
      1.3
    • isConsumedForParent

      final boolean isConsumedForParent()
      Returns true if the event propagation can continue with parent listeners.
    • consume

      public void consume(boolean later)
      Marks this event as consumed. This stops its further propagation to other listeners.
      Parameters:
      later - false for consuming now, or true for consuming after all listeners registered on the source resource but before listeners registered on the parent resource or data store.
      Since:
      1.3