Interface ProcessorExchangeFactory
- All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, HasId, IdAware, NonManagedService, PooledObjectFactory<Exchange>, RouteIdAware, Service
public interface ProcessorExchangeFactory
extends PooledObjectFactory<Exchange>, NonManagedService, RouteIdAware, IdAware
Factory used by
Processor implementations (EIPs) when they create copies of the current
Exchange for sub-routing.
EIPs such as WireTap, Multicast, and Splitter each create one or more derived exchanges (copies or correlated copies)
to fan out processing. This factory gives those EIPs the same exchange-pooling benefit as ExchangeFactory
gives to consumers, without conflating the two lifecycle boundaries.
Like ExchangeFactory, this factory is pluggable:
- default — creates a new
Exchangecopy per sub-routing invocation. - pooled — reuses
PooledExchangeinstances, recycling them after the sub-exchange completes its portion of the route.
ProcessorExchangeFactory instance via
newProcessorExchangeFactory(org.apache.camel.Processor).- Since:
- 3.10
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface PooledObjectFactory
PooledObjectFactory.Statistics -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreate(Endpoint fromEndpoint, ExchangePattern exchangePattern) Gets a newExchangecreateCopy(Exchange exchange) Gets a copy of the givenExchangecreateCorrelatedCopy(Exchange exchange, boolean handover) Gets a copy of the givenExchangeand the copy is correlated to the sourceThe processor using this factory.newProcessorExchangeFactory(Processor processor) Creates a newProcessorExchangeFactorythat is private for the given consumer.booleanReleases the exchange back into the poolMethods inherited from interface CamelContextAware
setCamelContextMethods inherited from interface HasCamelContext
getCamelContextMethods inherited from interface IdAware
setGeneratedId, setIdMethods inherited from interface PooledObjectFactory
acquire, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCapacity, setStatisticsEnabledMethods inherited from interface RouteIdAware
getRouteId, setRouteId
-
Field Details
-
FACTORY
-
-
Method Details
-
getProcessor
Processor getProcessor()The processor using this factory. -
newProcessorExchangeFactory
Creates a newProcessorExchangeFactorythat is private for the given consumer.- Parameters:
processor- the processor that will use the createdProcessorExchangeFactory- Returns:
- the created factory.
-
createCopy
-
create
Gets a newExchange -
release
Releases the exchange back into the pool- Specified by:
releasein interfacePooledObjectFactory<Exchange>- Parameters:
exchange- the exchange- Returns:
- true if released into the pool, or false if something went wrong and the exchange was discarded
-