public interface ProcessorExchangeFactory extends PooledObjectFactory<Exchange>, NonManagedService, RouteIdAware, IdAware
Processor
(EIPs) when they create copies of the processed Exchange
.
Some EIPs like WireTap, Multicast, Split etc creates copies of the processed exchange which they use as sub
exchanges. This factory allows to use exchange pooling.
The factory is pluggable which allows to use different strategies. The default factory will create a new
Exchange
instance, and the pooled factory will pool and reuse exchanges.ExchangeFactory
,
PooledExchange
PooledObjectFactory.Statistics
Modifier and Type | Field and Description |
---|---|
static String |
FACTORY
Service factory key.
|
Modifier and Type | Method and Description |
---|---|
Exchange |
create(Endpoint fromEndpoint,
ExchangePattern exchangePattern)
Gets a new
Exchange |
Exchange |
createCopy(Exchange exchange)
Gets a copy of the given
Exchange |
Exchange |
createCorrelatedCopy(Exchange exchange,
boolean handover)
Gets a copy of the given
Exchange the the copy is correlated to the source |
Processor |
getProcessor()
The processor using this factory.
|
ProcessorExchangeFactory |
newProcessorExchangeFactory(Processor processor)
Creates a new
ProcessorExchangeFactory that is private for the given consumer. |
boolean |
release(Exchange exchange)
Releases the exchange back into the pool
|
acquire, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCapacity, setStatisticsEnabled
getCamelContext, setCamelContext, trySetCamelContext
getRouteId, setRouteId
setGeneratedId, setId
static final String FACTORY
Processor getProcessor()
ProcessorExchangeFactory newProcessorExchangeFactory(Processor processor)
ProcessorExchangeFactory
that is private for the given consumer.processor
- the processor that will use the created ProcessorExchangeFactory
Exchange createCopy(Exchange exchange)
Exchange
exchange
- original exchangeExchange createCorrelatedCopy(Exchange exchange, boolean handover)
Exchange
the the copy is correlated to the sourceexchange
- original exchangehandover
- whether the on completion callbacks should be handed over to the new copy.Exchange create(Endpoint fromEndpoint, ExchangePattern exchangePattern)
Exchange
boolean release(Exchange exchange)
release
in interface PooledObjectFactory<Exchange>
exchange
- the exchangeApache Camel