com.samskivert.swing.util
Class TaskMaster.TaskRunner

java.lang.Object
  extended by java.lang.Thread
      extended by com.samskivert.swing.util.TaskMaster.TaskRunner
All Implemented Interfaces:
Runnable
Enclosing class:
TaskMaster

protected static class TaskMaster.TaskRunner
extends Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  int _mode
           
protected  String _name
           
protected  TaskObserver _observer
           
protected  Object _result
           
protected  Task _task
           
protected static int COMPLETED
           
protected static int FAILED
           
protected static int INVOKE
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TaskMaster.TaskRunner(String name, Task task, TaskObserver observer)
           
 
Method Summary
 void abort()
           
 void run()
          Invokes the task and then reports completion or failure later on the swing event dispatcher thread.
 
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

_name

protected String _name

_task

protected Task _task

_observer

protected TaskObserver _observer

_mode

protected int _mode

_result

protected Object _result

INVOKE

protected static final int INVOKE
See Also:
Constant Field Values

COMPLETED

protected static final int COMPLETED
See Also:
Constant Field Values

FAILED

protected static final int FAILED
See Also:
Constant Field Values
Constructor Detail

TaskMaster.TaskRunner

public TaskMaster.TaskRunner(String name,
                             Task task,
                             TaskObserver observer)
Method Detail

run

public void run()
Invokes the task and then reports completion or failure later on the swing event dispatcher thread. We need to ensure that _mode and _result are visible to the various threads that invoke this runnable so run() is synchronized. Oh how I love Chapter 17.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

abort

public void abort()


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.