databionics.modules
Class Job

java.lang.Object
  extended by databionics.modules.Tool
      extended by databionics.modules.Job

public class Job
extends Tool

A job is the execution of a tool on a set of files. For Java tools the application sub-class will be loaded and started in a Thread. For non Java tools the class Runner will be used as a wrapper for a Process.


Field Summary
protected  Application app
          corresponding application
protected  java.util.Date end
          date and time when running job was ended
protected static org.apache.log4j.Logger log
          log4j logging
protected  java.util.Date start
          date and time when job was started
 
Fields inherited from class databionics.modules.Tool
command, description, inputTypes, interactiveParams, name, os, outputTypes, parameters, showProgress
 
Constructor Summary
Job()
          standard constructor
Job(Tool tool)
          Copy constructor to create a Job from a Tool.
 
Method Summary
 Application getApp()
           
 java.util.Date getEnd()
          Get date and time when job ended
 java.lang.String getRuntime()
          Get runtime !!! This could be done with: Calendar.getTime().getTime() - Calendar.getTime().get(Time) + 24*60*60*1000 and reformatting
 java.util.Date getStart()
          Get date and time when the job was started
 void interrupt()
          Interrupt the job
 boolean isDone()
          Returns true if application is finished,
 void setEnd()
          Set end to current date and time.
 void setEnd(java.util.Date date)
          Set end to this date and time
 void setStart()
          Set start to current date and time
 void setStart(java.util.Date date)
          Set start to this date and time
 void start()
          Start the job
 java.lang.String[] toArray()
          Build an array holding the parameters and values
 java.lang.String toString()
          String representation of job
 java.lang.String toXml()
          write a job in a string in xml-format
static Tool valueOf(org.w3c.dom.Element el, Modules modules)
          load a job out of the xml-tag "el"
 
Methods inherited from class databionics.modules.Tool
getCommand, getDescription, getInputFileParameter, getInputFileParameters, getInputTypes, getInteractiveParams, getName, getOperatingSystem, getOutputFileParameters, getOutputTypes, getParameterByName, getParameters, hasInteractiveParams, setCommand, setDescription, setName, setOperatingSystem, setShowProgress, showProgress, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
log4j logging


app

protected Application app
corresponding application


start

protected java.util.Date start
date and time when job was started


end

protected java.util.Date end
date and time when running job was ended

Constructor Detail

Job

public Job()
standard constructor


Job

public Job(Tool tool)
Copy constructor to create a Job from a Tool. Makes a deep copy of the parameters, so the values can be changed without changing the (default) values in the parameters of the tool.

Parameters:
tool - tool to be started
Method Detail

getStart

public java.util.Date getStart()
Get date and time when the job was started

Returns:
date and time

setStart

public void setStart()
Set start to current date and time


setStart

public void setStart(java.util.Date date)
Set start to this date and time

Parameters:
date - start date and time

getEnd

public java.util.Date getEnd()
Get date and time when job ended

Returns:
date and time

setEnd

public void setEnd()
Set end to current date and time.


setEnd

public void setEnd(java.util.Date date)
Set end to this date and time

Parameters:
date - date and time

isDone

public boolean isDone()
Returns true if application is finished,

Returns:
boolean

getRuntime

public java.lang.String getRuntime()
Get runtime !!! This could be done with: Calendar.getTime().getTime() - Calendar.getTime().get(Time) + 24*60*60*1000 and reformatting

Returns:
time between start and end in hours, minutes and seconds

start

public void start()
Start the job


interrupt

public void interrupt()
Interrupt the job


toString

public java.lang.String toString()
String representation of job

Overrides:
toString in class java.lang.Object
Returns:
the command to start the job

toArray

public java.lang.String[] toArray()
Build an array holding the parameters and values

Returns:
the parameters with values

valueOf

public static Tool valueOf(org.w3c.dom.Element el,
                           Modules modules)
load a job out of the xml-tag "el"


toXml

public java.lang.String toXml()
write a job in a string in xml-format


getApp

public Application getApp()
Returns:
Returns the app.


Copyright © 2005-2006 Databionics Research Group. All Rights Reserved.