| java.lang.Object java.lang.Thread ti.pub.WorkerThread
WorkerThread | public class WorkerThread extends Thread (Code) | | A worker thread is a thread that runs queued runnables, in a FIFO
manner.
author: ;Rob Clark;a0873619;San Diego;; version: 0.1 |
Constructor Summary | |
public | WorkerThread(int pri) Class Constructor. | public | WorkerThread(int pri, long watchdogTimeout) Class Constructor. | public | WorkerThread(String name, int pri, long watchdogTimeout) Class Constructor. |
WorkerThread | public WorkerThread(int pri)(Code) | | Class Constructor. Construct a worker thread with the specified
priority.
Parameters: pri - the priority |
WorkerThread | public WorkerThread(int pri, long watchdogTimeout)(Code) | | Class Constructor. Construct a worker thread with the specified
priority.
Parameters: pri - the priority Parameters: watchdogTimeout - the watchdog timeout, if a runnable takes longer than this many ms to complete, the WorkerThread.watchdogTimeoutExceeded method will be called from some other thread context. A value of 0 indicates no time limit |
WorkerThread | public WorkerThread(String name, int pri, long watchdogTimeout)(Code) | | Class Constructor. Construct a worker thread with the specified
priority.
Parameters: name - the thread name Parameters: pri - the priority Parameters: watchdogTimeout - the watchdog timeout, if a runnable takes longer than this many ms to complete, the WorkerThread.watchdogTimeoutExceeded method will be called from some other thread context. A value of 0 indicates no time limit |
invokeLater | public void invokeLater(Runnable r)(Code) | | Enqueue a work unit (a runnable) to be invoked from the context of the
worker thread
Parameters: r - the runnable |
run | public void run()(Code) | | thread-main
|
runNext | public synchronized void runNext(long timeout) throws InterruptedException(Code) | | Run the next work unit (runnable). This is normally called repeatedly in
a loop by the worker thread, but can be called externally in places where
the worker thread may get blocked (ie. showing a modal dialog, etc.).
This should only be called from the context of this worker thread.
Parameters: timeout - the maximum number of ms to wait for the next work item.A value of 0 indicates to wait forever |
unhandledException | public void unhandledException(Throwable e)(Code) | | Called when unhandled errors occur. Can be overriden.
|
watchdogTimeoutExceeded | public void watchdogTimeoutExceeded()(Code) | | If using the watchdog timer, this is called from some other thread context
when the timeout set for executing a runnable has been exceeded.
|
|
|