Class FlowableImapChannelAdapter
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
com.flowable.platform.engine.impl.eventregistry.mail.FlowableImapChannelAdapter
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,Lifecycle
,Phased
,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.IntegrationInboundManagement
,org.springframework.integration.support.management.IntegrationManagement
,org.springframework.integration.support.management.ManageableLifecycle
,org.springframework.integration.support.management.ManageableSmartLifecycle
,org.springframework.integration.support.management.TrackableComponent
public class FlowableImapChannelAdapter
extends org.springframework.integration.endpoint.MessageProducerSupport
- Author:
- Filip Hrisafov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Supplier<CommandExecutor>
protected Duration
protected final String
protected Duration
protected Duration
protected final org.springframework.integration.mail.ImapMailReceiver
protected long
protected Executor
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ConstructorsConstructorDescriptionFlowableImapChannelAdapter
(org.springframework.integration.mail.ImapMailReceiver mailReceiver, String endpointId, Supplier<CommandExecutor> commandExecutorSupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected LockManager
void
destroy()
protected void
doStart()
protected void
onInit()
protected void
Receive messages from the mail server and send them to the channel.protected Object[]
Receive messages from the mail server.protected void
sendMessages
(Object[] messages) Send messages to the channelvoid
setLockForceAcquireAfter
(Duration lockForceAcquireAfter) void
setLockPollRate
(Duration lockPollRate) void
setLockWaitTime
(Duration lockWaitTime) void
setPollingRate
(Duration pollingRate) protected void
sleep
(long millisToWait) Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, doStop, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, 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, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedType
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Field Details
-
mailReceiver
protected final org.springframework.integration.mail.ImapMailReceiver mailReceiver -
lockName
-
commandExecutorSupplier
-
taskExecutor
-
pollingRate
protected long pollingRate -
lockPollRate
-
lockForceAcquireAfter
-
lockWaitTime
-
-
Constructor Details
-
FlowableImapChannelAdapter
public FlowableImapChannelAdapter(org.springframework.integration.mail.ImapMailReceiver mailReceiver, String endpointId, Supplier<CommandExecutor> commandExecutorSupplier)
-
-
Method Details
-
getComponentType
- Specified by:
getComponentType
in interfaceorg.springframework.integration.support.context.NamedComponent
- Overrides:
getComponentType
in classorg.springframework.integration.context.IntegrationObjectSupport
-
onInit
protected void onInit()- Overrides:
onInit
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStart
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
receiveMessagesLoop
protected void receiveMessagesLoop()Receive messages from the mail server and send them to the channel. Pause for the polling rate if no messages are received. Gracefully handle exceptions and pause for the polling rate if an exception occurs. -
sleep
protected void sleep(long millisToWait) -
createLockManager
-
receiveMessagesSafely
Receive messages from the mail server.- Returns:
- the received messages
- Throws:
jakarta.mail.MessagingException
-
sendMessages
Send messages to the channel -
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
- Specified by:
destroy
in interfaceorg.springframework.integration.support.management.IntegrationManagement
- Overrides:
destroy
in classorg.springframework.integration.endpoint.AbstractEndpoint
-
setPollingRate
-
setLockPollRate
-
setLockForceAcquireAfter
-
setLockWaitTime
-