de.esprit.common.concurrent

## Class SimpleGate

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

- Direct Known Subclasses:
    ClientCommitGate

      public class SimpleGate
      extends java.lang.Object

  This is a one shot gate which is initially closed and can be opened opened once by calling `open()`.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleGate()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `await()` Waits for the gate to open.
    `boolean` | `await(long time, java.util.concurrent.TimeUnit unit)` Waits silently for the gate to open or the specified time to elapse.
    `void` | `awaitTimingOut(long time, java.util.concurrent.TimeUnit unit)` Same as `await()` but throws a `TimeoutException` if the gate was not opened in time.
    `void` | `awaitUninterruptibly()`
    `boolean` | `isOpen()`
    `void` | `open()`

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

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

- - ### Constructor Detail

    - #### SimpleGate

          public SimpleGate()

  - ### Method Detail

    - #### open

          public final void open()

    - #### isOpen

          public final boolean isOpen()

    - #### await

          public final void await()
                           throws java.lang.InterruptedException

      Waits for the gate to open.
      Throws:
        `java.lang.InterruptedException`

    - #### await

          public final boolean await(long time,
                      java.util.concurrent.TimeUnit unit)
                              throws java.lang.InterruptedException

      Waits silently for the gate to open or the specified time to elapse.
      Throws:
        `java.lang.InterruptedException`

    - #### awaitTimingOut

          public final void awaitTimingOut(long time,
                            java.util.concurrent.TimeUnit unit)
                                    throws java.lang.InterruptedException,
                                           java.util.concurrent.TimeoutException

      Same as `await()` but throws a `TimeoutException` if the gate was not opened in time.
      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.TimeoutException`

    - #### awaitUninterruptibly

          public final void awaitUninterruptibly()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.