org.apache.camel.component.mail
Class MailConsumer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer<E>
org.apache.camel.impl.ScheduledPollConsumer<MailExchange>
org.apache.camel.component.mail.MailConsumer
- All Implemented Interfaces:
- Runnable, Consumer<MailExchange>, Service
public class MailConsumer
- extends ScheduledPollConsumer<MailExchange>
A Consumer
which consumes messages from JavaMail using a
Transport
and dispatches them to the Processor
- Version:
- $Revision: 759933 $
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, 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<MailExchange>
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class ScheduledPollConsumer<MailExchange>
- Throws:
Exception
poll
protected void poll()
throws Exception
- Specified by:
poll
in class ScheduledPollConsumer<MailExchange>
- Throws:
Exception
ensureIsConnected
protected void ensureIsConnected()
throws MessagingException
- Throws:
MessagingException
processMessages
protected void processMessages(Message[] messages)
throws Exception
- Process all the messages
- Throws:
Exception
process
protected void process(MailExchange exchange)
throws Exception
- Strategy to process the mail message.
- Throws:
Exception
processCommit
protected void processCommit(MailExchange exchange)
throws MessagingException
- Strategy to flag the message after being processed.
- Throws:
MessagingException
processRollback
protected void processRollback(MailExchange exchange)
throws MessagingException
- Strategy when processing the exchange failed.
- Throws:
MessagingException
Copyright © 2009 Apache Software Foundation. All Rights Reserved.