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
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.
Implementation
This is an SPI, but the framework provides a simple implementation, o.a.c.applib.services.publishing.log.EntityChangesLogger
, that just logs events as they are received.