Package org.apache.camel.processor
Class PrototypeTaskFactory
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.PrototypeObjectFactorySupport<PooledExchangeTask>
org.apache.camel.processor.PrototypeTaskFactory
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,PooledExchangeTaskFactory,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public abstract class PrototypeTaskFactory
extends org.apache.camel.support.PrototypeObjectFactorySupport<PooledExchangeTask>
implements PooledExchangeTaskFactory
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.camel.support.PrototypeObjectFactorySupport
org.apache.camel.support.PrototypeObjectFactorySupport.UtilizationStatisticsNested classes/interfaces inherited from interface org.apache.camel.spi.PooledObjectFactory
org.apache.camel.spi.PooledObjectFactory.Statistics -
Field Summary
Fields inherited from class org.apache.camel.support.PrototypeObjectFactorySupport
camelContext, statistics, statisticsEnabledFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacquire()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.booleanrelease(PooledExchangeTask task) Releases the task after its done being usedtoString()Methods inherited from class org.apache.camel.support.PrototypeObjectFactorySupport
doShutdown, getCamelContext, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCamelContext, setCapacity, setStatisticsEnabledMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.CamelContextAware
setCamelContextMethods inherited from interface org.apache.camel.spi.HasCamelContext
getCamelContextMethods inherited from interface org.apache.camel.processor.PooledExchangeTaskFactory
createMethods inherited from interface org.apache.camel.spi.PooledObjectFactory
getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCapacity, setStatisticsEnabledMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
PrototypeTaskFactory
public PrototypeTaskFactory()
-
-
Method Details
-
acquire
public PooledExchangeTask acquire(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback) Description copied from interface:PooledExchangeTaskFactoryAttempts to acquire a pooled task to use for processing the exchange, if not possible then a new task is created.- Specified by:
acquirein interfacePooledExchangeTaskFactory- Parameters:
exchange- the current exchangecallback- the callback for the exchange- Returns:
- the task
-
acquire
- Specified by:
acquirein interfaceorg.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
-
release
Description copied from interface:PooledExchangeTaskFactoryReleases the task after its done being used- Specified by:
releasein interfacePooledExchangeTaskFactory- Specified by:
releasein 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.
-
toString
-