org.jwarp.service.work
Interface IWorkManager

All Superinterfaces:
IConfigurable
All Known Implementing Classes:
AWorkManager

public interface IWorkManager
extends IConfigurable

This interface extends the job manager interface. A work manager is in fact a job manager that also manages a tool manager instance. This interface is also the base of the work service.

Version:
1.0
Author:
Anatole Tresch

Method Summary
 void addJob(IJob job, int priority)
          Add a new job.
 IJob addJob(java.lang.String toolName, int userID, java.lang.String ref, Parameter[] data, long maxRuntime)
          Add a new job.
 boolean anonymousJobsAllowed()
          A flag id anonymous jobs are allowed or an exception will be raised when traing to register such a job.
 void cancelJob(IJob job, boolean forceStop)
          Removes the job with the given id from the manager.
 IJob getJob(int job)
          Return a job's execution status
 java.lang.String getName()
          Return the manager's name (in case there are several managers running).
 IToolManager getToolManager()
          Get the underlying tool manager.
 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.
 void stop()
          Stops the internal thread pol immedeately
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 

Method Detail

searchJobs

public java.util.Iterator searchJobs(int jobID,
                                     java.lang.String toolName,
                                     int userID,
                                     java.lang.String ref,
                                     short status)
                              throws java.lang.SecurityException
This is the main acecess metho for searching within the manager's job db.
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 userID,
                   java.lang.String ref,
                   Parameter[] data,
                   long maxRuntime)
            throws NotFoundException,
                   NotAvailableException,
                   ConfigurationException
Add a new job.
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
Add a new job.
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 job)
            throws NotFoundException
Return a job's execution status

cancelJob

public void cancelJob(IJob job,
                      boolean forceStop)
               throws NotFoundException
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.
Parameters:
id - The job's id.
forecStop - Should a yet running job stopped immedeately

anonymousJobsAllowed

public boolean anonymousJobsAllowed()
A flag id anonymous jobs are allowed or an exception will be raised when traing to register such a job.
Returns:
the flag

getToolManager

public IToolManager getToolManager()
Get the underlying tool manager.
Returns:
The tool manager instance

stop

public void stop()
Stops the internal thread pol immedeately

getName

public java.lang.String getName()
Return the manager's name (in case there are several managers running).
Returns:
The manager's name

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