Package de.otto.synapse.eventsource
Class AbstractEventSource
java.lang.Object
de.otto.synapse.eventsource.AbstractEventSource
- All Implemented Interfaces:
EventSource
- Direct Known Subclasses:
DefaultEventSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the EventSource.Returns the MessageDispatcher used to registerconsumersat the EventSource.Returns the MessageLogReceiverEndpoint used by theEventSourceto consume events.booleanvoidregister(MessageConsumer<?> messageConsumer) Registers a new EventConsumer at the EventSource.voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.otto.synapse.eventsource.EventSource
consume, consumeUntil
-
Constructor Details
-
AbstractEventSource
-
-
Method Details
-
getChannelName
Description copied from interface:EventSourceReturns the name of the EventSource.For streaming event-sources, this is the name of the event stream.
- Specified by:
getChannelNamein interfaceEventSource- Returns:
- name
-
stop
public void stop()- Specified by:
stopin interfaceEventSource
-
isStopping
public boolean isStopping()- Specified by:
isStoppingin interfaceEventSource
-
register
Registers a new EventConsumer at the EventSource.consumershave 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:
registerin interfaceEventSource- Parameters:
messageConsumer- the EventConsumer that is registered at the EventSource
-
getMessageDispatcher
Returns the MessageDispatcher used to registerconsumersat the EventSource.- Specified by:
getMessageDispatcherin interfaceEventSource- Returns:
- MessageDispatcher
-
getMessageLogReceiverEndpoint
Description copied from interface:EventSourceReturns the MessageLogReceiverEndpoint used by theEventSourceto consume events.- Specified by:
getMessageLogReceiverEndpointin interfaceEventSource- Returns:
- MessageLogReceiverEndpoint
-