org.apache.servicemix.components.validation
Class ValidateComponent

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
                  extended by org.apache.servicemix.components.validation.ValidateComponent
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, javax.jbi.management.LifeCycleMBean, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider

public class ValidateComponent
extends TransformComponentSupport

This component performs a schema validation on the incoming document and returning a fault if the document does not conform to the schema otherwise the message is passed on its way.

Version:
$Revision: 2153 $

Field Summary
static String FAULT_FLOW
           
static String FAULT_JBI
           
 
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
ValidateComponent()
           
 
Method Summary
protected  void doValidation(Validator validator, DOMSource src, DOMResult result)
           
 MessageAwareErrorHandlerFactory getErrorHandlerFactory()
           
 String getHandlingErrorMethod()
           
 Schema getSchema()
           
 String getSchemaLanguage()
           
 org.springframework.core.io.Resource getSchemaResource()
           
 Source getSchemaSource()
           
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.
 void setErrorHandlerFactory(MessageAwareErrorHandlerFactory errorHandlerFactory)
           
 void setHandlingErrorMethod(String handlingErrorMethod)
           
 void setSchema(Schema schema)
           
 void setSchemaLanguage(String schemaLanguage)
           
 void setSchemaResource(org.springframework.core.io.Resource schemaResource)
           
 void setSchemaSource(Source schemaSource)
           
protected  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.TransformComponentSupport
copyPropertiesAndAttachments, getStore, getStoreFactory, 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, 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
 

Field Detail

FAULT_FLOW

public static final String FAULT_FLOW
See Also:
Constant Field Values

FAULT_JBI

public static final String FAULT_JBI
See Also:
Constant Field Values
Constructor Detail

ValidateComponent

public ValidateComponent()
Method Detail

getSchema

public Schema getSchema()

setSchema

public void setSchema(Schema schema)

getSchemaLanguage

public String getSchemaLanguage()

setSchemaLanguage

public void setSchemaLanguage(String schemaLanguage)

getSchemaSource

public Source getSchemaSource()

setSchemaSource

public void setSchemaSource(Source schemaSource)

getSchemaResource

public org.springframework.core.io.Resource getSchemaResource()

setSchemaResource

public void setSchemaResource(org.springframework.core.io.Resource schemaResource)

getErrorHandlerFactory

public MessageAwareErrorHandlerFactory getErrorHandlerFactory()

setErrorHandlerFactory

public void setErrorHandlerFactory(MessageAwareErrorHandlerFactory errorHandlerFactory)

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 TransformComponentSupport
Throws:
javax.jbi.JBIException

transform

protected boolean transform(javax.jbi.messaging.MessageExchange exchange,
                            javax.jbi.messaging.NormalizedMessage in,
                            javax.jbi.messaging.NormalizedMessage out)
                     throws javax.jbi.messaging.MessagingException
Description copied from class: TransformComponentSupport
Transforms the given out message

Specified by:
transform in class TransformComponentSupport
Throws:
javax.jbi.messaging.MessagingException

doValidation

protected void doValidation(Validator validator,
                            DOMSource src,
                            DOMResult result)
                     throws SAXException,
                            IOException
Throws:
SAXException
IOException

getHandlingErrorMethod

public String getHandlingErrorMethod()

setHandlingErrorMethod

public void setHandlingErrorMethod(String handlingErrorMethod)


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