|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.logicalcobwebs.proxool.ResultMonitor
public abstract class ResultMonitor
Waits for a set of results to become true with timeout functionality
Field Summary | |
---|---|
private int |
delay
|
private static Log |
LOG
|
private int |
result
|
static int |
SUCCESS
The result has happened |
private long |
timeout
Seems awfully long, but it seems to need it. |
static int |
TIMEOUT
There was a timeout waiting for the result to happen |
static int |
WAITING
This monitor is still waiting for the result to come true |
Constructor Summary | |
---|---|
ResultMonitor()
|
Method Summary | |
---|---|
abstract boolean |
check()
Override this with your specific check |
int |
getResult()
Wait for the result to happen, or for a timeout |
void |
setDelay(int delay)
|
void |
setTimeout(long timeout)
Set the timeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Log LOG
public static final int WAITING
public static final int SUCCESS
public static final int TIMEOUT
setTimeout(long)
,
Constant Field Valuesprivate long timeout
private int result
private int delay
Constructor Detail |
---|
public ResultMonitor()
Method Detail |
---|
public abstract boolean check() throws java.lang.Exception
java.lang.Exception
- if anything goes wrongpublic int getResult() throws ProxoolException
SUCCESS
or TIMEOUT
ProxoolException
- if the check()
threw an exceptionsetTimeout(long)
public void setTimeout(long timeout)
timeout
- millisecondspublic void setDelay(int delay)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |