public class Exchanges extends Object
Exchange
s.Constructor and Description |
---|
Exchanges() |
Modifier and Type | Method and Description |
---|---|
static void |
copyExchange(org.apache.camel.Exchange source,
org.apache.camel.Exchange target)
Copies the
source exchange to target exchange
preserving the ExchangePattern of target . |
static void |
copyInput(org.apache.camel.Exchange exchange)
Copies the exchange's in-message to the out-message if the exchange
pattern is
ExchangePattern.InOut . |
static org.apache.camel.Exchange |
createExchange(org.apache.camel.CamelContext context,
org.apache.camel.ExchangePattern pattern)
Creates a new
Exchange instance using context . |
static org.apache.camel.Exchange |
createExchange(org.apache.camel.Exchange source,
org.apache.camel.ExchangePattern pattern)
Creates a new
Exchange instance from the given
exchange . |
static Exception |
extractException(org.apache.camel.Exchange exchange)
Extracts the exception handled while processing the given
exchange (if any), and marks the exchange as non-failed.
|
static Exception |
extractException(org.apache.camel.Exchange exchange,
boolean cleanup)
Extracts the exception handled while processing the given
exchange (if any), and optionally marks the exchange as non-failed.
|
static org.apache.camel.Message |
prepareResult(org.apache.camel.Exchange exchange)
Returns the message where to write results.
|
static org.apache.camel.ProducerTemplate |
producerTemplate(org.apache.camel.Exchange exchange)
Creates a
ProducerTemplate from the given Exchange |
static org.apache.camel.Message |
resultMessage(org.apache.camel.Exchange exchange)
Returns the message where to write results.
|
public static org.apache.camel.ProducerTemplate producerTemplate(org.apache.camel.Exchange exchange)
ProducerTemplate
from the given Exchange
exchange
- message exchange.public static org.apache.camel.Message resultMessage(org.apache.camel.Exchange exchange)
exchange
- message exchange.public static org.apache.camel.Message prepareResult(org.apache.camel.Exchange exchange)
exchange
- message exchange.public static org.apache.camel.Exchange createExchange(org.apache.camel.Exchange source, org.apache.camel.ExchangePattern pattern)
Exchange
instance from the given
exchange
. The resulting exchange's pattern is defined by
pattern
.source
- exchange to copy from.pattern
- exchange pattern to set.public static org.apache.camel.Exchange createExchange(org.apache.camel.CamelContext context, org.apache.camel.ExchangePattern pattern)
Exchange
instance using context
.
The resulting exchange's pattern is defined by pattern
.context
- Camel context.pattern
- exchange pattern.public static void copyInput(org.apache.camel.Exchange exchange)
ExchangePattern.InOut
.exchange
- message exchange.public static void copyExchange(org.apache.camel.Exchange source, org.apache.camel.Exchange target)
source
exchange to target
exchange
preserving the ExchangePattern
of target
.source
- source exchange.target
- target exchange.resultMessage(Exchange)
public static Exception extractException(org.apache.camel.Exchange exchange, boolean cleanup)
exchange
- Camel exchange, should be not null
.cleanup
- true
iff the information about the occurred exception
should be removed from the given exchange.Exception
instance, or null
when no exception was handled.public static Exception extractException(org.apache.camel.Exchange exchange)
This method corresponds to extractException(org.apache.camel.Exchange, boolean)
with the second parameter set to true
.
exchange
- Camel exchange, should be not null
.Exception
instance, or null
when no exception was handled.Copyright © 2018 Open eHealth Foundation. All rights reserved.