EntityChangesSubscriber

SPI to receive a summary of the number of entities that have changed as the result of an interaction (action invocation or property edit).

One use case is for performance profiling: to determine the "footprint" of an interaction, which will have a direct impact on the response time of that interaction.

Only those entities that have publishing enabled (using * DomainObject#entityChangePublishing() ) are included.

API

EntityChangesSubscriber.java
interface EntityChangesSubscriber {
  void onChanging(EntityChanges entityChanges)     (1)
}
1 onChanging(EntityChanges)

Receives all changing entities (with publishing enabled using DomainObject#entityChangePublishing() ) as an instance of EntityChanges .

Members

onChanging(EntityChanges)

Receives all changing entities (with publishing enabled using DomainObject#entityChangePublishing() ) as an instance of EntityChanges .

The callback is called at the end of the transaction, during the pre-commit phase.

Implementations

This is an SPI.

If multiple implementations of this service are registered, all will be called.

Applib (Log4j2)

The applib provides a simple implementation, EntityChangesLogger, that just logs events as they are received.

See Also