|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.thread.InProgress
public class InProgress
This class provides a blocking mechanism that will not proceed while
some operation bounded by this object is in progress. The thread
performing the operation invokes start
and
stop
on this object when it starts and stops the
operation in progress. The thread that wants to block itself while
the operation is in progress invokes waitWhileStarted
,
which will block if start
has been invoked without a
matching stop
. The block will continue until a
matching stop
is invoked. Each start
adds
one to the number of operations; each stop
subtracts
one. When the number of operations is zero, the operation bounded
by this object is not in progress, and waitWhileStarted
will return.
The operation can also be blocked by invoking block
and
unblock
, which nest like start
and
stop
. When a block
is invoked on this
object, no start
will proceed until the matching
unblock
call is made. The reverse is also true: when a
stop
call has been made on this object, no
block
call will proceed until the matching
stop
call is made. A waitUntilUnblocked
method allows selective waiting for the unblocked state without
invoking start
.
A waitUntilQuiet
call waits until the object is neither
blocked nor stopped.
Constructor Summary | |
---|---|
InProgress(String name)
|
Method Summary | |
---|---|
void |
block()
Signal the blocking of the operation this object bounds. |
boolean |
blocked()
Return true if at least one block has been
invoked without its corresponding unblock . |
void |
debug(boolean debugOn)
Set the debug mode on or off. |
boolean |
inProgress()
Return true if at least one start has been
invoked without its corresponding stop . |
void |
start()
Signal the start of the operation this object bounds. |
void |
stop()
Signal the stop of the operation this object bounds. |
void |
unblock()
Signal the unblocking of the operation this object bounds. |
void |
waitUntilQuiet()
Wait if the operation bounded by this object is either started or blocked. |
void |
waitWhileBlocked()
Wait if the operation bounded by this object has been blocked, i.e., between a block and a unblock . |
void |
waitWhileStarted()
Wait if the operation bounded by this object is in progress, i.e., between a start and a stop . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InProgress(String name)
Method Detail |
---|
public void start() throws InterruptedException
InterruptedException
public void stop()
public boolean inProgress()
true
if at least one start
has been
invoked without its corresponding stop
.
public void waitWhileStarted() throws InterruptedException
start
and a stop
.
InterruptedException
public void block() throws InterruptedException
InterruptedException
public void unblock()
public boolean blocked()
true
if at least one block
has been
invoked without its corresponding unblock
.
public void waitWhileBlocked() throws InterruptedException
block
and a unblock
.
InterruptedException
public void waitUntilQuiet() throws InterruptedException
InterruptedException
public void debug(boolean debugOn)
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |