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:
- Runnable, BatchConsumer, Consumer, Service, ShutdownableService, ShutdownAware, SuspendableService
public class MailConsumer
- extends ScheduledPollConsumer
- implements BatchConsumer, ShutdownAware
A Consumer
which consumes messages from JavaMail using a
Transport
and dispatches them to the Processor
- Version:
- $Revision: 897106 $
Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
getDelay, getInitialDelay, getPollStrategy, getTimeUnit, isPollAllowed, isSuspended, isUseFixedDelay, resume, run, setDelay, setInitialDelay, setPollStrategy, setTimeUnit, setUseFixedDelay, suspend |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, start, stop |
DEFAULT_CONSUMER_DELAY
public static final long DEFAULT_CONSUMER_DELAY
- See Also:
- Constant Field Values
MailConsumer
public MailConsumer(MailEndpoint endpoint,
Processor processor,
JavaMailSenderImpl sender)
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class ScheduledPollConsumer
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class ScheduledPollConsumer
- Throws:
Exception
poll
protected void poll()
throws Exception
- Specified by:
poll
in class ScheduledPollConsumer
- Throws:
Exception
setMaxMessagesPerPoll
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
- Specified by:
setMaxMessagesPerPoll
in interface BatchConsumer
processBatch
public void processBatch(Queue<Object> exchanges)
throws Exception
- Specified by:
processBatch
in interface BatchConsumer
- Throws:
Exception
deferShutdown
public boolean deferShutdown(ShutdownRunningTask shutdownRunningTask)
- Specified by:
deferShutdown
in interface ShutdownAware
getPendingExchangesSize
public int getPendingExchangesSize()
- Specified by:
getPendingExchangesSize
in interface ShutdownAware
isBatchAllowed
public boolean isBatchAllowed()
- Specified by:
isBatchAllowed
in interface BatchConsumer
createExchanges
protected Queue<Exchange> createExchanges(Message[] messages)
throws MessagingException
- Throws:
MessagingException
processExchange
protected void processExchange(Exchange exchange)
throws Exception
- Strategy to process the mail message.
- Throws:
Exception
processCommit
protected void processCommit(Exchange exchange)
throws MessagingException
- Strategy to flag the message after being processed.
- Throws:
MessagingException
processRollback
protected void processRollback(Exchange exchange)
throws MessagingException
- Strategy when processing the exchange failed.
- Throws:
MessagingException
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.