LocalTaskQueueTestConfig.TaskCountDownLatch

com.google.appengine.tools.development.testing

Class LocalTaskQueueTestConfig.TaskCountDownLatch

  • java.lang.Object
    • java.util.concurrent.CountDownLatch
      • com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig.TaskCountDownLatch
  • Enclosing class:
    LocalTaskQueueTestConfig


    public static final class LocalTaskQueueTestConfig.TaskCountDownLatch
    extends java.util.concurrent.CountDownLatch
    A CountDownLatch extension that can be reset. Pass an instance of this class to LocalTaskQueueTestConfig#setTaskExecutionLatch) when you need to reuse the latch within or across tests. Only one thread at a time should ever call any of the await() or reset() methods.
    • Constructor Detail

      • TaskCountDownLatch

        public TaskCountDownLatch(int count)
    • Method Detail

      • getCount

        public long getCount()
        Overrides:
        getCount in class java.util.concurrent.CountDownLatch
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.CountDownLatch
      • await

        public void await()
                   throws java.lang.InterruptedException
        Overrides:
        await in class java.util.concurrent.CountDownLatch
        Throws:
        java.lang.InterruptedException
      • await

        public boolean await(long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Overrides:
        await in class java.util.concurrent.CountDownLatch
        Throws:
        java.lang.InterruptedException
      • countDown

        public void countDown()
        Overrides:
        countDown in class java.util.concurrent.CountDownLatch
      • awaitAndReset

        public void awaitAndReset()
                           throws java.lang.InterruptedException
        Shorthand for calling await() followed by reset(). Only one thread at a time should call this.
        Throws:
        java.lang.InterruptedException
      • awaitAndReset

        public void awaitAndReset(int count)
                           throws java.lang.InterruptedException
        Shorthand for calling await() followed by reset(int). Only one thread at a time should call this.
        Throws:
        java.lang.InterruptedException
      • awaitAndReset

        public boolean awaitAndReset(long timeout,
                                     java.util.concurrent.TimeUnit unit)
                              throws java.lang.InterruptedException
        Shorthand for calling await(long, java.util.concurrent.TimeUnit) followed by reset(). Only one thread at a time should call this.
        Throws:
        java.lang.InterruptedException
      • awaitAndReset

        public boolean awaitAndReset(long timeout,
                                     java.util.concurrent.TimeUnit unit,
                                     int count)
                              throws java.lang.InterruptedException
        Shorthand for calling await(long, java.util.concurrent.TimeUnit) followed by reset(int). Only one thread at a time should call this.
        Throws:
        java.lang.InterruptedException
      • reset

        public void reset()
        Resets the latch to its most recent initial count. Only one thread at a time should call this.
      • reset

        public void reset(int count)
        Resets the latch to the provided count. Only one thread at a time should call this.