Public Member Functions | |
DNSStatefulObjectSemaphore (String name) | |
void | signalEvent () |
String | toString () |
void | waitForEvent (long timeout) |
Private Attributes | |
final String | _name |
final ConcurrentMap< Thread, Semaphore > | _semaphores |
Static Private Attributes | |
static Logger | logger = Logger.getLogger(DNSStatefulObjectSemaphore.class.getName()) |
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 java.util.concurrent.Semaphore so that they can be released by the timeout timer.
Definition at line 32 of file DNSStatefulObject.java.
javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore.DNSStatefulObjectSemaphore | ( | String | name | ) | [inline] |
name | Semaphore name for debugging purposes. |
Definition at line 43 of file DNSStatefulObject.java.
Signals the semaphore when the event arrives.
Definition at line 74 of file DNSStatefulObject.java.
String javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore.toString | ( | ) | [inline] |
Definition at line 83 of file DNSStatefulObject.java.
void javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore.waitForEvent | ( | long | timeout | ) | [inline] |
Blocks the current thread until the event arrives or the timeout expires.
timeout | wait period for the event |
Definition at line 55 of file DNSStatefulObject.java.
final String javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore._name [private] |
Definition at line 35 of file DNSStatefulObject.java.
final ConcurrentMap<Thread, Semaphore> javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore._semaphores [private] |
Definition at line 37 of file DNSStatefulObject.java.
Logger javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore.logger = Logger.getLogger(DNSStatefulObjectSemaphore.class.getName()) [static, private] |
Definition at line 33 of file DNSStatefulObject.java.