org.apache.camel.component.mail
Class MailConsumer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer<E>
          extended by org.apache.camel.impl.ScheduledPollConsumer<MailExchange>
              extended by 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 $

Field Summary
static long DEFAULT_CONSUMER_DELAY
           
 
Constructor Summary
MailConsumer(MailEndpoint endpoint, Processor processor, JavaMailSenderImpl sender)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
protected  void ensureIsConnected()
           
protected  void poll()
           
protected  void process(MailExchange exchange)
          Strategy to process the mail message.
protected  void processCommit(MailExchange exchange)
          Strategy to flag the message after being processed.
protected  void processMessages(Message[] messages)
          Process all the messages
protected  void processRollback(MailExchange exchange)
          Strategy when processing the exchange failed.
 
Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer
getDelay, getInitialDelay, getTimeUnit, isUseFixedDelay, run, setDelay, setInitialDelay, setTimeUnit, setUseFixedDelay
 
Methods inherited from class org.apache.camel.impl.DefaultConsumer
getAsyncProcessor, getEndpoint, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
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
 

Field Detail

DEFAULT_CONSUMER_DELAY

public static final long DEFAULT_CONSUMER_DELAY
See Also:
Constant Field Values
Constructor Detail

MailConsumer

public MailConsumer(MailEndpoint endpoint,
                    Processor processor,
                    JavaMailSenderImpl sender)
Method Detail

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.