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.ComponentSourceAware, 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<org.flowable.common.engine.impl.interceptor.CommandExecutor> protected Durationprotected final Stringprotected Durationprotected Durationprotected final org.springframework.integration.mail.inbound.ImapMailReceiverprotected longprotected ThreadFields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
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 SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionFlowableImapChannelAdapter(org.springframework.integration.mail.inbound.ImapMailReceiver mailReceiver, String endpointId, Supplier<org.flowable.common.engine.impl.interceptor.CommandExecutor> commandExecutorSupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.flowable.common.engine.api.lock.LockManagervoiddestroy()protected voiddoStart()protected voiddoStop()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, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getRequiredOutputChannel, isObserved, onInit, 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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class 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, getComponentNameMethods inherited from interface SmartLifecycle
isPauseable
-
Field Details
-
mailReceiver
protected final org.springframework.integration.mail.inbound.ImapMailReceiver mailReceiver -
lockName
-
commandExecutorSupplier
protected final Supplier<org.flowable.common.engine.impl.interceptor.CommandExecutor> commandExecutorSupplier -
pollingThread
-
pollingRate
protected long pollingRate -
lockPollRate
-
lockForceAcquireAfter
-
lockWaitTime
-
-
Constructor Details
-
FlowableImapChannelAdapter
-
-
Method Details
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStopin 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
protected org.flowable.common.engine.api.lock.LockManager 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
-