Package omero.grid
Class InteractiveProcessorI
- java.lang.Object
-
- omero.grid.InteractiveProcessorI
-
- All Implemented Interfaces:
_InteractiveProcessorOperations,CloseableServant
public class InteractiveProcessorI extends java.lang.Object implements _InteractiveProcessorOperations, CloseableServant
Processorimplementation which delegates to an omero.grid.Processor servant. Functions as a state machine. A singleProcessPrxcan be active at any given time. Once it's complete, then theresultscan be obtained, then a newJobcan be submitted, untilstopis set. Any other use throws anApiUsageException.- Since:
- 3.0-Beta3
-
-
Constructor Summary
Constructors Constructor Description InteractiveProcessorI(ome.system.Principal p, ome.services.sessions.SessionManager mgr, ome.services.util.Executor ex, ProcessorPrx prx, Job job, long timeout, Glacier2.SessionControlPrx control, ParamsCache paramsCache, ParamsHelper paramsHelper, ome.services.scripts.ScriptRepoHelper scriptRepoHelper, Ice.Current current)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(Ice.Current current)protected voiddoStop()ProcessPrxexecute(RMap inputs, Ice.Current __current)Executes an instance of the job returned by getJob() using the given map as inputs.longexpires(Ice.Current __current)Returns the system clock time in milliseconds since the epoch at which this processor will be reaped.JobgetJob(Ice.Current __current)Returns the job which defines this processor.RMapgetResults(ProcessPrx proc, Ice.Current __current)Retrieve the results for the given process.JobParamsparams(Ice.Current __current)Retrieves the parameters needed to be passed in an execution and the results which will be passed back out.booleansetDetach(boolean detach, Ice.Current __current)Sets whether or not cancel will be called on the currentProcesson stop.voidstop(Ice.Current __current)Cancels the current process, nulls the value, and returns immediately if detach is false.
-
-
-
Constructor Detail
-
InteractiveProcessorI
public InteractiveProcessorI(ome.system.Principal p, ome.services.sessions.SessionManager mgr, ome.services.util.Executor ex, ProcessorPrx prx, Job job, long timeout, Glacier2.SessionControlPrx control, ParamsCache paramsCache, ParamsHelper paramsHelper, ome.services.scripts.ScriptRepoHelper scriptRepoHelper, Ice.Current current) throws ServerError- Parameters:
p-mgr-prx-job- UnloadedJobinstance, which will be used byProcessorto reload theJobtimeout-- Throws:
ServerError
-
-
Method Detail
-
params
public JobParams params(Ice.Current __current) throws ServerError
Description copied from interface:_InteractiveProcessorOperationsRetrieves the parameters needed to be passed in an execution and the results which will be passed back out. This method is guaranteed to return a non-null value or throw an exception.- Specified by:
paramsin interface_InteractiveProcessorOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
execute
public ProcessPrx execute(RMap inputs, Ice.Current __current) throws ServerError
Description copied from interface:_InteractiveProcessorOperationsExecutes an instance of the job returned by getJob() using the given map as inputs.- Specified by:
executein interface_InteractiveProcessorOperations__current- The Current object for the invocation.- Throws:
ServerError
-
getResults
public RMap getResults(ProcessPrx proc, Ice.Current __current) throws ServerError
Description copied from interface:_InteractiveProcessorOperationsRetrieve the results for the given process. This will throw an ApiUsageException if called before the process has returned. Use either process.poll() or process.wait() or a ProcessCallback to wait for completion before calling. If the user has not overridden or disabled the output values "stdout" and "stderr", these will be filled with the OriginalFile instances uploaded after completion under the key values of the same name.- Specified by:
getResultsin interface_InteractiveProcessorOperations__current- The Current object for the invocation.- Throws:
ServerError
-
expires
public long expires(Ice.Current __current)
Description copied from interface:_InteractiveProcessorOperationsReturns the system clock time in milliseconds since the epoch at which this processor will be reaped.- Specified by:
expiresin interface_InteractiveProcessorOperations- Parameters:
__current- The Current object for the invocation.
-
getJob
public Job getJob(Ice.Current __current)
Description copied from interface:_InteractiveProcessorOperationsReturns the job which defines this processor. This may be only the last job associated with the processor if execute is called multiple times.- Specified by:
getJobin interface_InteractiveProcessorOperations- Parameters:
__current- The Current object for the invocation.
-
setDetach
public boolean setDetach(boolean detach, Ice.Current __current)Description copied from interface:_InteractiveProcessorOperationsSets whether or not cancel will be called on the currentProcesson stop. If detach is true, then theProcesswill continue running. Otherwise,_ProcessOperations.cancel(Ice.Current)will be called, before preparing for another run. false by default- Specified by:
setDetachin interface_InteractiveProcessorOperations__current- The Current object for the invocation.
-
stop
public void stop(Ice.Current __current) throws ServerErrorCancels the current process, nulls the value, and returns immediately if detach is false.- Specified by:
stopin interface_InteractiveProcessorOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
doStop
protected void doStop() throws ServerError- Throws:
ServerError
-
close
public void close(Ice.Current current) throws java.lang.Exception- Specified by:
closein interfaceCloseableServant- Throws:
java.lang.Exception
-
-