org.mule.api.processor
Class LoggerMessageProcessor

java.lang.Object
  extended by org.mule.api.processor.LoggerMessageProcessor
All Implemented Interfaces:
AnnotatedObject, MuleContextAware, Initialisable, MessageProcessor

public class LoggerMessageProcessor
extends Object
implements MessageProcessor, Initialisable, MuleContextAware, AnnotatedObject

MessageProcessor implementation that logs the current element of a value evaluated from it using an expression evaluator. By default the current messages is logged using the Level.DEBUG level to the 'org.mule.api.processor.LoggerMessageProcessor' category. The level and category can both be configured to suit your needs.


Field Summary
protected  String category
           
protected  ExpressionManager expressionManager
           
protected  String level
           
protected  Log logger
           
protected  String message
           
protected  MuleContext muleContext
           
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
LoggerMessageProcessor()
           
 
Method Summary
 Object getAnnotation(QName name)
          Gets the value of specified annotation.
 Map<QName,Object> getAnnotations()
          Gets all annotations.
 void initialise()
          Method used to perform any initialisation work.
protected  void initLogger()
           
protected  void log(MuleEvent event)
           
protected  void logWithLevel(Object object)
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setAnnotations(Map<QName,Object> newAnnotations)
          Sets annotations to the object.
 void setCategory(String category)
           
 void setLevel(String level)
           
 void setMessage(String message)
           
 void setMuleContext(MuleContext muleContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger

message

protected String message

category

protected String category

level

protected String level

muleContext

protected MuleContext muleContext

expressionManager

protected ExpressionManager expressionManager
Constructor Detail

LoggerMessageProcessor

public LoggerMessageProcessor()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

initLogger

protected void initLogger()

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Specified by:
process in interface MessageProcessor
Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

log

protected void log(MuleEvent event)

logWithLevel

protected void logWithLevel(Object object)

setMuleContext

public void setMuleContext(MuleContext muleContext)
Specified by:
setMuleContext in interface MuleContextAware

setMessage

public void setMessage(String message)

setCategory

public void setCategory(String category)

setLevel

public void setLevel(String level)

getAnnotation

public final Object getAnnotation(QName name)
Description copied from interface: AnnotatedObject
Gets the value of specified annotation.

Specified by:
getAnnotation in interface AnnotatedObject
Returns:
the value of specified annotation

getAnnotations

public final Map<QName,Object> getAnnotations()
Description copied from interface: AnnotatedObject
Gets all annotations.

Specified by:
getAnnotations in interface AnnotatedObject
Returns:
all annotation

setAnnotations

public final void setAnnotations(Map<QName,Object> newAnnotations)
Description copied from interface: AnnotatedObject
Sets annotations to the object.

Specified by:
setAnnotations in interface AnnotatedObject


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.