ti.chimera.service
Class SwingWorker

java.lang.Object
  extended byti.chimera.Service
      extended byti.chimera.service.SwingWorker

public abstract class SwingWorker
extends Service

The "swing worker" is service that provides a call-gate which makes it possible to perform long running processes from the AWT event thread without blocking the UI, or from a WorkerThread without blocking it.

Version:
0.1
Author:
Rob Clark

Constructor Summary
SwingWorker()
          Class Constructor.
 
Method Summary
abstract  void run(java.lang.Runnable r, java.lang.String str)
          Call the Runnable.run() method.
 
Methods inherited from class ti.chimera.Service
getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwingWorker

public SwingWorker()
Class Constructor.

Method Detail

run

public abstract void run(java.lang.Runnable r,
                         java.lang.String str)
                  throws java.lang.Throwable
Call the Runnable.run() method. This method does not return until until the runnable completes, but may call the runnable from a different thread context if needed. Because of this, care must be taken about the use of synchronization, specifically a monitor acquired before calling this method may not be held by the thread invoking the runnable, which could lend to race conditions or deadlock (if the invoking thread tries to acquire the monitor already held by the thread that called this.

Parameters:
r - the runnable to run
str - the progress message to display to user
Throws:
java.lang.Throwable - if an exception was thrown by the runnable