Module org.apache.sis.storage
Package org.apache.sis.storage.event

# Interface StoreListener<E extends StoreEvent>

Type Parameters:
  `E` - the type of events of interest to this listener.

All Superinterfaces:
  `EventListener`

public interface StoreListener<E extends StoreEvent> extends EventListener
An object which listens for events (typically changes or warnings) occurring in a resource or one of its children. The kind of event is defined by the subclass of the `StoreEvent` instance given to the `eventOccured(StoreEvent)` method. For example if a warning occurred while reading data from a file, then the event will be an instance of `WarningEvent`.

`Resource` implementations are responsible for instantiating the most specific `StoreEvent` subclass for the type of events. Then, all `StoreListener`s that declared an interest for `StoreEvent`s of that kind are notified, including listeners in parent resources. Each listener is notified only once per event even if the listener is registered twice.

Since:
  1.0
See Also:
  - `StoreEvent`
  - `Resource​.addListener(Class, StoreListener)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `eventOccured(E event)`
  Invoked after a warning or a change occurred in a resource.

- ## Method Details

  - ### eventOccured

    void eventOccured(E event)
    Invoked after a warning or a change occurred in a resource. The `StoreEvent​.getSource()` method gives the resource where the event occurred. It is not necessarily the resource in which this listener has been registered; it may be one of the resource children.
    Parameters:
      `event` - description of the change or warning that occurred in a resource. Shall not be `null`.