SPI that allows the execution of individual interactions (action invocations or property edits) to be subscribed to.
The typical use case is to facilitate coarse-grained messaging for system-to-system interactions, that is from an Apache Isis application to some other system. This could be done using a pub/sub bus such asApache ActiveMQwithApache Camel.
Only actions/properties annotated for publishing (using Action#executionPublishing() or Property#executionPublishing() are published.
Callback to notify that an interaction (an action invocation or property edit, as represented by Execution ) has completed.
This callback method is called by the framework immediately after the interaction (not at the end of the transaction, unlike some of the other subscribers).
Most implementations are expected to use Execution#getDto() to create a serializable XML representation of the execution. The easiest way to do this is using InteractionDtoUtils#newInteractionDto(Execution) .
The framework allows multiple implementations of this service to be registered; all will be called.
This is an SPI, but the framework provides a simple implementation,
o.a.i.applib.services.publishing.log.ExecutionLogger, that just logs events as they are received.
It can be configured using:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <Properties> ... </Properties> <Appenders> ... </Appenders> <Loggers> ... <logger name="org.apache.isis.applib.services.publishing.log.ExecutionLogger" level="debug"/> ... </Loggers> </Configuration>
log4j2-spring.xml file in simpleapp for the omitted detail.
If the WrapperFactory is used to call other objects then the metrics are captured for each sub-execution.
the EntityChangesSubscriber is used to obtain the set of objects modified within the interaction
the MetricsService is used to obtain the objects that are loaded throughout the transaction; this info is used in order to instantiate the EntityChanges object passed through to the EntityChangesSubscriber.
All of these services collaborate implicitly by way of the HasInteractionId interface.
The event propagation is strictly in-memory, and there are no restrictions on the object acting as the event; it need not be serializable, for example.