public abstract class AbstractEventSource extends java.lang.Object implements EventSource
| Constructor and Description |
|---|
AbstractEventSource(java.lang.String name,
MessageLogReceiverEndpoint messageLog,
org.springframework.context.ApplicationEventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getChannelName()
Returns the name of the EventSource.
|
MessageDispatcher |
getMessageDispatcher()
Returns the MessageDispatcher used to register
consumers at the EventSource. |
java.lang.String |
getName()
An event source's name is used to connect event sources to their consumers.
|
boolean |
isStopping() |
protected void |
publishEvent(ChannelPosition channelPosition,
EventSourceNotification.Status status) |
protected void |
publishEvent(ChannelPosition channelPosition,
EventSourceNotification.Status status,
java.lang.String message) |
void |
register(MessageConsumer<?> messageConsumer)
Registers a new EventConsumer at the EventSource.
|
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsume, consume, consume, consumepublic AbstractEventSource(java.lang.String name,
MessageLogReceiverEndpoint messageLog,
org.springframework.context.ApplicationEventPublisher eventPublisher)
public java.lang.String getName()
EventSourcegetName in interface EventSourcepublic java.lang.String getChannelName()
EventSourceFor streaming event-sources, this is the name of the event stream.
getChannelName in interface EventSourcepublic void stop()
stop in interface EventSourcepublic boolean isStopping()
isStopping in interface EventSourcepublic void register(MessageConsumer<?> messageConsumer)
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)
register in interface EventSourcemessageConsumer - the EventConsumer that is registered at the EventSource@Nonnull public MessageDispatcher getMessageDispatcher()
consumers at the EventSource.getMessageDispatcher in interface EventSourceprotected void publishEvent(ChannelPosition channelPosition, EventSourceNotification.Status status)
protected void publishEvent(ChannelPosition channelPosition, EventSourceNotification.Status status, java.lang.String message)