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 createPooledExchangeTask
.- See Also:
PooledExchangeTask
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.PooledExchangeTask
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 used-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
-
-
-
Method Detail
-
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
boolean release(PooledExchangeTask task)
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.
-
-