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
Processor
implementation which delegates to an omero.grid.Processor servant. Functions as a state machine. A singleProcessPrx
can be active at any given time. Once it's complete, then theresults
can be obtained, then a newJob
can be submitted, untilstop
is 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 void
close(Ice.Current current)
protected void
doStop()
ProcessPrx
execute(RMap inputs, Ice.Current __current)
Executes an instance of the job returned by getJob() using the given map as inputs.long
expires(Ice.Current __current)
Returns the system clock time in milliseconds since the epoch at which this processor will be reaped.Job
getJob(Ice.Current __current)
Returns the job which defines this processor.RMap
getResults(ProcessPrx proc, Ice.Current __current)
Retrieve the results for the given process.JobParams
params(Ice.Current __current)
Retrieves the parameters needed to be passed in an execution and the results which will be passed back out.boolean
setDetach(boolean detach, Ice.Current __current)
Sets whether or not cancel will be called on the currentProcess
on stop.void
stop(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
- UnloadedJob
instance, which will be used byProcessor
to reload theJob
timeout
-- Throws:
ServerError
-
-
Method Detail
-
params
public JobParams params(Ice.Current __current) throws ServerError
Description copied from interface:_InteractiveProcessorOperations
Retrieves 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:
params
in 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:_InteractiveProcessorOperations
Executes an instance of the job returned by getJob() using the given map as inputs.- Specified by:
execute
in 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:_InteractiveProcessorOperations
Retrieve 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:
getResults
in interface_InteractiveProcessorOperations
__current
- The Current object for the invocation.- Throws:
ServerError
-
expires
public long expires(Ice.Current __current)
Description copied from interface:_InteractiveProcessorOperations
Returns the system clock time in milliseconds since the epoch at which this processor will be reaped.- Specified by:
expires
in interface_InteractiveProcessorOperations
- Parameters:
__current
- The Current object for the invocation.
-
getJob
public Job getJob(Ice.Current __current)
Description copied from interface:_InteractiveProcessorOperations
Returns 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:
getJob
in interface_InteractiveProcessorOperations
- Parameters:
__current
- The Current object for the invocation.
-
setDetach
public boolean setDetach(boolean detach, Ice.Current __current)
Description copied from interface:_InteractiveProcessorOperations
Sets whether or not cancel will be called on the currentProcess
on stop. If detach is true, then theProcess
will continue running. Otherwise,_ProcessOperations.cancel(Ice.Current)
will be called, before preparing for another run. false by default- Specified by:
setDetach
in interface_InteractiveProcessorOperations
__current
- The Current object for the invocation.
-
stop
public void stop(Ice.Current __current) throws ServerError
Cancels the current process, nulls the value, and returns immediately if detach is false.- Specified by:
stop
in 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:
close
in interfaceCloseableServant
- Throws:
java.lang.Exception
-
-