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 Durationprotected final Stringprotected Durationprotected Durationprotected final org.springframework.integration.mail.ImapMailReceiverprotected longprotected ExecutorFields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields 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 LockManagervoiddestroy()protected voiddoStart()protected voidonInit()protected voidReceive messages from the mail server and send them to the channel.protected Object[]Receive messages from the mail server.protected voidsendMessages(Object[] messages) Send messages to the channelvoidsetLockForceAcquireAfter(Duration lockForceAcquireAfter) voidsetLockPollRate(Duration lockPollRate) voidsetLockWaitTime(Duration lockWaitTime) voidsetPollingRate(Duration pollingRate) protected voidsleep(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, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeMethods 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:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.context.IntegrationObjectSupport
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin 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:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
destroyin classorg.springframework.integration.endpoint.AbstractEndpoint
-
setPollingRate
-
setLockPollRate
-
setLockForceAcquireAfter
-
setLockWaitTime
-