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.UtilizationStatistics

    Nested 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, statisticsEnabled

    Fields 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    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
    Releases the task after its done being used
     

    Methods inherited from class org.apache.camel.support.PrototypeObjectFactorySupport

    doShutdown, getCamelContext, getCapacity, getSize, getStatistics, isPooled, isStatisticsEnabled, purge, resetStatistics, setCamelContext, setCapacity, setStatisticsEnabled

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, 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

    setCamelContext

    Methods inherited from interface org.apache.camel.spi.HasCamelContext

    getCamelContext

    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

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods 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: 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 interface PooledExchangeTaskFactory
      Parameters:
      exchange - the current exchange
      callback - the callback for the exchange
      Returns:
      the task
    • acquire

      public PooledExchangeTask acquire()
      Specified by:
      acquire in interface org.apache.camel.spi.PooledObjectFactory<PooledExchangeTask>
    • release

      public boolean release(PooledExchangeTask task)
      Description copied from interface: PooledExchangeTaskFactory
      Releases the task after its done being used
      Specified by:
      release in interface PooledExchangeTaskFactory
      Specified by:
      release in interface org.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

      public String toString()
      Overrides:
      toString in class Object