DNSStatefulObject.DNSStatefulObjectSemaphore
Date: 2017-02-10

javax.jmdns.impl

## Class DNSStatefulObject.DNSStatefulObjectSemaphore

- java.lang.Object
- - javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore

- Enclosing interface:
    DNSStatefulObject

      public static final class DNSStatefulObject.DNSStatefulObjectSemaphore
      extends java.lang.Object

  This class define a semaphore. On this multiple threads can wait the arrival of one event. Thread wait for a maximum defined by the timeout.

  Implementation note: this class is based on `Semaphore` so that they can be released by the timeout timer.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DNSStatefulObject.DNSStatefulObjectSemaphore(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `signalEvent()` Signals the semaphore when the event arrives.
    `java.lang.String` | `toString()`
    `void` | `waitForEvent(long timeout)` Blocks the current thread until the event arrives or the timeout expires.

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

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

- - ### Constructor Detail

    - #### DNSStatefulObject.DNSStatefulObjectSemaphore

          public DNSStatefulObject.DNSStatefulObjectSemaphore(java.lang.String name)

      Parameters:
        `name` - Semaphore name for debugging purposes.

  - ### Method Detail

    - #### waitForEvent

          public void waitForEvent(long timeout)

      Blocks the current thread until the event arrives or the timeout expires.
      Parameters:
        `timeout` - wait period for the event

    - #### signalEvent

          public void signalEvent()

      Signals the semaphore when the event arrives.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`