Package org.eso.ias.asce.transfer
Class PythonExecutorTF<T>
java.lang.Object
org.eso.ias.asce.transfer.TransferExecutor
org.eso.ias.asce.transfer.JavaTransferExecutor<T>
org.eso.ias.asce.transfer.PythonExecutorTF<T>
Execution of TF in python is orchestrated by objects of this class:
when there is a python TF, this transfer function implementation is executed:
PythonExecutorTF delegates method execution to the python code through jep.
That means that when python language for the TF is set in the configuration,
this class is always loaded by the ASCE.
Objects of this class then build the python object to which all the calls from ASCE are ultimately delegated.
-
Field Summary
Fields inherited from class org.eso.ias.asce.transfer.TransferExecutor
compElementId, compElementRunningId, props, validityTimeFrame
-
Constructor Summary
ConstructorDescriptionPythonExecutorTF
(String cEleId, String cEleRunningId, long validityTimeFrame, Properties props, String pythonClassName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionRun the TF by delegating to the python implementation in th eproper threadvoid
initialize
(Set<org.eso.ias.asce.transfer.IasioInfo> inputsInfo, org.eso.ias.asce.transfer.IasioInfo outputInfo) Initialize the transfer functionvoid
shutdown()
Shuts down the BehaviorRunner when the IAS does not need it anymore.Methods inherited from class org.eso.ias.asce.transfer.JavaTransferExecutor
getValue, getValue
Methods inherited from class org.eso.ias.asce.transfer.TransferExecutor
getTemplateInstance, isTemplated, setTemplateInstance
-
Constructor Details
-
PythonExecutorTF
public PythonExecutorTF(String cEleId, String cEleRunningId, long validityTimeFrame, Properties props, String pythonClassName) throws Exception Constructor. This constructor differs from the other TFs because it needs to know the name of the python class to load.- Parameters:
cEleId
- : The id of the ASCEcEleRunningId
- : the running ID of the ASCEvalidityTimeFrame
- : The time frame (msec) to invalidate monitor pointsprops
- : The properties for the executorpythonClassName
- : The name of the python class to which to delegate- Throws:
Exception
-
-
Method Details
-
eval
Run the TF by delegating to the python implementation in th eproper thread- Specified by:
eval
in classJavaTransferExecutor<T>
- Parameters:
compInputs
- : the inputs to the ASCEactualOutput
- : the actual output of the ASCE- Returns:
- the new output
- Throws:
Exception
-
initialize
public void initialize(Set<org.eso.ias.asce.transfer.IasioInfo> inputsInfo, org.eso.ias.asce.transfer.IasioInfo outputInfo) throws Exception Description copied from class:JavaTransferExecutor
Initialize the transfer function- Specified by:
initialize
in classJavaTransferExecutor<T>
- Parameters:
inputsInfo
- The IDs and types of the inputsoutputInfo
- The Id and type of thr output- Throws:
Exception
- in case of errors
-
shutdown
Description copied from class:TransferExecutor
Shuts down the BehaviorRunner when the IAS does not need it anymore. This life cycle method is called last, to clean up the resources. It is supposed to return quickly, even if not mandatory.- Specified by:
shutdown
in classTransferExecutor
- Throws:
Exception
- In case of error shutting down
-