Interface PooledExchangeTaskFactory

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.camel.spi.PooledObjectFactory

        org.apache.camel.spi.PooledObjectFactory.Statistics
    • 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
      • 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 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 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.