org.apache.camel.processor
Class DeadLetterChannel

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.ErrorHandlerSupport
          extended by org.apache.camel.processor.DeadLetterChannel
All Implemented Interfaces:
Processor, ErrorHandler, Service

public class DeadLetterChannel
extends ErrorHandlerSupport

Implements a Dead Letter Channel after attempting to redeliver the message using the RedeliveryPolicy

Version:
$Revision: 564644 $

Field Summary
static String REDELIVERED
           
static String REDELIVERY_COUNTER
           
 
Constructor Summary
DeadLetterChannel(Processor output, Processor deadLetter)
           
DeadLetterChannel(Processor output, Processor deadLetter, RedeliveryPolicy redeliveryPolicy, Logger logger)
           
 
Method Summary
static
<E extends Exchange>
Logger
createDefaultLogger()
           
protected  void doStart()
           
protected  void doStop()
           
 Processor getDeadLetter()
          Returns the dead letter that message exchanges will be sent to if the redelivery attempts fail
 Logger getLogger()
           
 Processor getOutput()
          Returns the output processor
 RedeliveryPolicy getRedeliveryPolicy()
           
protected  int incrementRedeliveryCounter(Exchange exchange, Throwable e)
          Increments the redelivery counter and adds the redelivered flag if the message has been redelivered
 void process(Exchange exchange)
          Processes the message exchange
 void setLogger(Logger logger)
          Sets the logger strategy; which Log to use and which LoggingLevel to use
 void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
          Sets the redelivery policy
protected  void sleep(long redeliveryDelay)
           
 String toString()
           
 
Methods inherited from class org.apache.camel.processor.ErrorHandlerSupport
addExceptionPolicy, customProcessorForException, getExceptionPolicy
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, isStarted, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REDELIVERY_COUNTER

public static final String REDELIVERY_COUNTER
See Also:
Constant Field Values

REDELIVERED

public static final String REDELIVERED
See Also:
Constant Field Values
Constructor Detail

DeadLetterChannel

public DeadLetterChannel(Processor output,
                         Processor deadLetter)

DeadLetterChannel

public DeadLetterChannel(Processor output,
                         Processor deadLetter,
                         RedeliveryPolicy redeliveryPolicy,
                         Logger logger)
Method Detail

createDefaultLogger

public static <E extends Exchange> Logger createDefaultLogger()

toString

public String toString()
Overrides:
toString in class Object

process

public void process(Exchange exchange)
             throws Exception
Description copied from interface: Processor
Processes the message exchange

Throws:
Exception - if an internal processing error has occurred.

getOutput

public Processor getOutput()
Returns the output processor


getDeadLetter

public Processor getDeadLetter()
Returns the dead letter that message exchanges will be sent to if the redelivery attempts fail


getRedeliveryPolicy

public RedeliveryPolicy getRedeliveryPolicy()

setRedeliveryPolicy

public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
Sets the redelivery policy


getLogger

public Logger getLogger()

setLogger

public void setLogger(Logger logger)
Sets the logger strategy; which Log to use and which LoggingLevel to use


incrementRedeliveryCounter

protected int incrementRedeliveryCounter(Exchange exchange,
                                         Throwable e)
Increments the redelivery counter and adds the redelivered flag if the message has been redelivered


sleep

protected void sleep(long redeliveryDelay)

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Copyright © 2007 Apache Software Foundation. All Rights Reserved.