Package ome.services.blitz.impl
Class ScriptProcessI
- java.lang.Object
-
- ome.services.blitz.impl.AbstractAmdServant
-
- ome.services.blitz.impl.ScriptProcessI
-
- All Implemented Interfaces:
_ProcessOperations,_ScriptProcessOperations,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class ScriptProcessI extends AbstractAmdServant implements _ScriptProcessOperations
- Since:
- Beta4.2
-
-
Constructor Summary
Constructors Constructor Description ScriptProcessI(ServiceFactoryI sf, Ice.Current current, InteractiveProcessorPrx processorPrx, _InteractiveProcessorOperations processor, ProcessPrx process)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int_wait(Ice.Current __current)Blocks until poll() would return a non-null return code.booleancancel(Ice.Current __current)Signal to the Process that it should terminate.voidclose(boolean detach, Ice.Current __current)Closes this process and frees server resources attached to it.ScriptJobgetJob(Ice.Current __current)Returns the job which started this process.ScriptProcessPrxgetProxy()java.util.Map<java.lang.String,RType>getResults(int waitSecs, Ice.Current __current)Returns the results immediately if present.booleankill(Ice.Current __current)Terminate the Process immediately.RIntpoll(Ice.Current __current)Returns the return code of the process, or null if unfinished.voidregisterCallback(ProcessCallbackPrx cb, Ice.Current __current)Add a callback for end-of-life eventsjava.lang.StringsetMessage(java.lang.String message, Ice.Current __current)Sets the message on theScriptJobobject.voidshutdown(Ice.Current __current)First attempts cancel() several times and finally resorts to kill to force the process to shutdown cleanly.voidunregisterCallback(ProcessCallbackPrx cb, Ice.Current __current)Remove a callback for end-of-life events-
Methods inherited from class ome.services.blitz.impl.AbstractAmdServant
activate_async, applyHardWiredInterceptors, callInvokerOnMappedArgs, callInvokerOnRawArgs, executorWorkCall, getCurrentEventContext_async, onSetOmeroContext, passivate_async, runnableCall, safeRunnableCall, setApplicationContext, setHolder
-
-
-
-
Constructor Detail
-
ScriptProcessI
public ScriptProcessI(ServiceFactoryI sf, Ice.Current current, InteractiveProcessorPrx processorPrx, _InteractiveProcessorOperations processor, ProcessPrx process) throws ServerError
- Throws:
ServerError
-
-
Method Detail
-
getProxy
public ScriptProcessPrx getProxy()
-
close
public void close(boolean detach, Ice.Current __current) throws ServerErrorDescription copied from interface:_ScriptProcessOperationsCloses this process and frees server resources attached to it. If the detach argument is True, then the background process will continue executing. The user can reconnect to the process via theIScriptservice. If the detach argument is False, then the background process will be shutdown immediately, and all intermediate results (stdout, stderr, ...) will be uploaded.- Specified by:
closein interface_ScriptProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
getJob
public ScriptJob getJob(Ice.Current __current) throws ServerError
Description copied from interface:_ScriptProcessOperationsReturns the job which started this process. Several scheduling fields (submitted, scheduledFor, started, finished) may be of interest.- Specified by:
getJobin interface_ScriptProcessOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
getResults
public java.util.Map<java.lang.String,RType> getResults(int waitSecs, Ice.Current __current) throws ServerError
Description copied from interface:_ScriptProcessOperationsReturns the results immediately if present. If the process is not yet finished, waits "waitSecs" before throwing anApiUsageException. If poll has returned a non-null value, then this method will always return a non-null value.- Specified by:
getResultsin interface_ScriptProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
setMessage
public java.lang.String setMessage(java.lang.String message, Ice.Current __current) throws ServerErrorDescription copied from interface:_ScriptProcessOperationsSets the message on theScriptJobobject. This value MAY be overwritten by the server if the script fails.- Specified by:
setMessagein interface_ScriptProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
_wait
public int _wait(Ice.Current __current) throws ServerErrorDescription copied from interface:_ProcessOperationsBlocks until poll() would return a non-null return code.- Specified by:
_waitin interface_ProcessOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
cancel
public boolean cancel(Ice.Current __current) throws ServerErrorDescription copied from interface:_ProcessOperationsSignal to the Process that it should terminate. This may be done "softly" for a given time period.- Specified by:
cancelin interface_ProcessOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
kill
public boolean kill(Ice.Current __current)
Description copied from interface:_ProcessOperationsTerminate the Process immediately.- Specified by:
killin interface_ProcessOperations- Parameters:
__current- The Current object for the invocation.
-
poll
public RInt poll(Ice.Current __current) throws ServerError
Description copied from interface:_ProcessOperationsReturns the return code of the process, or null if unfinished.- Specified by:
pollin interface_ProcessOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
registerCallback
public void registerCallback(ProcessCallbackPrx cb, Ice.Current __current) throws ServerError
Description copied from interface:_ProcessOperationsAdd a callback for end-of-life events- Specified by:
registerCallbackin interface_ProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
shutdown
public void shutdown(Ice.Current __current)
Description copied from interface:_ProcessOperationsFirst attempts cancel() several times and finally resorts to kill to force the process to shutdown cleanly. This method doesn't return any value or throw an exception so that it can be called oneway.- Specified by:
shutdownin interface_ProcessOperations- Parameters:
__current- The Current object for the invocation.
-
unregisterCallback
public void unregisterCallback(ProcessCallbackPrx cb, Ice.Current __current) throws ServerError
Description copied from interface:_ProcessOperationsRemove a callback for end-of-life events- Specified by:
unregisterCallbackin interface_ProcessOperations__current- The Current object for the invocation.- Throws:
ServerError
-
-