Class MessagePropertySetterXML

  extended by
      extended by org.apache.servicemix.components.util.PojoSupport
          extended by org.apache.servicemix.components.util.ComponentSupport
              extended by org.apache.servicemix.components.util.TransformComponentSupport
                  extended by org.apache.servicemix.components.mps.MessagePropertySetterXML
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle,, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider

public class MessagePropertySetterXML
extends TransformComponentSupport

Sets properties on the message, loaded from an XML MPS file where the properties to set are located in a inside the XML config file. There can be more than one propertySet to "load". The property values are derived from 3 types of config. The first config that can return a value as a String to set onto the message, will be the "value" that is set as the property. As it's name suggests, the "value" of this element will be the value of the JBI property. This is helpful as a default value, or as a static value. and This will obtain the value of an existing property (itself) or another property on the same message. This can be helpful when you want the to "ONLY" change the the value of the property if there is some "xpath" expression that could not be derived. name=".." form will copy the string value of the other JBI property onto this one, (duping it). This may be handy when you have a component which expects a new property, but you have it as a different name at the moment. As it's name suggests, will locate a value in the inMessage source and set the resulting XPath String as the value of the JBI property. So given the three types, they can be arranged in any order. and the first PropertyValue Type that returns a value, will become the "value" of the JBI property.


Field Summary
          The name of our JBI property we may have to interrogate to use as the "xpath" for the set of config.
static String XML_ELEMENT_NAME
          The XML Element name "property-set"
Fields inherited from class
currentState, INITIALIZED, listener
Fields inherited from interface
Constructor Summary
Method Summary
 void init(javax.jbi.component.ComponentContext context)
          We are only interested in loading the XML onfig, nothing else
 void setPropertySet(String propertySet)
 void setXmlConfiguration( xmlConfiguration)
 void setXpathForPropertySet(String xpathForPropertySet)
protected  boolean transform(javax.jbi.messaging.MessageExchange arg0, javax.jbi.messaging.NormalizedMessage in, javax.jbi.messaging.NormalizedMessage out)
          Here is the transform of the message We will locate the propertySetName to use and the load up our propertySet magic wand and apply all the properties we can to the outgoing NormalizedMessage
Methods inherited from class org.apache.servicemix.components.util.TransformComponentSupport
copyPropertiesAndAttachments, getStore, getStoreFactory, init, isCopyAttachments, isCopyProperties, onMessageExchange, processFirstExchange, processOngoingExchange, setCopyAttachments, setCopyProperties, setStore, setStoreFactory
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, isInAndOut, send, sendSync, sendSync, setBody, setEndpoint, setExtensionMBeanName, setService, shutDown
Methods inherited from class
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

Field Detail


public static final String MPS_PROP_NAME_PROPERTYSET
The name of our JBI property we may have to interrogate to use as the "xpath" for the set of config.

See Also:
Constant Field Values


public static final String XML_ELEMENT_NAME
The XML Element name "property-set"

See Also:
Constant Field Values
Constructor Detail


public MessagePropertySetterXML()
Method Detail


protected boolean transform(javax.jbi.messaging.MessageExchange arg0,
                            javax.jbi.messaging.NormalizedMessage in,
                            javax.jbi.messaging.NormalizedMessage out)
                     throws javax.jbi.messaging.MessagingException
Here is the transform of the message We will locate the propertySetName to use and the load up our propertySet magic wand and apply all the properties we can to the outgoing NormalizedMessage

Specified by:
transform in class TransformComponentSupport


public void init(javax.jbi.component.ComponentContext context)
          throws javax.jbi.JBIException
We are only interested in loading the XML onfig, nothing else

Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
init in class PojoSupport


public void setPropertySet(String propertySet)
propertySet - The propertySet to set.


public void setXmlConfiguration( xmlConfiguration)
xmlConfiguration - The xmlConfiguration to set.


public void setXpathForPropertySet(String xpathForPropertySet)
xpathForPropertySet - xpath to apply to a message to derive the name of the property-set we want to load

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