Interface PooledExchangeTaskFactory

All Superinterfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.spi.HasCamelContext, 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 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.
    create(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
    Creates a new task to use for processing the exchange.
    boolean
    Releases the task after its done being used

    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.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 exchange
      callback - 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 exchange
      callback - 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 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.