Class DefaultProducerCache

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.cache.DefaultProducerCache
All Implemented Interfaces:
AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.ProducerCache, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
Direct Known Subclasses:
EmptyProducerCache

public class DefaultProducerCache extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.ProducerCache
Default implementation of ProducerCache.
  • Nested Class Summary

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

    org.apache.camel.spi.ProducerCache.AsyncProducerCallback
  • Field Summary

    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
    DefaultProducerCache(Object source, org.apache.camel.CamelContext camelContext, int cacheSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.AsyncProducer
    acquireProducer(org.apache.camel.Endpoint endpoint)
     
    protected boolean
    asyncDispatchExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.AsyncProducer producer, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
     
    CompletableFuture<org.apache.camel.Exchange>
    asyncSendExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.ExchangePattern pattern, org.apache.camel.Processor processor, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, CompletableFuture<org.apache.camel.Exchange> future)
     
    void
     
    createServicePool(org.apache.camel.CamelContext camelContext, int cacheSize)
     
    protected CompletableFuture<org.apache.camel.Exchange>
    doAsyncSendExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.Processor processor, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, CompletableFuture<org.apache.camel.Exchange> f)
     
    protected void
     
    boolean
    doInAsyncProducer(org.apache.camel.Endpoint endpoint, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, org.apache.camel.spi.ProducerCache.AsyncProducerCallback producerCallback)
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    org.apache.camel.CamelContext
     
    int
     
    org.apache.camel.spi.EndpointUtilizationStatistics
     
     
    boolean
     
    boolean
     
    void
     
    void
    releaseProducer(org.apache.camel.Endpoint endpoint, org.apache.camel.AsyncProducer producer)
     
    org.apache.camel.Exchange
    send(org.apache.camel.Endpoint endpoint, org.apache.camel.Exchange exchange, org.apache.camel.Processor resultProcessor)
     
    void
    setEventNotifierEnabled(boolean eventNotifierEnabled)
     
    void
    setExtendedStatistics(boolean extendedStatistics)
    Whether extended JMX statistics is enabled for EndpointUtilizationStatistics
    int
     
     

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

    build, doFail, doLifecycleChange, doResume, doSuspend, fail, getInternalLock, 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.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

    • DefaultProducerCache

      public DefaultProducerCache(Object source, org.apache.camel.CamelContext camelContext, int cacheSize)
  • Method Details

    • createServicePool

      protected ProducerServicePool createServicePool(org.apache.camel.CamelContext camelContext, int cacheSize)
    • isEventNotifierEnabled

      public boolean isEventNotifierEnabled()
      Specified by:
      isEventNotifierEnabled in interface org.apache.camel.spi.ProducerCache
    • setEventNotifierEnabled

      public void setEventNotifierEnabled(boolean eventNotifierEnabled)
      Specified by:
      setEventNotifierEnabled in interface org.apache.camel.spi.ProducerCache
    • isExtendedStatistics

      public boolean isExtendedStatistics()
    • setExtendedStatistics

      public void setExtendedStatistics(boolean extendedStatistics)
      Whether extended JMX statistics is enabled for EndpointUtilizationStatistics
    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
    • getSource

      public Object getSource()
      Specified by:
      getSource in interface org.apache.camel.spi.ProducerCache
    • acquireProducer

      public org.apache.camel.AsyncProducer acquireProducer(org.apache.camel.Endpoint endpoint)
      Specified by:
      acquireProducer in interface org.apache.camel.spi.ProducerCache
    • releaseProducer

      public void releaseProducer(org.apache.camel.Endpoint endpoint, org.apache.camel.AsyncProducer producer)
      Specified by:
      releaseProducer in interface org.apache.camel.spi.ProducerCache
    • send

      public org.apache.camel.Exchange send(org.apache.camel.Endpoint endpoint, org.apache.camel.Exchange exchange, org.apache.camel.Processor resultProcessor)
      Specified by:
      send in interface org.apache.camel.spi.ProducerCache
    • asyncSendExchange

      public CompletableFuture<org.apache.camel.Exchange> asyncSendExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.ExchangePattern pattern, org.apache.camel.Processor processor, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, CompletableFuture<org.apache.camel.Exchange> future)
      Specified by:
      asyncSendExchange in interface org.apache.camel.spi.ProducerCache
    • doAsyncSendExchange

      protected CompletableFuture<org.apache.camel.Exchange> doAsyncSendExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.Processor processor, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, CompletableFuture<org.apache.camel.Exchange> f)
    • doInAsyncProducer

      public boolean doInAsyncProducer(org.apache.camel.Endpoint endpoint, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, org.apache.camel.spi.ProducerCache.AsyncProducerCallback producerCallback)
      Specified by:
      doInAsyncProducer in interface org.apache.camel.spi.ProducerCache
    • asyncDispatchExchange

      protected boolean asyncDispatchExchange(org.apache.camel.Endpoint endpoint, org.apache.camel.AsyncProducer producer, org.apache.camel.Processor resultProcessor, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
    • doBuild

      protected void doBuild() throws Exception
      Overrides:
      doBuild in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doShutdown

      protected void doShutdown() throws Exception
      Overrides:
      doShutdown in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • size

      public int size()
      Specified by:
      size in interface org.apache.camel.spi.ProducerCache
    • getCapacity

      public int getCapacity()
      Specified by:
      getCapacity in interface org.apache.camel.spi.ProducerCache
    • purge

      public void purge()
      Specified by:
      purge in interface org.apache.camel.spi.ProducerCache
    • cleanUp

      public void cleanUp()
      Specified by:
      cleanUp in interface org.apache.camel.spi.ProducerCache
    • getEndpointUtilizationStatistics

      public org.apache.camel.spi.EndpointUtilizationStatistics getEndpointUtilizationStatistics()
      Specified by:
      getEndpointUtilizationStatistics in interface org.apache.camel.spi.ProducerCache
    • toString

      public String toString()
      Overrides:
      toString in class Object