Package org.apache.camel.processor
Class ContractAdvice
- java.lang.Object
-
- org.apache.camel.processor.ContractAdvice
-
- All Implemented Interfaces:
org.apache.camel.spi.CamelInternalProcessorAdvice
public class ContractAdvice extends Object implements org.apache.camel.spi.CamelInternalProcessorAdvice
ACamelInternalProcessorAdvice
which appliesTransformer
andValidator
according to the data type Contract. The default camelMessage
implementsDataTypeAware
which holds aDataType
to indicate current message type. If the input type declared byorg.apache.camel.model.InputTypeDefinition
is different from current IN message type, camel internal processor look for a Transformer which transforms from the current message type to the expected message type before routing. After routing, if the output type declared byorg.apache.camel.model.OutputTypeDefinition
is different from current OUT message (or IN message if no OUT), camel look for a Transformer and apply.- See Also:
Transformer
,Validator
,org.apache.camel.model.InputTypeDefinition
,org.apache.camel.model.OutputTypeDefinition
-
-
Constructor Summary
Constructors Constructor Description ContractAdvice(org.apache.camel.spi.Contract contract)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
after(org.apache.camel.Exchange exchange, Object data)
Object
before(org.apache.camel.Exchange exchange)
boolean
hasState()
-
-
-
Method Detail
-
before
public Object before(org.apache.camel.Exchange exchange) throws Exception
- Specified by:
before
in interfaceorg.apache.camel.spi.CamelInternalProcessorAdvice
- Throws:
Exception
-
after
public void after(org.apache.camel.Exchange exchange, Object data) throws Exception
- Specified by:
after
in interfaceorg.apache.camel.spi.CamelInternalProcessorAdvice
- Throws:
Exception
-
hasState
public boolean hasState()
- Specified by:
hasState
in interfaceorg.apache.camel.spi.CamelInternalProcessorAdvice
-
-