|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExecutorServiceInterface
Broker used to create and manage running jobs.
The lifecycle of a job:
Note that the job publication buffer has a fixed size, so if you don't call purgeJobEvents regularly your job will be suspended when the buffer fills. *
Originally the executor only allow clients to create jobs and clients had to use a separate service to manage running jobs. This did make the interfaces cleaner and required fewer arguments, but it created a lot of extra work for both the client and the server, so I combined the services. Some examples of the "extra work" (mostly caused by limitations of the Java web services and servlet environments):
Method Summary | |
---|---|
void |
cancelPrompt(java.lang.String devKey,
java.lang.String job,
int promptID)
Cancel a prompt (initiated by the Prompt site). |
java.lang.String |
compileAndSubmit(java.lang.String devKey,
java.lang.String program)
Combine compilation and submission into a single step. |
java.lang.String |
compileAndSubmitConfigured(java.lang.String devKey,
java.lang.String program,
JobConfiguration configuration)
Combine compilation and submission into a single step. |
void |
finishJob(java.lang.String devKey,
java.lang.String job)
Indicate that the client is done with the job. |
void |
haltJob(java.lang.String devKey,
java.lang.String job)
Halt the job safely, using the same termination semantics as the "pull" combinator. |
java.util.List<JobEvent> |
jobEvents(java.lang.String devKey,
java.lang.String job)
Retrieve events. |
java.util.Set<java.lang.String> |
jobs(java.lang.String devKey)
URIs of unfinished jobs started from this executor. |
java.lang.String |
jobState(java.lang.String devKey,
java.lang.String job)
What is the job's state? Possible return values: NEW: not yet started. |
void |
purgeJobEvents(java.lang.String devKey,
java.lang.String job)
Purge all events from the event buffer which have been returned by jobEvents. |
void |
respondToPrompt(java.lang.String devKey,
java.lang.String job,
int promptID,
java.lang.String response)
Submit a response to a prompt (initiated by the Prompt site). |
void |
startJob(java.lang.String devKey,
java.lang.String job)
Begin executing the job. |
java.lang.String |
submit(java.lang.String devKey,
Oil program)
Register a new job for execution, using a default JobConfiguration. |
java.lang.String |
submitConfigured(java.lang.String devKey,
Oil program,
JobConfiguration configuration)
Register a new job for execution, using the provided job configuration. |
Method Detail |
---|
java.lang.String submitConfigured(java.lang.String devKey, Oil program, JobConfiguration configuration) throws QuotaException, InvalidOilException, UnsupportedFeatureException, java.rmi.RemoteException
QuotaException
- if registering this job would exceed quotas.
InvalidOilException
- if the program is invalid.
UnsupportedFeatureException
- if the executor does not support some part of the
configuration.
java.rmi.RemoteException
java.lang.String submit(java.lang.String devKey, Oil program) throws QuotaException, InvalidOilException, java.rmi.RemoteException
QuotaException
InvalidOilException
java.rmi.RemoteException
java.lang.String compileAndSubmit(java.lang.String devKey, java.lang.String program) throws QuotaException, InvalidProgramException, InvalidOilException, java.rmi.RemoteException
QuotaException
InvalidProgramException
InvalidOilException
java.rmi.RemoteException
java.lang.String compileAndSubmitConfigured(java.lang.String devKey, java.lang.String program, JobConfiguration configuration) throws QuotaException, InvalidProgramException, InvalidOilException, UnsupportedFeatureException, java.rmi.RemoteException
QuotaException
InvalidProgramException
InvalidOilException
UnsupportedFeatureException
java.rmi.RemoteException
java.util.Set<java.lang.String> jobs(java.lang.String devKey) throws java.rmi.RemoteException
java.rmi.RemoteException
void startJob(java.lang.String devKey, java.lang.String job) throws InvalidJobException, InvalidJobStateException, java.rmi.RemoteException
InvalidJobStateException
- if the job was already started, or was aborted.
InvalidJobException
java.rmi.RemoteException
void finishJob(java.lang.String devKey, java.lang.String job) throws InvalidJobException, InvalidJobStateException, java.rmi.RemoteException
Once this method is called, the service provider is free to garbage collect the service and the service URL may become invalid, so no other methods should be called after this.
InvalidJobStateException
- if the job is RUNNING or WAITING.
java.rmi.RemoteException
InvalidJobException
void haltJob(java.lang.String devKey, java.lang.String job) throws InvalidJobException, java.rmi.RemoteException
InvalidJobException
java.rmi.RemoteException
java.lang.String jobState(java.lang.String devKey, java.lang.String job) throws InvalidJobException, java.rmi.RemoteException
InvalidJobException
java.rmi.RemoteException
java.util.List<JobEvent> jobEvents(java.lang.String devKey, java.lang.String job) throws InvalidJobException, java.lang.InterruptedException, java.rmi.RemoteException
FIXME: ensure clients like web/orc.js can recover from connection timeouts.
java.lang.InterruptedException
- if the request times out.
InvalidJobException
java.rmi.RemoteException
void purgeJobEvents(java.lang.String devKey, java.lang.String job) throws InvalidJobException, java.rmi.RemoteException
java.rmi.RemoteException
InvalidJobException
void respondToPrompt(java.lang.String devKey, java.lang.String job, int promptID, java.lang.String response) throws InvalidJobException, InvalidPromptException, java.rmi.RemoteException
InvalidPromptException
- if the promptID is not valid.
InvalidJobException
java.rmi.RemoteException
void cancelPrompt(java.lang.String devKey, java.lang.String job, int promptID) throws InvalidJobException, InvalidPromptException, java.rmi.RemoteException
InvalidPromptException
- if the promptID is not valid.
InvalidJobException
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |