org.apache.camel.component.mail
Class MailConsumer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.mail.MailConsumer
- All Implemented Interfaces:
- java.lang.Runnable, org.apache.camel.BatchConsumer, org.apache.camel.Consumer, org.apache.camel.PollingConsumerPollingStrategy, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.ShutdownAware, org.apache.camel.SuspendableService
public class MailConsumer
- extends org.apache.camel.impl.ScheduledPollConsumer
- implements org.apache.camel.BatchConsumer, org.apache.camel.spi.ShutdownAware
A Consumer which consumes messages from JavaMail using a
Transport and dispatches them to the Processor
- Version:
| Fields inherited from class org.apache.camel.impl.DefaultConsumer |
log |
|
Constructor Summary |
MailConsumer(MailEndpoint endpoint,
org.apache.camel.Processor processor,
org.springframework.mail.javamail.JavaMailSenderImpl sender)
|
| Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
afterPoll, beforePoll, doSuspend, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getTimeUnit, isPollAllowed, isUseFixedDelay, onStartup, run, setDelay, setInitialDelay, setPollStrategy, setRunLoggingLevel, setTimeUnit, setUseFixedDelay |
| Methods inherited from class org.apache.camel.impl.DefaultConsumer |
getAsyncProcessor, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doResume, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
start, stop |
| Methods inherited from interface org.apache.camel.SuspendableService |
isSuspended, resume, suspend |
DEFAULT_CONSUMER_DELAY
public static final long DEFAULT_CONSUMER_DELAY
- See Also:
- Constant Field Values
MailConsumer
public MailConsumer(MailEndpoint endpoint,
org.apache.camel.Processor processor,
org.springframework.mail.javamail.JavaMailSenderImpl sender)
doStart
protected void doStart()
throws java.lang.Exception
- Overrides:
doStart in class org.apache.camel.impl.ScheduledPollConsumer
- Throws:
java.lang.Exception
doStop
protected void doStop()
throws java.lang.Exception
- Overrides:
doStop in class org.apache.camel.impl.ScheduledPollConsumer
- Throws:
java.lang.Exception
poll
protected int poll()
throws java.lang.Exception
- Specified by:
poll in class org.apache.camel.impl.ScheduledPollConsumer
- Throws:
java.lang.Exception
setMaxMessagesPerPoll
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
- Specified by:
setMaxMessagesPerPoll in interface org.apache.camel.BatchConsumer
processBatch
public int processBatch(java.util.Queue<java.lang.Object> exchanges)
throws java.lang.Exception
- Specified by:
processBatch in interface org.apache.camel.BatchConsumer
- Throws:
java.lang.Exception
deferShutdown
public boolean deferShutdown(org.apache.camel.ShutdownRunningTask shutdownRunningTask)
- Specified by:
deferShutdown in interface org.apache.camel.spi.ShutdownAware
getPendingExchangesSize
public int getPendingExchangesSize()
- Specified by:
getPendingExchangesSize in interface org.apache.camel.spi.ShutdownAware
prepareShutdown
public void prepareShutdown()
- Specified by:
prepareShutdown in interface org.apache.camel.spi.ShutdownAware
isBatchAllowed
public boolean isBatchAllowed()
- Specified by:
isBatchAllowed in interface org.apache.camel.BatchConsumer
createExchanges
protected java.util.Queue<org.apache.camel.Exchange> createExchanges(javax.mail.Message[] messages)
throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
processExchange
protected void processExchange(org.apache.camel.Exchange exchange)
throws java.lang.Exception
- Strategy to process the mail message.
- Throws:
java.lang.Exception
processCommit
protected void processCommit(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
- Strategy to flag the message after being processed.
- Parameters:
mail - the mail messageexchange - the exchange
processRollback
protected void processRollback(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
- Strategy when processing the exchange failed.
- Parameters:
mail - the mail messageexchange - the exchange
getEndpoint
public MailEndpoint getEndpoint()
- Specified by:
getEndpoint in interface org.apache.camel.Consumer- Overrides:
getEndpoint in class org.apache.camel.impl.DefaultConsumer
Apache CAMEL