edu.harvard.mgh.purcell.gCLINE.data
Class AutoUpdater

java.lang.Object
  extended by java.util.Timer
      extended by edu.harvard.mgh.purcell.gCLINE.data.AutoUpdater

public class AutoUpdater
extends java.util.Timer

AutoUpadater extends Timer, automatically updating the output files attached in OpView.

Author:
Kathe Todd-Brown

Nested Class Summary
 class AutoUpdater.MyRenderer
          Create a renderer to reflect that status of each operation (completed, failed or running).
 
Field Summary
static java.lang.String COMPLETE
          Flags a completed operation
private  Record data
          This classes access to the general data
static java.lang.String ERROR
          Flags a failed operation
private  ErrorManager errors
          Error messages
private  StartFrame frame
          Window that this updater is attached to.
private  org.apache.log4j.Logger logger
          A logger for this clas
private  java.lang.String op_status_ext
          The file extention that this updater looks at to determine the exit status of the log.
private  java.util.HashMap<java.lang.String,java.lang.String> opStatis
          A hash map that keeps all the operations and their current status completed, running, or failed.
private  java.util.TimerTask readLogs
          This runs every 5 seconds ideal but can be delayed if there isn't enough processor space.
static java.lang.String RUNNING
          Flags a running operation
 
Constructor Summary
AutoUpdater(StartFrame f, Record d, java.lang.String givenExt, ErrorManager e, int sec)
          Create and start our unique timer.
 
Method Summary
 void addOp(java.lang.String opName)
           
 void cancel()
          runs the Timer's cancel and set the opStatis to null for garbage collection.
private  java.lang.String processOpName(java.lang.String s)
          Pull the operation name from the text in the operation node.
 
Methods inherited from class java.util.Timer
purge, schedule, schedule, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private org.apache.log4j.Logger logger
A logger for this clas


frame

private StartFrame frame
Window that this updater is attached to.


op_status_ext

private java.lang.String op_status_ext
The file extention that this updater looks at to determine the exit status of the log.


COMPLETE

public static java.lang.String COMPLETE
Flags a completed operation


RUNNING

public static java.lang.String RUNNING
Flags a running operation


ERROR

public static java.lang.String ERROR
Flags a failed operation


opStatis

private java.util.HashMap<java.lang.String,java.lang.String> opStatis
A hash map that keeps all the operations and their current status completed, running, or failed.


data

private Record data
This classes access to the general data


errors

private ErrorManager errors
Error messages


readLogs

private java.util.TimerTask readLogs
This runs every 5 seconds ideal but can be delayed if there isn't enough processor space. If the operation is still running then check for a .gplink file for the completion status. If a running operation is now completed get the current list of files in our project folder and compares them to the files listed as operations outputs. If there are files that are not in the output list but matches the operation root then it is added to the correct operation output.

Constructor Detail

AutoUpdater

public AutoUpdater(StartFrame f,
                   Record d,
                   java.lang.String givenExt,
                   ErrorManager e,
                   int sec)
Create and start our unique timer. This will update the status of our operations on the operations viewer.

Parameters:
d - the current project
Method Detail

cancel

public void cancel()
runs the Timer's cancel and set the opStatis to null for garbage collection.

Overrides:
cancel in class java.util.Timer

addOp

public void addOp(java.lang.String opName)

processOpName

private java.lang.String processOpName(java.lang.String s)
Pull the operation name from the text in the operation node.

Parameters:
s - a string from the operaiton node in the form "name: discription"
Returns:
a string containing the name of the operaiton