org.jwarp.service.work
Class SQLWorkManager

java.lang.Object
  |
  +--org.jwarp.service.work.AWorkManager
        |
        +--org.jwarp.service.work.SQLWorkManager
All Implemented Interfaces:
IConfigurable, IWorkManager

public class SQLWorkManager
extends AWorkManager


Field Summary
protected  java.util.Hashtable jobs
           
protected  ConnectionPool pool
           
protected static java.lang.String SQLgetOpenJobs
           
 
Fields inherited from class org.jwarp.service.work.AWorkManager
anonymousJobsAllowed, name, threadPool, toolManager, workManagerListeners
 
Constructor Summary
SQLWorkManager(ConnectionPool pool)
           
SQLWorkManager(ConnectionPool pool, java.lang.String name)
           
 
Method Summary
 void addJob(IJob job, int priority)
          Add a new job.
 IJob addJob(java.lang.String toolName, int user, java.lang.String reference, Parameter[] data, long maxRuntime)
          Add a new job.
 void cancelJob(IJob job, boolean forceStop)
          Removes the job with the given id from the manager.
 void configure(org.jdom.Element config)
          Creates a new work manager object ...
 IJob getJob(int jobID)
          Return a job's execution status
 java.util.Iterator searchJobs(int jobID, java.lang.String toolName, int userID, java.lang.String ref, short status)
          This is the main acecess metho for searching within the manager's job db.
 
Methods inherited from class org.jwarp.service.work.AWorkManager
addWorkManagerListener, anonymousJobsAllowed, fireWorkManagerEvent, getName, getToolManager, removeWorkManagerListener, setName, stop
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQLgetOpenJobs

protected static java.lang.String SQLgetOpenJobs

jobs

protected java.util.Hashtable jobs

pool

protected ConnectionPool pool
Constructor Detail

SQLWorkManager

public SQLWorkManager(ConnectionPool pool,
                      java.lang.String name)

SQLWorkManager

public SQLWorkManager(ConnectionPool pool)
Method Detail

configure

public void configure(org.jdom.Element config)
               throws ConfigurationException
Description copied from class: AWorkManager
Creates a new work manager object ...
Overrides:
configure in class AWorkManager
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

searchJobs

public java.util.Iterator searchJobs(int jobID,
                                     java.lang.String toolName,
                                     int userID,
                                     java.lang.String ref,
                                     short status)
Description copied from interface: IWorkManager
This is the main acecess metho for searching within the manager's job db.
Following copied from interface: org.jwarp.service.work.IWorkManager
Parameters:
jobID - The job's id or -1
toolName - The job's tool name
The - userID or -1
The - jobs status or IJob.STATUS_ANY
owner - The owning object
user - The user who triggers the request
Returns:
iterator with all found jobs

addJob

public IJob addJob(java.lang.String toolName,
                   int user,
                   java.lang.String reference,
                   Parameter[] data,
                   long maxRuntime)
            throws NotFoundException,
                   NotAvailableException,
                   ConfigurationException
Description copied from interface: IWorkManager
Add a new job.
Following copied from interface: org.jwarp.service.work.IWorkManager
Parameters:
toolName - The name of the tool to be executed
activity - The activity whos triggering the job
userID - The user who's triggering the job
data - The parameters to be passed to the executing tool.
Throws:
NotAvailableException - if the requested tool is temporarely not available

addJob

public void addJob(IJob job,
                   int priority)
            throws ThreadPoolStoppedException
Description copied from interface: IWorkManager
Add a new job.
Following copied from interface: org.jwarp.service.work.IWorkManager
Parameters:
toolName - The name of the tool to be executed
activity - The activity whos triggering the job
userID - The user who's triggering the job
data - The parameters to be passed to the executing tool.
Throws:
NotAvailableException - if the requested tool is temporarely not available

getJob

public IJob getJob(int jobID)
            throws NotFoundException
Description copied from interface: IWorkManager
Return a job's execution status

cancelJob

public void cancelJob(IJob job,
                      boolean forceStop)
               throws NotFoundException
Description copied from interface: IWorkManager
Removes the job with the given id from the manager. If the job is executed yet a NotFoundException will be raised. If the job is running yet (but not finished) the behaviour depends on the orceStop flag. If set the curent thread will be forced to stop immedeately. If not set the job will be finished executing.
Following copied from interface: org.jwarp.service.work.IWorkManager
Parameters:
id - The job's id.
forecStop - Should a yet running job stopped immedeately

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