public interface ResourceEventStore extends Store
ResourceEvents. This store is to be used by listeners registered in the application to report change events as they occur. An event store instance is to retrieve with
TrsStoreSynchronizer.getResourceEventStore(), which ensures method calls are correctly synchronized across the whole web application.
|Modifier and Type||Method and Description|
Stores one or a few
void store(ResourceEvent... resourceEvents)
resource events. If a larger volume of events is to send at once, client is recommended to rather use the
resourceEvents- events to store.
void store(Function<Consumer<ResourceEvent>,?> eventsProvider)
resource events. If only one or a few events are to report at once, client may use the simpler
The function implementation must be thread-safe, as the store will call the
Function.apply(Object) method in a dedicated thread,
so that calls to this method are non blocking.
The function argument provides access to change events to be added in this store.
Implementation must call the
apply() method of this function and use as argument a
Consumer to get notified of events.
Implementation is advised to use a
BufferedConsumer for optimal performance.