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.


Field Summary
static java.lang.String SERVICE_TYPE
           
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
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
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
Method Detail

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 -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,
                   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 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,
                   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 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,
                   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

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