public class DelegateEventSource extends java.lang.Object implements EventSource, org.springframework.context.ApplicationContextAware
| Constructor and Description |
|---|
DelegateEventSource(java.lang.String name,
java.lang.String streamName,
java.lang.String eventSourceBuilder) |
| Modifier and Type | Method and Description |
|---|---|
ChannelPosition |
consumeAll(ChannelPosition startFrom,
java.util.function.Predicate<Message<?>> stopCondition)
Consumes all events from the EventSource, beginning with
startFrom, until
the stopCondition is met. |
DispatchingMessageConsumer |
dispatchingMessageConsumer()
Returns registered EventConsumers.
|
EventSource |
getDelegate() |
java.lang.String |
getName()
An event source's name is used to connect event sources to their consumers.
|
java.lang.String |
getStreamName()
Returns the name of the EventSource.
|
boolean |
isStopping() |
void |
register(MessageConsumer<?> messageConsumer)
Registers a new EventConsumer at the EventSource.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
stop() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconsumeAll, consumeAll, consumeAllpublic DelegateEventSource(java.lang.String name,
java.lang.String streamName,
java.lang.String eventSourceBuilder)
public java.lang.String getName()
EventSourcegetName in interface EventSourcepublic EventSource getDelegate()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic 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 registered EventConsumerpublic DispatchingMessageConsumer dispatchingMessageConsumer()
dispatchingMessageConsumer in interface EventSourcepublic java.lang.String getStreamName()
For streaming event-sources, this is the name of the event stream.
getStreamName in interface EventSourcepublic ChannelPosition consumeAll(ChannelPosition startFrom, java.util.function.Predicate<Message<?>> stopCondition)
startFrom, until
the stopCondition is met.
The registered consumers will be called zero or more times, depending on
the number of events retrieved from the EventSource.
consumeAll in interface EventSourcestartFrom - the read position returned from earlier executionsstopCondition - the predicate used as a stop conditionpublic void stop()
stop in interface EventSourcepublic boolean isStopping()
isStopping in interface EventSourcepublic java.lang.String toString()
toString in class java.lang.Object