Class ConsumerActionHandler<T>

  • Type Parameters:
    T - the type of messages of the Channel
    All Implemented Interfaces:
    ActionHandler<Consume<T>,​T>

    public final class ConsumerActionHandler<T>
    extends Object
    implements ActionHandler<Consume<T>,​T>
    The ActionHandler implementation for the Consume Action. This handler will always execute the consumer given to the Consume Action.
    See Also:
    EventMaid Documentation
    • Constructor Detail

      • ConsumerActionHandler

        public ConsumerActionHandler()
    • Method Detail

      • consumerActionHandler

        public static <T> ConsumerActionHandler<T> consumerActionHandler()
        Factory method for a new ConsumerActionHandler.
        Type Parameters:
        T - the type of messages of the Channel
        Returns:
        a new ConsumerActionHandler
      • handle

        public void handle​(Consume<T> consume,
                           ProcessingContext<T> processingContext)
        Will call the Consume Action's consumer.
        Specified by:
        handle in interface ActionHandler<Consume<T>,​T>
        Parameters:
        consume - the Consume Action to be handled
        processingContext - the message