|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.sptci.echo2.Controller.Worker<S>
protected abstract class Controller.Worker<S>
An abstract worker thread used to execute tasks in the background to avoid locking up the UI.
| Nested Class Summary | |
|---|---|
(package private) class |
Controller.Worker.Executor
The Runnable that is used to execute the task from the
Echo2 TaskQueue. |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected String |
message
The message to display after completing the task. |
protected String |
method
The name of the Method that is to be invoked on source. |
protected int |
pollingInterval
The polling interval at which client must poll server for results of task execution. |
protected S |
source
The source object on which the specified method is to be invoked. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
Controller.Worker()
Default constructor. |
protected |
Controller.Worker(int pollingInterval,
S source,
String method,
String message)
Create a new instance of the worker with the specified values. |
| Method Summary | |
|---|---|
(package private) void |
displayMessage()
Display the contents of message in an instance of ErrorPane. |
protected abstract void |
execute()
Execute the method on source. |
void |
run()
Implementation of the Runnable interface. |
protected void |
setMessage(String message)
Set message. |
protected void |
setMethod(String method)
Set method. |
protected void |
setPollingInterval(int pollingInterval)
Set pollingInterval. |
protected void |
setSource(S source)
Set source. |
| 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 |
| Field Detail |
|---|
protected int pollingInterval
protected S source
method is to be invoked.
protected String method
Method that is to be invoked on source.
protected String message
| Constructor Detail |
|---|
protected Controller.Worker()
protected Controller.Worker(int pollingInterval,
S source,
String method,
String message)
pollingInterval - The pollingInterval to set.source - The source to set.method - The method to set.message - The message to set.| Method Detail |
|---|
public void run()
execute().
run in interface Runnablerun in class Threadprotected abstract void execute()
method on source.
void displayMessage()
message in an instance of ErrorPane.
protected void setPollingInterval(int pollingInterval)
pollingInterval.
pollingInterval - The value to set.protected void setSource(S source)
source.
source - The value to set.protected void setMethod(String method)
method.
method - The value to set.protected void setMessage(String message)
message.
message - The value to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||