|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorc.orchard.AbstractExecutorService
public abstract class AbstractExecutorService
Standard implementation of an ExecutorService. Extenders should implement createJobService.
TODO: add executor oil validation to only allow "safe" sites
Field Summary | |
---|---|
protected java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
protected |
AbstractExecutorService(AbstractAccounts accounts)
|
protected |
AbstractExecutorService(java.util.logging.Logger logger,
AbstractAccounts accounts)
|
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. |
protected static JobConfiguration |
getDefaultJobConfiguration()
|
protected static java.util.logging.Logger |
getDefaultLogger()
|
protected Waiter |
getWaiter()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.logging.Logger logger
Constructor Detail |
---|
protected AbstractExecutorService(java.util.logging.Logger logger, AbstractAccounts accounts)
protected AbstractExecutorService(AbstractAccounts accounts)
Method Detail |
---|
public java.lang.String submit(java.lang.String devKey, Oil program) throws QuotaException, InvalidOilException, java.rmi.RemoteException
ExecutorServiceInterface
submit
in interface ExecutorServiceInterface
QuotaException
InvalidOilException
java.rmi.RemoteException
public java.lang.String submitConfigured(java.lang.String devKey, Oil program, JobConfiguration configuration) throws QuotaException, InvalidOilException, UnsupportedFeatureException, java.rmi.RemoteException
ExecutorServiceInterface
submitConfigured
in interface ExecutorServiceInterface
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
public java.util.Set<java.lang.String> jobs(java.lang.String devKey)
ExecutorServiceInterface
jobs
in interface ExecutorServiceInterface
public java.lang.String compileAndSubmit(java.lang.String devKey, java.lang.String program) throws QuotaException, InvalidProgramException, InvalidOilException, java.rmi.RemoteException
ExecutorServiceInterface
compileAndSubmit
in interface ExecutorServiceInterface
QuotaException
InvalidProgramException
InvalidOilException
java.rmi.RemoteException
public java.lang.String compileAndSubmitConfigured(java.lang.String devKey, java.lang.String program, JobConfiguration configuration) throws QuotaException, InvalidProgramException, InvalidOilException, UnsupportedFeatureException, java.rmi.RemoteException
ExecutorServiceInterface
compileAndSubmitConfigured
in interface ExecutorServiceInterface
QuotaException
InvalidProgramException
InvalidOilException
UnsupportedFeatureException
java.rmi.RemoteException
protected static JobConfiguration getDefaultJobConfiguration()
protected static java.util.logging.Logger getDefaultLogger()
protected Waiter getWaiter()
public void finishJob(java.lang.String devKey, java.lang.String job) throws InvalidJobStateException, java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
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.
finishJob
in interface ExecutorServiceInterface
InvalidJobStateException
- if the job is RUNNING or WAITING.
java.rmi.RemoteException
InvalidJobException
public void haltJob(java.lang.String devKey, java.lang.String job) throws java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
haltJob
in interface ExecutorServiceInterface
java.rmi.RemoteException
InvalidJobException
public java.util.List<JobEvent> jobEvents(java.lang.String devKey, java.lang.String job) throws java.rmi.RemoteException, java.lang.InterruptedException, InvalidJobException
ExecutorServiceInterface
FIXME: ensure clients like web/orc.js can recover from connection timeouts.
jobEvents
in interface ExecutorServiceInterface
java.lang.InterruptedException
- if the request times out.
java.rmi.RemoteException
InvalidJobException
public java.lang.String jobState(java.lang.String devKey, java.lang.String job) throws java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
jobState
in interface ExecutorServiceInterface
java.rmi.RemoteException
InvalidJobException
public void purgeJobEvents(java.lang.String devKey, java.lang.String job) throws java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
purgeJobEvents
in interface ExecutorServiceInterface
java.rmi.RemoteException
InvalidJobException
public void startJob(java.lang.String devKey, java.lang.String job) throws InvalidJobStateException, java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
startJob
in interface ExecutorServiceInterface
InvalidJobStateException
- if the job was already started, or was aborted.
java.rmi.RemoteException
InvalidJobException
public void respondToPrompt(java.lang.String devKey, java.lang.String job, int promptID, java.lang.String response) throws InvalidPromptException, java.rmi.RemoteException, InvalidJobException
ExecutorServiceInterface
respondToPrompt
in interface ExecutorServiceInterface
InvalidPromptException
- if the promptID is not valid.
java.rmi.RemoteException
InvalidJobException
public void cancelPrompt(java.lang.String devKey, java.lang.String job, int promptID) throws InvalidJobException, InvalidPromptException, java.rmi.RemoteException
ExecutorServiceInterface
cancelPrompt
in interface ExecutorServiceInterface
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 |