org.springframework.integration.adapter.mail
Class SubscribableMailSource
java.lang.Object
org.springframework.integration.adapter.mail.SubscribableMailSource
- All Implemented Interfaces:
- org.springframework.beans.factory.DisposableBean, org.springframework.context.Lifecycle, MessageSource, SubscribableSource
public class SubscribableMailSource
- extends java.lang.Object
- implements SubscribableSource, org.springframework.context.Lifecycle, org.springframework.beans.factory.DisposableBean
Broadcasts all mail messages recovered to subscribed MessageTargets
.
The given FolderConnection
should be using an AsyncMonitoringStrategy
to
retrieve mail.
- Author:
- Jonas Partner
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final org.apache.commons.logging.Log logger
dispatcher
private final BroadcastingDispatcher dispatcher
taskExecutor
private final org.springframework.core.task.TaskExecutor taskExecutor
monitorRunnable
private final SubscribableMailSource.MonitorRunnable monitorRunnable
monitorRunning
private volatile boolean monitorRunning
converter
private volatile MailMessageConverter converter
SubscribableMailSource
public SubscribableMailSource(FolderConnection folderConnection,
org.springframework.core.task.TaskExecutor taskExecutor)
setApplySequence
public void setApplySequence(boolean applySequence)
subscribe
public boolean subscribe(MessageTarget target)
- Description copied from interface:
SubscribableSource
- Register a
MessageTarget
as a subscriber to this source.
- Specified by:
subscribe
in interface SubscribableSource
unsubscribe
public boolean unsubscribe(MessageTarget target)
- Description copied from interface:
SubscribableSource
- Remove a
MessageTarget
from the subscribers of this source.
- Specified by:
unsubscribe
in interface SubscribableSource
setConverter
public void setConverter(MailMessageConverter converter)
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
start
public void start()
- Specified by:
start
in interface org.springframework.context.Lifecycle
stop
public void stop()
- Specified by:
stop
in interface org.springframework.context.Lifecycle
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface org.springframework.context.Lifecycle
startMonitor
protected void startMonitor()
stopMonitor
protected void stopMonitor()