org.apache.camel.processor
Class CamelLogProcessor

java.lang.Object
  extended by org.apache.camel.processor.CamelLogProcessor
All Implemented Interfaces:
AsyncProcessor, Processor

public class CamelLogProcessor
extends Object
implements AsyncProcessor

A Processor which just logs to a CamelLogger object which can be used as an exception handler instead of using a dead letter queue.

The name CamelLogger has been chosen to avoid any name clash with log kits which has a Logger class.

Version:

Constructor Summary
CamelLogProcessor()
           
CamelLogProcessor(CamelLogger log)
           
CamelLogProcessor(CamelLogger log, ExchangeFormatter formatter)
           
 
Method Summary
 CamelLogger getLogger()
           
 void process(Exchange exchange)
          Processes the message exchange
 boolean process(Exchange exchange, AsyncCallback callback)
          Processes the message exchange.
 void process(Exchange exchange, String message)
           
 void process(Exchange exchange, Throwable exception)
           
 void setLevel(LoggingLevel level)
           
 void setLogName(String logName)
           
 void setMarker(String marker)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CamelLogProcessor

public CamelLogProcessor()

CamelLogProcessor

public CamelLogProcessor(CamelLogger log)

CamelLogProcessor

public CamelLogProcessor(CamelLogger log,
                         ExchangeFormatter formatter)
Method Detail

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

Specified by:
process in interface Processor
Parameters:
exchange - the message exchange
Throws:
Exception - if an internal processing error has occurred.

process

public boolean process(Exchange exchange,
                       AsyncCallback callback)
Description copied from interface: AsyncProcessor
Processes the message exchange. Similar to Processor.process(org.apache.camel.Exchange), but the caller supports having the exchange asynchronously processed.

If there was a failure processing then the caused Exception would be set on the Exchange.

Specified by:
process in interface AsyncProcessor
Parameters:
exchange - the message exchange
callback - the AsyncCallback will be invoked when the processing of the exchange is completed. If the exchange is completed synchronously, then the callback is also invoked synchronously. The callback should therefore be careful of starting recursive loop.
Returns:
(doneSync) true to continue execute synchronously, false to continue being executed asynchronously

process

public void process(Exchange exchange,
                    Throwable exception)

process

public void process(Exchange exchange,
                    String message)

getLogger

public CamelLogger getLogger()

setLogName

public void setLogName(String logName)

setLevel

public void setLevel(LoggingLevel level)

setMarker

public void setMarker(String marker)


Apache Camel