Interface IPullingListener<M>
- Type Parameters:
M- the raw message type
- All Superinterfaces:
org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.Aware, FrankElement, HasApplicationContext, HasName, IConfigurable, IListener<M>, IScopeProvider, NameAware
- All Known Subinterfaces:
ICorrelatedPullingListener<M>, IPeekableListener<M>
- All Known Implementing Classes:
AbstractFileSystemListener, AbstractMailListener, DirectoryListener, ExchangeMailListener, FtpFileSystemListener, ImapListener, JdbcListener, JdbcQueryListener, JdbcTableListener, KafkaListener, MessageStoreListener, PullingJmsListener, Samba2Listener, SambaListener, SftpFileSystemListener, SimpleJdbcListener
Defines listening behaviour of pulling receivers.
Pulling receivers are receivers that poll for a message, as opposed to pushing receivers
that are 'message driven'
- Author:
- Gerrit van Brakel
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseThread(@NonNull Map<String, Object> threadContext) Finalizes a message receiving thread.@Nullable RawMessageWrapper<M> getRawMessage(@NonNull Map<String, Object> threadContext) Retrieves messages from queue or other channel, but does no processing on it.Prepares a thread for receiving messages.Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface FrankElement
addConfigWarningMethods inherited from interface HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface IConfigurable
configureMethods inherited from interface IListener
afterMessageProcessed, extractMessage, start, stop
-
Method Details
-
openThread
Prepares a thread for receiving messages. Called once for each thread that will listen for messages.- Returns:
- the threadContext for this thread. The threadContext is a Map in which
thread-specific data can be stored. May not be
null, must be a mutable map type. - Throws:
ListenerException
-
closeThread
Finalizes a message receiving thread. Called once for each thread that listens for messages, just beforeIListener.stop()is called.- Throws:
ListenerException
-
getRawMessage
@Nullable RawMessageWrapper<M> getRawMessage(@NonNull Map<String, Object> threadContext) throws ListenerExceptionRetrieves messages from queue or other channel, but does no processing on it. Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, orsynchronized.Any thread-specific properties should be stored in and retrieved from the threadContext.
- Throws:
ListenerException
-