Class ImapIdleChannelAdapter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.mail.ImapIdleChannelAdapter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.beans.factory.SmartInitializingSingleton
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationEventPublisherAware
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,org.springframework.integration.context.ExpressionCapable
,org.springframework.integration.core.MessageProducer
,org.springframework.integration.IntegrationPattern
,org.springframework.integration.support.context.NamedComponent
,org.springframework.integration.support.management.ManageableLifecycle
,org.springframework.integration.support.management.ManageableSmartLifecycle
,org.springframework.integration.support.management.TrackableComponent
public class ImapIdleChannelAdapter
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.ApplicationEventPublisherAware
An event-driven Channel Adapter that receives mail messages from a mail
server that supports the IMAP "idle" command (see RFC 2177). Received mail
messages will be converted and sent as Spring Integration Messages to the
output channel. The Message payload will be the
Message
instance that was received.-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ImapIdleChannelAdapter.ImapIdleExceptionEvent
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
-
Constructor Summary
Constructors Constructor Description ImapIdleChannelAdapter(ImapMailReceiver mailReceiver)
-
Method Summary
Modifier and Type Method Description void
destroy()
protected void
doStart()
protected void
doStop()
java.lang.String
getComponentType()
void
setAdviceChain(java.util.List<org.aopalliance.aop.Advice> adviceChain)
void
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
void
setBeanClassLoader(java.lang.ClassLoader classLoader)
void
setReconnectDelay(long reconnectDelay)
The time between connection attempts in milliseconds (default 10 seconds).void
setSendingTaskExecutor(java.util.concurrent.Executor sendingTaskExecutor)
Specify anExecutor
used to send messages received by the adapter.void
setShouldReconnectAutomatically(boolean shouldReconnectAutomatically)
Specify whether the IDLE task should reconnect automatically after catching aFolderClosedException
while waiting for messages.void
setTransactionSynchronizationFactory(org.springframework.integration.transaction.TransactionSynchronizationFactory transactionSynchronizationFactory)
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, onInit, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
Method Details
-
setTransactionSynchronizationFactory
public void setTransactionSynchronizationFactory(org.springframework.integration.transaction.TransactionSynchronizationFactory transactionSynchronizationFactory) -
setAdviceChain
public void setAdviceChain(java.util.List<org.aopalliance.aop.Advice> adviceChain) -
setSendingTaskExecutor
public void setSendingTaskExecutor(java.util.concurrent.Executor sendingTaskExecutor)Specify anExecutor
used to send messages received by the adapter.- Parameters:
sendingTaskExecutor
- the sendingTaskExecutor to set
-
setShouldReconnectAutomatically
public void setShouldReconnectAutomatically(boolean shouldReconnectAutomatically)Specify whether the IDLE task should reconnect automatically after catching aFolderClosedException
while waiting for messages. The default value istrue
.- Parameters:
shouldReconnectAutomatically
- true to reconnect.
-
setReconnectDelay
public void setReconnectDelay(long reconnectDelay)The time between connection attempts in milliseconds (default 10 seconds).- Parameters:
reconnectDelay
- the reconnectDelay to set- Since:
- 3.0.5
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentType
in interfaceorg.springframework.integration.support.context.NamedComponent
- Overrides:
getComponentType
in classorg.springframework.integration.context.IntegrationObjectSupport
-
setBeanClassLoader
public void setBeanClassLoader(java.lang.ClassLoader classLoader)- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)- Specified by:
setApplicationEventPublisher
in interfaceorg.springframework.context.ApplicationEventPublisherAware
-
doStart
protected void doStart()- Overrides:
doStart
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStop
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Overrides:
destroy
in classorg.springframework.integration.endpoint.AbstractEndpoint
-