|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.clients.spooler.Signal
final class Signal
This class is a monitor object. Its primary use is for the socket reader to awaken the socket writer. It has a secondary use. The socket writer tells the socket reader that it has terminated.
Note that the implementation uses two unlocking mechanisms. The counters are used when the reader is not yet waiting to receive. It prevents a deadlock.
Field Summary | |
---|---|
private int |
receiveCount
|
private int |
sendCount
|
private boolean |
socketWriterTerminated
|
Constructor Summary | |
---|---|
Signal()
|
Method Summary | |
---|---|
(package private) boolean |
isTerminated()
Has the socket writer terminated? |
(package private) void |
receive()
The socket writer tests for a signal and waits if there is none. |
(package private) void |
send()
The socket reader signals the socket writer that data is available. |
(package private) void |
terminate()
The socket writer signals that it is no longer sending data to the output socket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private volatile int sendCount
private volatile int receiveCount
private boolean socketWriterTerminated
Constructor Detail |
---|
Signal()
Method Detail |
---|
void send()
void receive() throws java.lang.InterruptedException
java.lang.InterruptedException
final void terminate()
final boolean isTerminated()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |