Package org.apache.camel.processor
Class PooledTaskFactory
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.PooledObjectFactorySupport<PooledExchangeTask>
-
- org.apache.camel.processor.PooledTaskFactory
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,PooledExchangeTaskFactory
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
public abstract class PooledTaskFactory extends org.apache.camel.support.PooledObjectFactorySupport<PooledExchangeTask> implements PooledExchangeTaskFactory
-
-
Constructor Summary
Constructors Constructor Description PooledTaskFactory()
PooledTaskFactory(Object source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PooledExchangeTask
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.boolean
release(PooledExchangeTask task)
Releases the task after its done being usedString
toString()
-
Methods inherited from class org.apache.camel.support.PooledObjectFactorySupport
doBuild, doShutdown, getCamelContext, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCamelContext, setCapacity, setStatisticsEnabled
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doInit, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Methods inherited from interface org.apache.camel.processor.PooledExchangeTaskFactory
create
-
Methods inherited from interface org.apache.camel.spi.PooledObjectFactory
getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCapacity, setStatisticsEnabled
-
-
-
-
Constructor Detail
-
PooledTaskFactory
public PooledTaskFactory()
-
PooledTaskFactory
public PooledTaskFactory(Object source)
-
-
Method Detail
-
acquire
public PooledExchangeTask acquire()
- Specified by:
acquire
in interfaceorg.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
-
acquire
public PooledExchangeTask acquire(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
Description copied from interface:PooledExchangeTaskFactory
Attempts to acquire a pooled task to use for processing the exchange, if not possible then a new task is created.- Specified by:
acquire
in interfacePooledExchangeTaskFactory
- Parameters:
exchange
- the current exchangecallback
- the callback for the exchange- Returns:
- the task
-
release
public boolean release(PooledExchangeTask task)
Description copied from interface:PooledExchangeTaskFactory
Releases the task after its done being used- Specified by:
release
in interfacePooledExchangeTaskFactory
- 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.
-
-