Class DefaultAsyncProcessorAwaitManager

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.AsyncProcessorAwaitManager, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

    public class DefaultAsyncProcessorAwaitManager
    extends org.apache.camel.support.service.ServiceSupport
    implements org.apache.camel.spi.AsyncProcessorAwaitManager, org.apache.camel.StaticService
    • Nested Class Summary

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

        org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread, org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILDED, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTINGDOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void await​(org.apache.camel.Exchange exchange, CountDownLatch latch)  
      Collection<org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread> browse()  
      void countDown​(org.apache.camel.Exchange exchange, CountDownLatch latch)  
      protected void doStop()  
      org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics getStatistics()  
      void interrupt​(String exchangeId)  
      void interrupt​(org.apache.camel.Exchange exchange)  
      boolean isInterruptThreadsWhileStopping()  
      void process​(org.apache.camel.AsyncProcessor processor, org.apache.camel.Exchange exchange)
      Calls the async version of the processor's process method and waits for it to complete before returning.
      void setInterruptThreadsWhileStopping​(boolean interruptThreadsWhileStopping)  
      int size()  
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, 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 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 Detail

      • DefaultAsyncProcessorAwaitManager

        public DefaultAsyncProcessorAwaitManager()
    • Method Detail

      • process

        public void process​(org.apache.camel.AsyncProcessor processor,
                            org.apache.camel.Exchange exchange)
        Calls the async version of the processor's process method and waits for it to complete before returning. This can be used by AsyncProcessor objects to implement their sync version of the process method.

        Important: This method is discouraged to be used, as its better to invoke the asynchronous AsyncProcessor.process(org.apache.camel.Exchange, org.apache.camel.AsyncCallback) method, whenever possible.

        Specified by:
        process in interface org.apache.camel.spi.AsyncProcessorAwaitManager
        Parameters:
        processor - the processor
        exchange - the exchange
      • await

        public void await​(org.apache.camel.Exchange exchange,
                          CountDownLatch latch)
      • countDown

        public void countDown​(org.apache.camel.Exchange exchange,
                              CountDownLatch latch)
      • size

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

        public Collection<org.apache.camel.spi.AsyncProcessorAwaitManager.AwaitThread> browse()
        Specified by:
        browse in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • interrupt

        public void interrupt​(String exchangeId)
        Specified by:
        interrupt in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • interrupt

        public void interrupt​(org.apache.camel.Exchange exchange)
        Specified by:
        interrupt in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • isInterruptThreadsWhileStopping

        public boolean isInterruptThreadsWhileStopping()
        Specified by:
        isInterruptThreadsWhileStopping in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • setInterruptThreadsWhileStopping

        public void setInterruptThreadsWhileStopping​(boolean interruptThreadsWhileStopping)
        Specified by:
        setInterruptThreadsWhileStopping in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • getStatistics

        public org.apache.camel.spi.AsyncProcessorAwaitManager.Statistics getStatistics()
        Specified by:
        getStatistics in interface org.apache.camel.spi.AsyncProcessorAwaitManager
      • doStop

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