Class ThreadLocker


  • public class ThreadLocker
    extends Object
    This class can be used to verify the number of threads that are calling a particular method. This is achieved by locking all of the threads that call MessageProducer#send and providing a callback (via a CompletableFuture) that is invoked once the desired number of threads is reached. If a larger number of threads than expected call MessageProducer#send, these are locked as well, and the number of these is provided by getNumExtraThreadsWaiting().
    Author:
    jwhite
    • Constructor Detail

      • ThreadLocker

        public ThreadLocker()
    • Method Detail

      • park

        public void park()
      • release

        public void release()
      • getNumExtraThreadsWaiting

        public int getNumExtraThreadsWaiting()