CommandSubscriber

Part of the Publishing SPI . A component to receive Command s (with publishing enabled) that just completed.

API

CommandSubscriber.java
interface CommandSubscriber {
  void onReady(Command command)     (1)
  void onStarted(Command command)     (2)
  void onCompleted(Command command)     (3)
}
1 onReady(Command)

Notifies that the command will be published, and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#READY .

2 onStarted(Command)

Notifies that the command has started to execute, and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#STARTED .

3 onCompleted(Command)

Notifies that the command has completed and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#COMPLETED

Members

onReady(Command)

Notifies that the command will be published, and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#READY .

This is an opportunity for implementations to process the command, for example to persist an initial representation of it.

onStarted(Command)

Notifies that the command has started to execute, and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#STARTED .

This is an opportunity for implementations to process the command, for example to update any persisted representation of it.

onCompleted(Command)

Notifies that the command has completed and has transitioned to org.apache.causeway.applib.services.command.Command.CommandPublishingPhase#COMPLETED

This is an opportunity for implementations to process the command, for example to update any persisted representations of it.

Implementation

This is an SPI, but the framework provides a simple implementation, o.a.c.applib.services.publishing.log.CommandLogger, that just logs events as they are received.