|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.framework.util.ThreadGate
public class ThreadGate
This class implements a simple one-shot gate for threads. The gate starts closed and will block any threads that try to wait on it. Once opened, all waiting threads will be released. The gate cannot be reused.
Constructor Summary | |
---|---|
ThreadGate()
|
Method Summary | |
---|---|
boolean |
await(long timeout)
Wait for the gate to open. |
Object |
getMessage()
Returns the message object associated with the gate; the message is just an arbitrary object used to pass information to the waiting threads. |
void |
open()
Open the gate and release any waiting threads. |
void |
setMessage(Object msg)
Sets the message object associated with the gate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadGate()
Method Detail |
---|
public void open()
public Object getMessage()
public void setMessage(Object msg)
msg
- the message object to associate with this gate.public boolean await(long timeout) throws InterruptedException
InterruptedException
- If the calling thread is interrupted;
the gate still remains closed until opened.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |