org.stringer.thread
Class AbstractSwingWorker

java.lang.Object
  |
  +--EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
        |
        +--EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
              |
              +--org.stringer.thread.AbstractSwingWorker
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
GetAvailableFeeds, SubscribedSwingWorker, UpdateFeeds

public abstract class AbstractSwingWorker
extends EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker


Field Summary
protected  java.lang.String buildDate
           
protected  java.util.List listenerList
          If any IThreadListeners have been registered, the listenerList contains them.
(package private) static org.apache.log4j.Logger logger
           
(package private)  javax.swing.ProgressMonitor monitor
           
protected  boolean running
          Specifies whether action is enabled; the default is true.
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
threadFactory_
 
Constructor Summary
AbstractSwingWorker()
          Defines an Action object with a default description string and default icon.
 
Method Summary
 void addThreadListener(IThreadListener l)
          Adds a IThreadListener to the listener list.
protected  void finished()
           
protected  void fireBegin()
          Supports reporting of the completion of a subprocessing task within a SwingWorker thread.
protected  void fireBeginUnit(java.lang.Object o)
          Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.
 void fireCanceled()
          Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.
 void fireEndUnit(java.lang.Object o)
          Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.
protected  void fireThreadComplete(java.lang.Object o)
          Supports reporting of thread completion.
 java.lang.String getBuildDate()
           
 javax.swing.ProgressMonitor getProgressMonitor()
           
 void interrupt()
          Stops the worker and sets the exception to InterruptedException.
 boolean isRunning()
          Returns true if the thread is active
 void removeThreadListener(IThreadListener l)
          Removes a IThreadListener from the listener list.
 void setProgressMonitor(javax.swing.ProgressMonitor m)
           
 void setRunning(boolean newValue)
          sets the indicator of whether this thread is running or not.
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker
construct, get, getException, getTimeout, isReady, run, start, timedGet
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
getThreadFactory, setThreadFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger

running

protected boolean running
Specifies whether action is enabled; the default is true.


buildDate

protected java.lang.String buildDate

monitor

javax.swing.ProgressMonitor monitor

listenerList

protected java.util.List listenerList
If any IThreadListeners have been registered, the listenerList contains them.

Constructor Detail

AbstractSwingWorker

public AbstractSwingWorker()
Defines an Action object with a default description string and default icon.

Method Detail

getBuildDate

public java.lang.String getBuildDate()

setProgressMonitor

public void setProgressMonitor(javax.swing.ProgressMonitor m)

getProgressMonitor

public javax.swing.ProgressMonitor getProgressMonitor()

interrupt

public void interrupt()
Stops the worker and sets the exception to InterruptedException.

Overrides:
interrupt in class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker

isRunning

public boolean isRunning()
Returns true if the thread is active

Returns:
true if the thread is active, false otherwise

addThreadListener

public void addThreadListener(IThreadListener l)
Adds a IThreadListener to the listener list. The listener is registered for all IThreadListener events.


removeThreadListener

public void removeThreadListener(IThreadListener l)
Removes a IThreadListener from the listener list. This removes a IThreadListener that was registered for all events.


setRunning

public void setRunning(boolean newValue)
sets the indicator of whether this thread is running or not.

Parameters:
newValue - true if the thread is running, false if it isn't.

fireThreadComplete

protected void fireThreadComplete(java.lang.Object o)
Supports reporting of thread completion. This method can be called when a SwingWorker derived thread has completed its task.


fireBeginUnit

protected void fireBeginUnit(java.lang.Object o)
                      throws java.lang.InterruptedException
Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.

java.lang.InterruptedException

fireEndUnit

public void fireEndUnit(java.lang.Object o)
Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.


fireBegin

protected void fireBegin()
Supports reporting of the completion of a subprocessing task within a SwingWorker thread.


fireCanceled

public void fireCanceled()
Supports reporting of the beginning of a subprocessing task within a SwingWorker thread.


finished

protected void finished()
Overrides:
finished in class EDU.oswego.cs.dl.util.concurrent.misc.SwingWorker


Copyright © R. Kevin Cole. All Rights Reserved.