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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    FlowableImapChannelAdapter(org.springframework.integration.mail.ImapMailReceiver mailReceiver, String endpointId, Supplier<CommandExecutor> commandExecutorSupplier)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected LockManager
     
    void
     
    protected void
     
     
    protected void
     
    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 channel
    void
    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

      protected final String lockName
    • commandExecutorSupplier

      protected final Supplier<CommandExecutor> commandExecutorSupplier
    • taskExecutor

      protected Executor taskExecutor
    • pollingRate

      protected long pollingRate
    • lockPollRate

      protected Duration lockPollRate
    • lockForceAcquireAfter

      protected Duration lockForceAcquireAfter
    • lockWaitTime

      protected Duration lockWaitTime
  • Constructor Details

    • FlowableImapChannelAdapter

      public FlowableImapChannelAdapter(org.springframework.integration.mail.ImapMailReceiver mailReceiver, String endpointId, Supplier<CommandExecutor> commandExecutorSupplier)
  • Method Details

    • getComponentType

      public String getComponentType()
      Specified by:
      getComponentType in interface org.springframework.integration.support.context.NamedComponent
      Overrides:
      getComponentType in class org.springframework.integration.context.IntegrationObjectSupport
    • onInit

      protected void onInit()
      Overrides:
      onInit in class org.springframework.integration.endpoint.MessageProducerSupport
    • doStart

      protected void doStart()
      Overrides:
      doStart in class org.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 LockManager createLockManager()
    • receiveMessagesSafely

      protected Object[] receiveMessagesSafely() throws jakarta.mail.MessagingException
      Receive messages from the mail server.
      Returns:
      the received messages
      Throws:
      jakarta.mail.MessagingException
    • sendMessages

      protected void sendMessages(Object[] messages)
      Send messages to the channel
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
      Specified by:
      destroy in interface org.springframework.integration.support.management.IntegrationManagement
      Overrides:
      destroy in class org.springframework.integration.endpoint.AbstractEndpoint
    • setPollingRate

      public void setPollingRate(Duration pollingRate)
    • setLockPollRate

      public void setLockPollRate(Duration lockPollRate)
    • setLockForceAcquireAfter

      public void setLockForceAcquireAfter(Duration lockForceAcquireAfter)
    • setLockWaitTime

      public void setLockWaitTime(Duration lockWaitTime)