Interface CommandContext

    • Method Detail

      • sequenceNumber

        long sequenceNumber()
        The current sequence number of events in this entity.
        Returns:
        The current sequence number.
      • commandName

        java.lang.String commandName()
        The name of the command being executed.
        Returns:
        The name of the command.
      • commandId

        long commandId()
        The id of the command being executed.
        Returns:
        The id of the command.
      • emit

        void emit​(java.lang.Object event)
        Emit the given event. The event will be persisted, and the handler of the event defined in the current behavior will immediately be executed to pick it up.
        Parameters:
        event - The event to emit.