ActionDomainEvent

Fired whenever the framework interacts with a domain object’s action.

This is the specialization of AbstractDomainEvent , for actions, which should then be further subclassed by domain application.

The class has a number of responsibilities (in addition to those it inherits):

  • capture the arguments for each of the action’s parameters

  • provide selected metadata about the action parameters from the metamodel (names, types)

The class itself is instantiated automatically by the framework using a no-arg constructor; fields are set reflectively.

API

ActionDomainEvent.java
class ActionDomainEvent<S> {
  ActionDomainEvent()     (1)
  ActionDomainEvent(S source)     (2)
  void setReturnValue(Object returnValue)     (3)
  void setSemantics(SemanticsOf semantics)     (4)
  void setParameterNames(List<String> parameterNames)     (5)
  void setParameterTypes(List<Class<?>> parameterTypes)     (6)
  String toString()
}
1 ActionDomainEvent()

Subtypes can define a no-arg constructor; the framework sets state via (non-API) setters.

2 ActionDomainEvent(S)

Subtypes can define a one-arg constructor; the framework sets state via (non-API) setters.

3 setReturnValue(Object)

Set by the framework.

4 setSemantics(SemanticsOf)
5 setParameterNames(List)
6 setParameterTypes(List)

Members

ActionDomainEvent()

Subtypes can define a no-arg constructor; the framework sets state via (non-API) setters.

ActionDomainEvent(S)

Subtypes can define a one-arg constructor; the framework sets state via (non-API) setters.

A one-arg constructor is particularly useful in the context of non-static DomainEvent class nesting.

setReturnValue(Object)

Set by the framework.

Event subscribers can replace the value with some other value if they wish, though only in the AbstractDomainEvent.Phase#EXECUTED phase.

setSemantics(SemanticsOf)

setParameterNames(List)

setParameterTypes(List)