Package de.otto.synapse.eventsource
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 Summary
Constructors Constructor Description AbstractEventSource(MessageLogReceiverEndpoint messageLog) -
Method Summary
Modifier and Type Method Description java.lang.StringgetChannelName()Returns the name of the EventSource.MessageDispatchergetMessageDispatcher()Returns the MessageDispatcher used to registerconsumersat the EventSource.MessageLogReceiverEndpointgetMessageLogReceiverEndpoint()Returns the MessageLogReceiverEndpoint used by theEventSourceto consume events.booleanisStopping()voidregister(MessageConsumer<?> messageConsumer)Registers a new EventConsumer at the EventSource.voidstop()
-
Constructor Details
-
Method Details
-
getChannelName
public java.lang.String 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
-