Class Exchanges
java.lang.Object
org.openehealth.ipf.platform.camel.core.util.Exchanges
Utility related to Camel
Exchanges.- Author:
- Martin Krasser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyExchange(Exchange source, Exchange target) static voidCopies the exchange's in-message to the out-message if the exchange pattern isExchangePattern.InOut.static ExchangecreateExchange(CamelContext context, ExchangePattern pattern) Creates a newExchangeinstance usingcontext.static ExchangecreateExchange(Exchange source, ExchangePattern pattern) Creates a newExchangeinstance from the givenexchange.static ExceptionextractException(Exchange exchange) Extracts the exception handled while processing the given exchange (if any), and marks the exchange as non-failed.static ExceptionextractException(Exchange exchange, boolean cleanup) Extracts the exception handled while processing the given exchange (if any), and optionally marks the exchange as non-failed.static MessageprepareResult(Exchange exchange) Returns the message where to write results.static ProducerTemplateproducerTemplate(Exchange exchange) Creates aProducerTemplatefrom the givenExchange
-
Constructor Details
-
Exchanges
public Exchanges()
-
-
Method Details
-
producerTemplate
Creates aProducerTemplatefrom the givenExchange- Parameters:
exchange- message exchange.- Returns:
- a producer template.
-
prepareResult
Returns the message where to write results. This method copies the in-message to the out-message if the exchange is out-capable.- Parameters:
exchange- message exchange.- Returns:
- result message.
-
createExchange
Creates a newExchangeinstance from the givenexchange. The resulting exchange's pattern is defined bypattern.- Parameters:
source- exchange to copy from.pattern- exchange pattern to set.- Returns:
- created exchange.
-
createExchange
Creates a newExchangeinstance usingcontext. The resulting exchange's pattern is defined bypattern.- Parameters:
context- Camel context.pattern- exchange pattern.- Returns:
- created exchange.
-
copyInput
Copies the exchange's in-message to the out-message if the exchange pattern isExchangePattern.InOut.- Parameters:
exchange- message exchange.
-
copyExchange
- Parameters:
source- source exchange.target- target exchange.
-
extractException
Extracts the exception handled while processing the given exchange (if any), and optionally marks the exchange as non-failed.- Parameters:
exchange- Camel exchange, should be notnull.cleanup-trueiff the information about the occurred exception should be removed from the given exchange.- Returns:
- an
Exceptioninstance, ornullwhen no exception was handled.
-
extractException
Extracts the exception handled while processing the given exchange (if any), and marks the exchange as non-failed.This method corresponds to
extractException(org.apache.camel.Exchange, boolean)with the second parameter set totrue.- Parameters:
exchange- Camel exchange, should be notnull.- Returns:
- an
Exceptioninstance, ornullwhen no exception was handled.
-