Interface CallbackBehavior

All Known Implementing Classes:
DefaultCallbackBehavior

public interface CallbackBehavior
Interface towards a mechanism that replicates the behavior of a Command Handling component. The goal of this component is to mimic behavior on the callback.
Since:
2.0
Author:
Allard Buijze
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(Object commandPayload, Metadata commandMetadata)
    Invoked when the Command Bus receives a Command that is dispatched with a Callback method.
  • Method Details

    • handle

      Object handle(Object commandPayload, Metadata commandMetadata) throws Exception
      Invoked when the Command Bus receives a Command that is dispatched with a Callback method. The return value of this invocation is used to invoke the callback.
      Parameters:
      commandPayload - The payload of the Command Message
      commandMetadata - The Metadata of the CommandMessage
      Returns:
      any return value to pass to the callback's onResult method.
      Throws:
      Exception - If the onFailure method of the callback must be invoked