Execution

Represents an action invocation/property edit as a node in a call-stack execution graph, with sub-interactions being made by way of the WrapperFactory ).

The Interaction has a reference to a Interaction#getCurrentExecution() top-level execution.

API

Execution.java
class Execution<T, E> {
  void setParent(Execution<?, ?> parent)     (1)
  List<Execution<?, ?>> getChildren()     (2)
  E getEvent()
  void setEvent(E event)     (3)
  Timestamp start(ClockService clockService, MetricsService metricsService)
  void setCompletedAt(Timestamp completedAt, MetricsService metricsService)     (4)
  void setReturned(Object returned)     (5)
  void setThrew(Exception threw)     (6)
  void setDto(T executionDto)     (7)
}
1 setParent(Execution)
*NOT API* : intended to be called only by the framework.
2 getChildren()

The actions/property edits made in turn via the WrapperFactory .

3 setEvent(E)
*NOT API* : intended to be called only by the framework.
4 setCompletedAt(Timestamp, MetricsService)
*NOT API* : intended to be called only by the framework.
5 setReturned(Object)
*NOT API* : intended to be called only by the framework.
6 setThrew(Exception)
*NOT API* : intended to be called only by the framework.
7 setDto(T)
*NOT API* : Set by framework (implementation of _org.apache.causeway.core.metamodel.execution.InternalInteraction.MemberExecutor_ )

Members

setParent(Execution)

*NOT API* : intended to be called only by the framework.

getChildren()

The actions/property edits made in turn via the WrapperFactory .

setEvent(E)

*NOT API* : intended to be called only by the framework.

setCompletedAt(Timestamp, MetricsService)

*NOT API* : intended to be called only by the framework.

setReturned(Object)

*NOT API* : intended to be called only by the framework.

setThrew(Exception)

*NOT API* : intended to be called only by the framework.

setDto(T)

*NOT API* : Set by framework (implementation of _org.apache.causeway.core.metamodel.execution.InternalInteraction.MemberExecutor_ )

Implementation

This is an abstract class with two concrete subclasses

  • ActionInvocation represents the execution of an action being invoked:

    public class ActionInvocation extends Execution {
        public List<Object> getArgs();                  (1)
    }
1 The objects passed in as the arguments to the action’s parameters. Any of these could be null.
  • PropertyEdit represents the execution of a property being edited: =

public class PropertyEdit extends Execution {
    public Object getNewValue();                    (1)
}
1 The object used as the new value of the property. Could be null if the property is being cleared.

Usage Notes

Executions can be subscribed to using the ExecutionSubscriber interface.

+ One reason to subscribe is to persist these interaction/executions. This supports several use cases:

  • they enable profiling of the running application (which actions are invoked then most often, what is their response time)

  • if auditing is configured (using EntityPropertyChangeSubscriber), they provide better audit information, since the parent Interaction captures the 'cause' of an interaction and can be correlated to the audit records (the "effect" of the interaction) by way of the interactionId that both share.

See also