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
|
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 java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLgetOpenJobs
protected static java.lang.String SQLgetOpenJobs
jobs
protected java.util.Hashtable jobs
pool
protected ConnectionPool pool
SQLWorkManager
public SQLWorkManager(ConnectionPool pool,
java.lang.String name)
SQLWorkManager
public SQLWorkManager(ConnectionPool pool)
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 -1toolName - The job's tool nameThe - userID or -1The - jobs status or IJob.STATUS_ANYowner - The owning objectuser - 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 executedactivity - The activity whos triggering the jobuserID - The user who's triggering the jobdata - 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 executedactivity - The activity whos triggering the jobuserID - The user who's triggering the jobdata - 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