org.jwarp.service.work
Interface IWorkService
- All Superinterfaces:
- IConfigurable, IExceptionProvider, IService
- All Known Implementing Classes:
- WorkService
- public interface IWorkService
- extends IService
This is the servie interface for work items.
|
Method Summary |
void |
addJob(IJob job,
java.lang.String managerName,
int priority,
ITicket user)
Add a new job. |
IJob |
addJob(java.lang.String toolName,
int userID,
java.lang.String ref,
java.lang.String managerName,
Parameter[] data,
long maxRuntime,
ITicket user)
Add a new job. |
boolean |
anonymousJobsAllowed(java.lang.String managerName)
A flag id anonymous jobs are allowed or an exception will be raised when traing to register such a job. |
void |
cancelJob(IJob job,
java.lang.String managerName,
boolean forceStop,
ITicket user)
Removes the job with the given id from the manager. |
IJob |
getJob(int job,
java.lang.String managerName,
ITicket user)
Return a job's execution status |
IToolManager |
getToolManager(java.lang.String managerName,
ITicket user)
Get the underlying tool manager. |
java.util.Iterator |
searchJobs(int jobID,
java.lang.String toolName,
int userID,
java.lang.String ref,
java.lang.String managerName,
short status,
ITicket user)
This is the main acecess metho for searching within the manager's job db. |
void |
stop(java.lang.String managerName,
ITicket user)
Stops the internal thread pol immedeately |
| Methods inherited from interface org.jwarp.service.IService |
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend |
SERVICE_TYPE
public static final java.lang.String SERVICE_TYPE
searchJobs
public java.util.Iterator searchJobs(int jobID,
java.lang.String toolName,
int userID,
java.lang.String ref,
java.lang.String managerName,
short status,
ITicket user)
throws java.lang.SecurityException,
NotFoundException
- This is the main acecess metho for searching within the manager's job db.
- 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 userID,
java.lang.String ref,
java.lang.String managerName,
Parameter[] data,
long maxRuntime,
ITicket user)
throws NotFoundException,
NotAvailableException,
ConfigurationException,
java.lang.SecurityException
- Add a new job.
- 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,
java.lang.String managerName,
int priority,
ITicket user)
throws ThreadPoolStoppedException,
java.lang.SecurityException,
NotFoundException
- Add a new job.
- 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 job,
java.lang.String managerName,
ITicket user)
throws NotFoundException,
java.lang.SecurityException
- Return a job's execution status
cancelJob
public void cancelJob(IJob job,
java.lang.String managerName,
boolean forceStop,
ITicket user)
throws NotFoundException,
java.lang.SecurityException
- 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(java.lang.String managerName)
throws NotFoundException
- 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(java.lang.String managerName,
ITicket user)
throws NotFoundException,
java.lang.SecurityException
- Get the underlying tool manager.
- Returns:
- The tool manager instance
stop
public void stop(java.lang.String managerName,
ITicket user)
throws NotFoundException,
java.lang.SecurityException
- Stops the internal thread pol immedeately