org.mule.routing.outbound
Class FilteringXmlMessageSplitter

java.lang.Object
  extended byorg.mule.routing.AbstractRouter
      extended byorg.mule.routing.outbound.AbstractOutboundRouter
          extended byorg.mule.routing.outbound.FilteringOutboundRouter
              extended byorg.mule.routing.outbound.AbstractMessageSplitter
                  extended byorg.mule.routing.outbound.FilteringXmlMessageSplitter
All Implemented Interfaces:
UMOOutboundRouter, UMORouter
Direct Known Subclasses:
RoundRobinXmlSplitter

public class FilteringXmlMessageSplitter
extends AbstractMessageSplitter

FilteringXmlMessageSplitter will split a DOM4J document into nodes based on the "splitExpression" property.

Optionally, you can specify a namespaces property map that contain prefix/namespace mappings. Mind if you have a default namespace declared you should map it to some namespace, and reference it in the splitExpression property.

The splitter can optionally validate against an XML schema. By default schema validation is turned off.

You may reference an external schema from the classpath by using the externalSchemaLocation property.

Note that each part returned is actually returned as a new Document.


Field Summary
static String APACHE_XML_FEATURES_VALIDATION_SCHEMA
           
static String APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING
           
protected  String externalSchemaLocation
           
static String JAXP_PROPERTIES_SCHEMA_LANGUAGE
           
static String JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE
           
static String JAXP_PROPERTIES_SCHEMA_SOURCE
           
protected  Map namespaces
           
protected static ThreadLocal nodesContext
           
protected static ThreadLocal propertiesContext
           
protected  String splitExpression
           
protected  boolean validateSchema
           
 
Fields inherited from class org.mule.routing.outbound.AbstractMessageSplitter
honorSynchronicity, multimatch
 
Fields inherited from class org.mule.routing.outbound.AbstractOutboundRouter
ENABLE_CORRELATION_ALWAYS, ENABLE_CORRELATION_IF_NOT_SET, ENABLE_CORRELATION_NEVER, enableCorrelation, endpoints, logger, propertyExtractor, replyTo, transactionConfig
 
Constructor Summary
FilteringXmlMessageSplitter()
           
 
Method Summary
 String getExternalSchemaLocation()
           
protected  UMOMessage getMessagePart(UMOMessage message, UMOEndpoint endpoint)
          Retrieves a specific message part for the given endpoint.
 String getSplitExpression()
           
protected  void initialise(UMOMessage message)
          Template method can be used to split the message up before the getMessagePart method is called .
 boolean isValidateSchema()
           
protected  void setDoSchemaValidation(org.dom4j.io.SAXReader reader, boolean validate)
           
 void setExternalSchemaLocation(String externalSchemaLocation)
          Set classpath location of the XSD to check against.
 void setNamespaces(Map namespaces)
           
 void setSplitExpression(String splitExpression)
           
 void setValidateSchema(boolean validateSchema)
           
 
Methods inherited from class org.mule.routing.outbound.AbstractMessageSplitter
isHonorSynchronicity, route, setHonorSynchronicity
 
Methods inherited from class org.mule.routing.outbound.FilteringOutboundRouter
addEndpoint, getEndpoint, getFilter, getTransformer, isMatch, isUseTemplates, setFilter, setTransformer, setUseTemplates
 
Methods inherited from class org.mule.routing.outbound.AbstractOutboundRouter
dispatch, getEnableCorrelation, getEndpoints, getPropertyExtractor, getReplyTo, getTransactionConfig, isDynamicEndpoints, removeEndpoint, send, setEnableCorrelation, setEnableCorrelationAsString, setEndpoints, setMessageProperties, setPropertyExtractor, setPropertyExtractorAsString, setReplyTo, setTransactionConfig
 
Methods inherited from class org.mule.routing.AbstractRouter
getRouterStatistics, setRouterStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.umo.routing.UMORouter
getRouterStatistics, setRouterStatistics
 

Field Detail

APACHE_XML_FEATURES_VALIDATION_SCHEMA

public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA
See Also:
Constant Field Values

APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING

public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING
See Also:
Constant Field Values

JAXP_PROPERTIES_SCHEMA_SOURCE

public static final String JAXP_PROPERTIES_SCHEMA_SOURCE
See Also:
Constant Field Values

JAXP_PROPERTIES_SCHEMA_LANGUAGE

public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE
See Also:
Constant Field Values

JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE

public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE
See Also:
Constant Field Values

propertiesContext

protected static final ThreadLocal propertiesContext

nodesContext

protected static final ThreadLocal nodesContext

splitExpression

protected volatile String splitExpression

namespaces

protected volatile Map namespaces

validateSchema

protected volatile boolean validateSchema

externalSchemaLocation

protected volatile String externalSchemaLocation
Constructor Detail

FilteringXmlMessageSplitter

public FilteringXmlMessageSplitter()
Method Detail

setSplitExpression

public void setSplitExpression(String splitExpression)

setNamespaces

public void setNamespaces(Map namespaces)

getSplitExpression

public String getSplitExpression()

isValidateSchema

public boolean isValidateSchema()

setValidateSchema

public void setValidateSchema(boolean validateSchema)

getExternalSchemaLocation

public String getExternalSchemaLocation()

setExternalSchemaLocation

public void setExternalSchemaLocation(String externalSchemaLocation)
Set classpath location of the XSD to check against. If the resource cannot be found, an exception will be thrown at runtime.

Parameters:
externalSchemaLocation - location of XSD

initialise

protected void initialise(UMOMessage message)
Template method can be used to split the message up before the getMessagePart method is called .

Overrides:
initialise in class AbstractMessageSplitter
Parameters:
message - the message being routed

getMessagePart

protected UMOMessage getMessagePart(UMOMessage message,
                                    UMOEndpoint endpoint)
Retrieves a specific message part for the given endpoint. the message will then be routed via the provider.

Specified by:
getMessagePart in class AbstractMessageSplitter
Parameters:
message - the current message being processed
endpoint - the endpoint that will be used to route the resulting message part
Returns:
the message part to dispatch

setDoSchemaValidation

protected void setDoSchemaValidation(org.dom4j.io.SAXReader reader,
                                     boolean validate)
                              throws Exception
Throws:
Exception


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.