JThreadKitTM
v1.1.0
(public members only)

com.jthreadkit.swing
Class SwingHelper.Task

java.lang.Object
  |
  +--com.jthreadkit.swing.SwingHelper.Task
Enclosing class:
SwingHelper

public abstract static class SwingHelper.Task
extends Object

This class should be subclassesed to create a task to be passed to the execute(Task) method of SwingHelper.

The abstract method #runBackground must be implemented by all subclasses. This method will be called by a helper thread after an instance of Task is passed to execute(Task). If true is returned, then runEvent will soon be called by the event thread (using SwingUtilitied#invokeLater behind the scenes). If false is returned, then runEvent won't be called (by any thread).

The method #runEvent can be optionally overridden subclasses. After the helper thread finishes with runBackground, and if runBackground returns true, then runEvent soon be called by the event handling thread (using SwingUtilitied#invokeLater behind the scenes).

Although #runBackground can't throw any checked exceptions, it might throw an unchecked exception. If an unchecked exception is thrown fron runBackground, #runEvent will not be called.


Method Summary
 boolean waitUntilDone(long msTimeout)
          Wait until both #runBackground and #runEvent have completed execution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

waitUntilDone

public boolean waitUntilDone(long msTimeout)
                      throws InterruptedException
Wait until both #runBackground and #runEvent have completed execution.

JThreadKitTM
v1.1.0
(public members only)

© Copyright 2000-2001 Programix Incorporated. All rights reserved. JThreadKit home