edu.sc.seis.fissuresUtil.cache
Class AbstractJob

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.cache.AbstractJob
All Implemented Interfaces:
Job, java.lang.Runnable
Direct Known Subclasses:
UpdateCheckerJob

public abstract class AbstractJob
extends java.lang.Object
implements Job, java.lang.Runnable


Field Summary
 
Fields inherited from interface edu.sc.seis.fissuresUtil.cache.Job
FINISHED, INITIALIZE
 
Constructor Summary
AbstractJob(java.lang.String name)
           
 
Method Summary
 void add(StatusListener listener)
          Method addStatusListener adds a status listener to this Process that will be notified whenver the status changes
 java.lang.String getName()
          Method getName returns a name for this process that succinctly describes its action
 java.lang.String getStatus()
          Method getStatus is used to indicate the current status of this long running Job
 boolean isFinished()
          Method finished allows a process monitor to know if the process is finished.
 void run()
           
protected  void setFinished()
           
protected  void setFinished(boolean finished)
           
 void setStatus(java.lang.String status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.sc.seis.fissuresUtil.cache.Job
runJob
 

Constructor Detail

AbstractJob

public AbstractJob(java.lang.String name)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

getStatus

public java.lang.String getStatus()
Method getStatus is used to indicate the current status of this long running Job

Specified by:
getStatus in interface Job
Returns:
a String describing what this process is up to at the current time

setStatus

public void setStatus(java.lang.String status)

getName

public java.lang.String getName()
Method getName returns a name for this process that succinctly describes its action

Specified by:
getName in interface Job
Returns:
a String naming this process. If the string is more than 30 characters it will be truncated

add

public void add(StatusListener listener)
Method addStatusListener adds a status listener to this Process that will be notified whenver the status changes

Specified by:
add in interface Job

isFinished

public boolean isFinished()
Description copied from interface: Job
Method finished allows a process monitor to know if the process is finished. When finished is set to true, a status changed message is fired to all StatusListeners

Specified by:
isFinished in interface Job
Returns:
true if finished, false otherwise

setFinished

protected void setFinished()

setFinished

protected void setFinished(boolean finished)