|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.pushtotest.tool.protocolhandler.ProtocolThread
public class ProtocolThread
This is a class that wraps around a Protocol object to make it run in its own thread. This will allow the Protocol implementations themselves to be rather simple and not have to deal with timeouts and the like. Instead, the ProtocolThread will handle that stuff.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ProtocolThread(Protocol protocol)
This constrcuts a new ProtocolThread that wraps around the passed in Protocol Object. |
|
| Method Summary | |
|---|---|
Response |
getResponse()
This should only be called if the Protocol is run as a Thread. |
boolean |
isRunning()
Is the current thread runnign or has it completed? |
void |
run()
This is the method called when protocolthread.start() is called. |
boolean |
timedOut()
This method will tell whether or not the Protocol attempt timed out before it was successfully completed or not. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProtocolThread(Protocol protocol)
protocol - The Protocol object that should be wrapped in this thread
and run.| Method Detail |
|---|
public boolean timedOut()
public boolean isRunning()
public Response getResponse()
connect() method can be called directly.
synchronized monitor so that the thread will just sleep while it
waits for the response to be available. Good ol' spinlock.
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||