Package org.apache.camel.processor
Interface PooledExchangeTaskFactory
- All Superinterfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
,org.apache.camel.Service
- All Known Implementing Classes:
PooledTaskFactory
,PrototypeTaskFactory
public interface PooledExchangeTaskFactory
extends org.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
Factory to create
PooledExchangeTask
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.camel.spi.PooledObjectFactory
org.apache.camel.spi.PooledObjectFactory.Statistics
-
Method Summary
Modifier and TypeMethodDescriptionacquire
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Attempts to acquire a pooled task to use for processing the exchange, if not possible then a new task is created.create
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Creates a new task to use for processing the exchange.boolean
release
(PooledExchangeTask task) Releases the task after its done being usedMethods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
Methods inherited from interface org.apache.camel.spi.PooledObjectFactory
acquire, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCapacity, setStatisticsEnabled
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
-
Method Details
-
create
PooledExchangeTask create(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Creates a new task to use for processing the exchange.- Parameters:
exchange
- the current exchangecallback
- the callback for the exchange- Returns:
- the task
-
acquire
PooledExchangeTask acquire(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Attempts to acquire a pooled task to use for processing the exchange, if not possible then a new task is created.- Parameters:
exchange
- the current exchangecallback
- the callback for the exchange- Returns:
- the task
-
release
Releases the task after its done being used- Specified by:
release
in interfaceorg.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
- Parameters:
task
- the task- Returns:
- true if the task was released, and false if the task failed to be released or no space in pool, and the task was discarded.
-