org.apache.servicemix.components.util
Class TraceComponent

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.components.util.PojoSupport
          extended by org.apache.servicemix.components.util.ComponentSupport
              extended by org.apache.servicemix.components.util.TraceComponent
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider

public class TraceComponent
extends ComponentSupport
implements MessageExchangeListener

A simple tracing component which can be placed inside a pipeline to trace the message exchange though the component.

Version:
$Revision: 648504 $

Field Summary
 
Fields inherited from class org.apache.servicemix.components.util.PojoSupport
logger
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
TraceComponent()
           
 
Method Summary
 Log getLog()
           
 org.apache.servicemix.jbi.jaxp.SourceTransformer getSourceTransformer()
           
 void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
          Intercepts the MessageExchange to output the message and its properties for debugging purposes.
protected  void outputProperties(javax.jbi.messaging.NormalizedMessage message)
          Outputs the properties on the NormalizedMessage.
 void setLog(Log log)
           
 void setSourceTransformer(org.apache.servicemix.jbi.jaxp.SourceTransformer sourceTransformer)
           
 
Methods inherited from class org.apache.servicemix.components.util.ComponentSupport
createComponentLifeCycle, createInOnlyExchange, createInOnlyExchange, createInOnlyExchange, createInOptionalOutExchange, createInOutExchange, createInOutExchange, createRobustInOnlyExchange, createServiceUnitManager, creatInOutExchange, forwardToExchange, forwardToExchange, getInMessage, getLifeCycle, getMessageTransformer, getServiceDescription, getServiceUnitManager, initializeServiceUnitManager, invoke, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, propagateCorrelationId, resolveEndpointReference, setMessageTransformer
 
Methods inherited from class org.apache.servicemix.components.util.PojoSupport
answer, done, fail, fail, getBody, getContext, getDeliveryChannel, getDescription, getEndpoint, getExchangeFactory, getExtensionMBeanName, getService, init, init, isInAndOut, send, sendSync, sendSync, setBody, setEndpoint, setExtensionMBeanName, setService, shutDown
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getName, getObjectToManage, getOperationInfos, getSubType, getType, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jbi.component.ComponentLifeCycle
start, stop
 

Constructor Detail

TraceComponent

public TraceComponent()
Method Detail

getLog

public Log getLog()

setLog

public void setLog(Log log)

getSourceTransformer

public org.apache.servicemix.jbi.jaxp.SourceTransformer getSourceTransformer()

setSourceTransformer

public void setSourceTransformer(org.apache.servicemix.jbi.jaxp.SourceTransformer sourceTransformer)

onMessageExchange

public void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
                       throws javax.jbi.messaging.MessagingException
Intercepts the MessageExchange to output the message and its properties for debugging purposes.

Specified by:
onMessageExchange in interface org.apache.servicemix.jbi.listener.MessageExchangeListener
Parameters:
exchange - A JBI MessageExchange between two endpoints
Throws:
javax.jbi.messaging.MessagingException

outputProperties

protected void outputProperties(javax.jbi.messaging.NormalizedMessage message)
Outputs the properties on the NormalizedMessage. Properties of type Source are transformed to a String before being output.

Parameters:
message - The NormalizedMessage to be processed


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.