org.apache.servicemix.components.util
Class TransformComponentSupport

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.TransformComponentSupport
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider
Direct Known Subclasses:
CacheComponent, ChainedComponent, EchoComponent, HelloWorldComponent, HttpInvoker, HttpsInvoker, JdbcComponent, MessagePropertySetterXML, MockServiceComponent, SaajBinding, ScriptComponent, SplitterComponent, TransformComponent, ValidateComponent, WSIFBinding, XsltComponent

public abstract class TransformComponentSupport
extends ComponentSupport
implements MessageExchangeListener

A useful base class for a transform component.

Version:
$Revision: 2626 $

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
protected TransformComponentSupport()
           
protected TransformComponentSupport(QName service, String endpoint)
           
 
Method Summary
protected  void copyPropertiesAndAttachments(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage in, javax.jbi.messaging.NormalizedMessage out)
          If enabled the properties and attachments are copied to the destination message
 org.apache.servicemix.store.Store getStore()
           
 org.apache.servicemix.store.StoreFactory getStoreFactory()
           
protected  void init()
          A helper method to allow a component to initialise prior to the endpoint being activated but after the component context has been configured.
 boolean isCopyAttachments()
           
 boolean isCopyProperties()
           
 void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
           
protected  void processFirstExchange(javax.jbi.messaging.MessageExchange exchange)
           
protected  void processOngoingExchange(javax.jbi.messaging.MessageExchange exchange)
           
 void setCopyAttachments(boolean copyAttachments)
           
 void setCopyProperties(boolean copyProperties)
           
 void setStore(org.apache.servicemix.store.Store store)
           
 void setStoreFactory(org.apache.servicemix.store.StoreFactory storeFactory)
           
protected abstract  boolean transform(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage in, javax.jbi.messaging.NormalizedMessage out)
          Transforms the given out message
 
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, 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

TransformComponentSupport

protected TransformComponentSupport()

TransformComponentSupport

protected TransformComponentSupport(QName service,
                                    String endpoint)
Method Detail

onMessageExchange

public void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
                       throws javax.jbi.messaging.MessagingException
Specified by:
onMessageExchange in interface org.apache.servicemix.jbi.listener.MessageExchangeListener
Throws:
javax.jbi.messaging.MessagingException

processFirstExchange

protected void processFirstExchange(javax.jbi.messaging.MessageExchange exchange)

processOngoingExchange

protected void processOngoingExchange(javax.jbi.messaging.MessageExchange exchange)

transform

protected abstract boolean transform(javax.jbi.messaging.MessageExchange exchange,
                                     javax.jbi.messaging.NormalizedMessage in,
                                     javax.jbi.messaging.NormalizedMessage out)
                              throws Exception
Transforms the given out message

Throws:
Exception

init

protected void init()
             throws javax.jbi.JBIException
Description copied from class: PojoSupport
A helper method to allow a component to initialise prior to the endpoint being activated but after the component context has been configured.

Overrides:
init in class PojoSupport
Throws:
javax.jbi.JBIException

isCopyProperties

public boolean isCopyProperties()

setCopyProperties

public void setCopyProperties(boolean copyProperties)

isCopyAttachments

public boolean isCopyAttachments()

setCopyAttachments

public void setCopyAttachments(boolean copyAttachments)

copyPropertiesAndAttachments

protected void copyPropertiesAndAttachments(javax.jbi.messaging.MessageExchange exchange,
                                            javax.jbi.messaging.NormalizedMessage in,
                                            javax.jbi.messaging.NormalizedMessage out)
                                     throws javax.jbi.messaging.MessagingException
If enabled the properties and attachments are copied to the destination message

Throws:
javax.jbi.messaging.MessagingException

getStoreFactory

public org.apache.servicemix.store.StoreFactory getStoreFactory()

setStoreFactory

public void setStoreFactory(org.apache.servicemix.store.StoreFactory storeFactory)

getStore

public org.apache.servicemix.store.Store getStore()

setStore

public void setStore(org.apache.servicemix.store.Store store)


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.