Interface CommandHandlingMember<T>

Type Parameters:
T - The type of entity to which the message handler will delegate the actual handling of the command.
All Superinterfaces:
MessageHandlingMember<T>

@Internal public interface CommandHandlingMember<T> extends MessageHandlingMember<T>
Interface describing a message handler capable of handling a specific command.
Since:
3.0.0
Author:
Allard Buijze
  • Method Details

    • commandName

      String commandName()
      Returns the name of the command that can be handled.

      Might be an empty String when undefined by this handling member, in which case components gathering CommandHandlingMembers should fall back to other mechanisms to define the name of a handling member.

      Returns:
      The name of the command that can be handled.
    • routingKey

      String routingKey()
      Returns the property of the command that is to be used as routing key towards this command handler instance. If multiple handlers instances are available, a sending component is responsible to route commands with the same routing key value to the correct instance.
      Returns:
      The property of the command to use as routing key.
    • isFactoryHandler

      boolean isFactoryHandler()
      Check if this message handler creates a new instance of the entity of type T to handle this command.

      This is for instance the case if the message is handled in the constructor method of the entity.

      Returns:
      true if this handler is also factory for entities, false otherwise.