Class AbstractEventSource

java.lang.Object
de.otto.synapse.eventsource.AbstractEventSource
All Implemented Interfaces:
EventSource
Direct Known Subclasses:
DefaultEventSource

public abstract class AbstractEventSource
extends java.lang.Object
implements EventSource
  • Constructor Details

  • Method Details

    • getChannelName

      public java.lang.String getChannelName()
      Description copied from interface: EventSource
      Returns the name of the EventSource.

      For streaming event-sources, this is the name of the event stream.

      Specified by:
      getChannelName in interface EventSource
      Returns:
      name
    • stop

      public void stop()
      Specified by:
      stop in interface EventSource
    • isStopping

      public boolean isStopping()
      Specified by:
      isStopping in interface EventSource
    • register

      public void register​(MessageConsumer<?> messageConsumer)
      Registers a new EventConsumer at the EventSource.

      consumers have to be thread safe as it may be called from multiple threads (e.g. for kinesis streams there is one thread per shard)

      Specified by:
      register in interface EventSource
      Parameters:
      messageConsumer - the EventConsumer that is registered at the EventSource
    • getMessageDispatcher

      @Nonnull public MessageDispatcher getMessageDispatcher()
      Returns the MessageDispatcher used to register consumers at the EventSource.
      Specified by:
      getMessageDispatcher in interface EventSource
      Returns:
      MessageDispatcher
    • getMessageLogReceiverEndpoint

      @Nonnull public MessageLogReceiverEndpoint getMessageLogReceiverEndpoint()
      Description copied from interface: EventSource
      Returns the MessageLogReceiverEndpoint used by the EventSource to consume events.
      Specified by:
      getMessageLogReceiverEndpoint in interface EventSource
      Returns:
      MessageLogReceiverEndpoint