org.jwarp.service.work
Class SQLToolJob

java.lang.Object
  |
  +--org.jwarp.service.work.AJob
        |
        +--org.jwarp.service.work.ToolJob
              |
              +--org.jwarp.service.work.SQLToolJob
All Implemented Interfaces:
IJob, IPooledObject, java.lang.Runnable

public class SQLToolJob
extends ToolJob
implements IPooledObject

This is the abstract base class who helps implementing job enities. It implements the IJob interface.


Field Summary
protected  ConnectionPool pool
           
protected static java.lang.String SQLcreateJob
           
protected static java.lang.String SQLgetJobParams
           
protected static java.lang.String SQLgetJobWithID
           
protected static java.lang.String SQLjobFinished
           
protected static java.lang.String SQLjobStarted
           
protected static java.lang.String SQLselectIdentity
           
protected static java.lang.String SQLsetMaxtime
           
 
Fields inherited from class org.jwarp.service.work.ToolJob
managerReference, params, toolName, toolRunner, tstamp
 
Fields inherited from class org.jwarp.service.work.AJob
creationDate, exitResult, finishedDate, id, maxTime, priority, reference, startDate, status, user
 
Fields inherited from interface org.jwarp.service.work.IJob
ANY, STATUS_ACTIVE, STATUS_CREATED, STATUS_EXITED_ERROR, STATUS_EXITED_OK
 
Constructor Summary
SQLToolJob(int id, ConnectionPool pool, IToolManager toolManager)
           
SQLToolJob(ITool tool, int user, java.lang.String reference, java.lang.String managerRef, long maxTime, ConnectionPool pool)
           
 
Method Summary
 void create()
          Creates a representation on the database
 void delete()
          Remove the object from the db.
protected  void jobFinished()
           
protected  void jobFinishedWithError(java.lang.String errorString)
           
protected  void jobStarted()
           
 void read()
           
 void setMaxRuntime(long newTime)
           
 void store()
          Synchronise the objects and the database's state.
 
Methods inherited from class org.jwarp.service.work.ToolJob
doWork, getKey, getManagerReference, getParameters, getToolName, initJob, jdoGetTimeStamp, jdoSetTimeStamp, setManagerReference, setToolName
 
Methods inherited from class org.jwarp.service.work.AJob
getCreationDate, getExitResult, getFinishedDate, getId, getMaxTime, getPriority, getReference, getStartDate, getStatus, getTotalRuntime, getUser, run, setCreationDate, setExitResult, setFinishedDate, setId, setMaxTime, setPriority, setReference, setStartDate, setStatus, setStatus, setUser
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jwarp.service.objectpool.IPooledObject
getKey
 

Field Detail

SQLgetJobWithID

protected static java.lang.String SQLgetJobWithID

SQLcreateJob

protected static java.lang.String SQLcreateJob

SQLjobStarted

protected static java.lang.String SQLjobStarted

SQLjobFinished

protected static java.lang.String SQLjobFinished

SQLsetMaxtime

protected static java.lang.String SQLsetMaxtime

SQLgetJobParams

protected static java.lang.String SQLgetJobParams

SQLselectIdentity

protected static java.lang.String SQLselectIdentity

pool

protected ConnectionPool pool
Constructor Detail

SQLToolJob

public SQLToolJob(int id,
                  ConnectionPool pool,
                  IToolManager toolManager)
           throws PersistenceException

SQLToolJob

public SQLToolJob(ITool tool,
                  int user,
                  java.lang.String reference,
                  java.lang.String managerRef,
                  long maxTime,
                  ConnectionPool pool)
           throws PersistenceException
Method Detail

jobStarted

protected void jobStarted()
                   throws InvalidJobStateException
Overrides:
jobStarted in class AJob

jobFinished

protected void jobFinished()
                    throws InvalidJobStateException
Overrides:
jobFinished in class AJob

jobFinishedWithError

protected void jobFinishedWithError(java.lang.String errorString)
                             throws InvalidJobStateException
Overrides:
jobFinishedWithError in class AJob

setMaxRuntime

public void setMaxRuntime(long newTime)

create

public void create()
            throws PersistenceException
Creates a representation on the database

read

public void read()
          throws PersistenceException

store

public void store()
           throws PersistenceException
Synchronise the objects and the database's state.

delete

public void delete()
            throws PersistenceException
Remove the object from the db.

©   O R C A   S y s t e m s