de.esprit.common.concurrent

## Class Gate

- java.lang.Object
- - de.esprit.common.concurrent.Gate

-     public class Gate
      extends java.lang.Object

  This is a reentrant Gate that blocks awaiting threads until it is opened.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Gate()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `await()` Blocks until `signal()` is called
    `void` | `await(long millis)` Waits until `signal()` was called, but at longest for the given millis.
    `void` | `awaitTimingOut(long millis)` Waits until `signal()` was called, but throws a `TimeoutException` when the given maximum wait time is exceeded.
    `void` | `awaitUninterruptibly()` Blocks uninterruptibly until `signal()` was called
    `void` | `signal()` Releases all currently waiting threads

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Gate

          public Gate()

  - ### Method Detail

    - #### awaitUninterruptibly

          public void awaitUninterruptibly()

      Blocks uninterruptibly until `signal()` was called

    - #### await

          public void await(long millis)
                     throws java.lang.InterruptedException

      Waits until `signal()` was called, but at longest for the given millis.
      Throws:
        `java.lang.InterruptedException`

    - #### awaitTimingOut

          public void awaitTimingOut(long millis)
                              throws java.lang.InterruptedException,
                                     java.util.concurrent.TimeoutException

      Waits until `signal()` was called, but throws a `TimeoutException` when the given maximum wait time is exceeded.
      Throws:
        `InterruptedException,` - TimeoutException
        `java.lang.InterruptedException`
        `java.util.concurrent.TimeoutException`

    - #### await

          public void await()
                     throws java.lang.InterruptedException

      Blocks until `signal()` is called
      Throws:
        `java.lang.InterruptedException`

    - #### signal

          public void signal()

      Releases all currently waiting threads

Copyright © 2012 EsprIT-Systems. All Rights Reserved.