Package org.eso.ias.asce.transfer
Class JavaTransferExecutor<T>
java.lang.Object
org.eso.ias.asce.transfer.TransferExecutor
org.eso.ias.asce.transfer.JavaTransferExecutor<T>
- Direct Known Subclasses:
MinMaxThresholdTFJava
,PythonExecutorTF
The JavaTransferExecutor provides the interface
for java implementators of the transfer function
as java data structs differ from scala ones.
- Author:
- acaproni
-
Field Summary
Fields inherited from class org.eso.ias.asce.transfer.TransferExecutor
compElementId, compElementRunningId, props, validityTimeFrame
-
Constructor Summary
ConstructorDescriptionJavaTransferExecutor
(String cEleId, String cEleRunningId, long validityTimeFrame, Properties props) Constructor -
Method Summary
Modifier and TypeMethodDescriptionProduces the output of the component by evaluating the inputs.protected final IasIOJ<?>
This method transparently return a value from the passed ID, being the ASCE templated or not.protected final IasIOJ<?>
This method is mostly to get templated input instances for which the instance, not known to the ACSE, must be passed.abstract void
initialize
(Set<org.eso.ias.asce.transfer.IasioInfo> inputsInfo, org.eso.ias.asce.transfer.IasioInfo outputInfo) Initialize the transfer functionMethods inherited from class org.eso.ias.asce.transfer.TransferExecutor
getTemplateInstance, isTemplated, setTemplateInstance, shutdown
-
Constructor Details
-
JavaTransferExecutor
public JavaTransferExecutor(String cEleId, String cEleRunningId, long validityTimeFrame, Properties props) Constructor- 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 executor
-
-
Method Details
-
getValue
protected final IasIOJ<?> getValue(Map<String, IasIOJ<?>> inputs, String id, Optional<Integer> instance) This method is mostly to get templated input instances for which the instance, not known to the ACSE, must be passed. If the instance is empty, it delegates togetValue(Map, String)
.- Parameters:
inputs
- the map of the inputsid
- The (non templated) identifier of the valueinstance
- The instance defined for templated input instances- Returns:
- the IASValue of the given ID or
null
if a IASValue with the passed id is not in the map
-
getValue
This method transparently return a value from the passed ID, being the ASCE templated or not. If the ASCE is not templated, this method delegates toMap.get(Object)
. If the ASCE is generated out of a template, its inputs can or cannot be generated out of the same template. In the latter, their identifiers must be enriched with the number of the instance.- Parameters:
inputs
- the map of the inputsid
- The (non templated) identifier of the value- Returns:
- the IASValue of the given ID or
null
if a IASValue with the passed id is not in the map
-
eval
public abstract IasIOJ<T> eval(Map<String, IasIOJ<?>> compInputs, IasIOJ<T> actualOutput) throws ExceptionProduces the output of the component by evaluating the inputs. IMPLEMENTATION NOTE TheIASValue
is immutable. The easiest way to produce the output to return is to execute the methods of the actualOutput that return a new IASValue.- Parameters:
compInputs
- : the inputs to the ASCEactualOutput
- : the actual output of the ASCE- Returns:
- the computed value to set as output of the ASCE
- Throws:
Exception
- in case of error
-
initialize
public abstract void initialize(Set<org.eso.ias.asce.transfer.IasioInfo> inputsInfo, org.eso.ias.asce.transfer.IasioInfo outputInfo) throws Exception Initialize the transfer function- Parameters:
inputsInfo
- The IDs and types of the inputsoutputInfo
- The Id and type of thr output- Throws:
Exception
- in case of errors
-