Class SettableDataContext
- java.lang.Object
-
- de.aristaflow.adept2.model.common.defaultimplementation.DefaultUserAttributeContainer
-
- de.aristaflow.adept2.model.common.defaultimplementation.DefaultPluginDataContainer
-
- de.aristaflow.adept2.model.common.defaultimplementation.SerialisablePluginDataContainer
-
- de.aristaflow.adept2.model.runtimeenvironment.SettableDataContext
-
- All Implemented Interfaces:
PluginDataContainer,UserAttributeContainer,InputDataContext,DataContext,Serializable
public class SettableDataContext extends de.aristaflow.adept2.model.common.defaultimplementation.SerialisablePluginDataContainer implements DataContext
ASettableDataContextallows to set the arbitrary input and output parameters as well as the corresponding values. This allows for using a data context with arbitrary parameters and values and also retrieving the values of output parameters after usage. This way this data context serves the same purpose as anInstanceDataContainer.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Cleanup<RuntimeException>cleanupThe clean-up for closing theCloseableparameter values.protected static StringCLEANUP_NAMEThe object descriptor for the clean-up registered forSettableDataContextinstances.protected HashMap<String,ProcessModelParameter>inputParamsA map of all input parameters, mapping the name of a parameter to the corresponding parameter object.protected LoggerloggerThe logger for logging messages instead of throwing exceptions.protected HashMap<String,ProcessModelParameter>outputParamsA map of all output parameters, mapping the name of a parameter to the corresponding parameter object.protected ReadWriteLockvalueLockThe lock for synchronising access to the values of this data context.protected HashMap<String,Serializable>valuesThe value of the input and output parameters.
-
Constructor Summary
Constructors Constructor Description SettableDataContext()Deprecated, for removal: This API element is subject to removal in a future version.UseSettableDataContext(Logger)instead.SettableDataContext(Logger logger)Creates a newSettableDataContextwith no parameters and no values.SettableDataContext(Map<String,Serializable> values, Map<String,ProcessModelParameter> inputParams, Map<String,ProcessModelParameter> outputParams)Deprecated, for removal: This API element is subject to removal in a future version.UseSettableDataContext(Map, Map, Map, Logger)instead.SettableDataContext(Map<String,Serializable> values, Map<String,ProcessModelParameter> inputParams, Map<String,ProcessModelParameter> outputParams, Logger logger)Creates a newSettableDataContextwith the designated parameters and values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInputParameter(ProcessModelParameter param, Serializable value)Adds the designated parameter as input parameter to this data context having the designated value.voidaddOutputParameter(ProcessModelParameter param)Adds the designated parameter as output parameter to this data context.protected voidcheckInputExistence(String parameterName)Checks whether the designated parameter is an input parameter (exists in the input parameter map).protected voidcheckInputExistenceAndType(String parameterName, ProcessConstants.AdeptDataType expectedType)Checks whether the designated parameter is an input parameter (exists in the input parameter map) and whether it is of the Java-type corresponding to the designated expected ADEPT-data type.protected voidcheckOutputExistence(String parameterName)Checks whether the designated parameter is an output parameter (exists in the output parameter map).protected voidcheckOutputExistenceAndType(String parameterName, ProcessConstants.AdeptDataType expectedType)Checks whether the designated parameter is an output parameter (exists in the output parameter map) and whether it is of the Java-type corresponding to the designated expected ADEPT-data type.protected voidcheckOutputIgnored(String parameterName)Check whether the actual output parameter isnull.protected voidcheckType(Object value, ProcessConstants.AdeptDataType expectedType)Checks whether the designated value is of the Java-type corresponding to the designated ADEPT-data type.Map<String,Serializable>getValues()Returns the values set for the data context, that is a mapping from parameter names to the corresponding values as Java-objects.booleanignoredValue(String parameterName)Returns whether the value of the designated output parameter is not or has not been set (ignored) by the application.voidignoreValue(String parameterName)Ignores the value of the designated parameter that is the value has not been written.booleanisNull(String parameterName)Returns whether the value of the designated parameter is NULL which means the data element has not been written or has been consumed yet or has been explicitly set to NULL by a previous application.booleanisReadOnly()Returns whether this data container is read only and therefore does not allow to store values (and throws anUnsupportedOperationExceptionat the corresponding methods).booleanretrieveBooleanParameterValue(String parameterName)Reads from an input parameter.DateretrieveDateParameterValue(String parameterName)Reads from an input parameter.doubleretrieveFloatParameterValue(String parameterName)Reads from an input parameter.longretrieveIntegerParameterValue(String parameterName)Reads from an input parameter.StringretrieveStringParameterValue(String parameterName)Reads from an input parameter.UDTValueretrieveUDTParameterValue(String parameterName)Reads from an input parameter.URIretrieveURIParameterValue(String parameterName)Reads from an input parameter.voidstoreBooleanParameterValue(String parameterName, boolean value)Writes an output parameter of the type boolean to the data container of the process management system.voidstoreDateParameterValue(String parameterName, Date value)Writes an output parameter of the type date to the data context of the process management system.booleanstoredBooleanParameterValue(String parameterName)Reads the boolean value of the designated output parameter.DatestoredDateParameterValue(String parameterName)Reads the date value of the designated output parameter.doublestoredFloatParameterValue(String parameterName)Reads the double value of the designated output parameter.longstoredIntegerParameterValue(String parameterName)Reads the long value of the designated output parameter.StringstoredStringParameterValue(String parameterName)Reads the string value of the designated output parameter.UDTValuestoredUDTParameterValue(String parameterName)Reads the value of the designated output parameter of user-defined type.URIstoredURIParameterValue(String parameterName)Reads the URI value of the designated output parameter.voidstoreFloatParameterValue(String parameterName, double value)Writes an output parameter of the type float to the data container of the process management system.voidstoreIntegerParameterValue(String parameterName, long value)Writes an output parameter of the type integer (in java: long) to the data context of the process management system.voidstoreStringParameterValue(String parameterName, String value)Writes an output parameter of type String to the data container of the process management system.voidstoreUDTParameterValue(String parameterName, UDTValue value)Writes an output parameter of an user defined type to the data container of the process management system.voidstoreURIParameterValue(String parameterName, URI value)Writes an output parameter of type URI to the data container of the process management system.booleansubEquals(Object obj)An implementation ofObject.equals(Object)for various purpose.intsubHashCode()An implementation ofObject.hashCode()for various purpose.-
Methods inherited from class de.aristaflow.adept2.model.common.defaultimplementation.DefaultPluginDataContainer
addSupportedPlugin, getPluginData, getPluginDatas, getSupportedPlugins, removeSupportedPlugin
-
Methods inherited from class de.aristaflow.adept2.model.common.defaultimplementation.DefaultUserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributes, setUserAttributeValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.model.common.PluginDataContainer
getPluginData, getPluginDatas, getSupportedPlugins
-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
-
-
-
Field Detail
-
CLEANUP_NAME
protected static final String CLEANUP_NAME
The object descriptor for the clean-up registered forSettableDataContextinstances.- See Also:
- Constant Field Values
-
cleanup
protected transient Cleanup<RuntimeException> cleanup
The clean-up for closing theCloseableparameter values.
-
logger
protected transient Logger logger
The logger for logging messages instead of throwing exceptions. This will be a decoupled logger for the classname after deserialisation.
-
valueLock
protected transient ReadWriteLock valueLock
The lock for synchronising access to the values of this data context.
-
values
protected final HashMap<String,Serializable> values
The value of the input and output parameters. If a parameter is not in the list its value is expected to be null.
-
inputParams
protected final HashMap<String,ProcessModelParameter> inputParams
A map of all input parameters, mapping the name of a parameter to the corresponding parameter object.
-
outputParams
protected final HashMap<String,ProcessModelParameter> outputParams
A map of all output parameters, mapping the name of a parameter to the corresponding parameter object.
-
-
Constructor Detail
-
SettableDataContext
@Deprecated(since="15.0.0", forRemoval=true) public SettableDataContext()
Deprecated, for removal: This API element is subject to removal in a future version.UseSettableDataContext(Logger)instead.Creates a newSettableDataContextwith no parameters and no values.
-
SettableDataContext
public SettableDataContext(Logger logger)
Creates a newSettableDataContextwith no parameters and no values.- Parameters:
logger- The logger of the using service-instance specific for this class.
-
SettableDataContext
@Deprecated(since="15.0.0", forRemoval=true) public SettableDataContext(Map<String,Serializable> values, Map<String,ProcessModelParameter> inputParams, Map<String,ProcessModelParameter> outputParams)
Deprecated, for removal: This API element is subject to removal in a future version.UseSettableDataContext(Map, Map, Map, Logger)instead.Creates a newSettableDataContextwith the designated parameters and values. Please ensure that the maps are consistent, that is the value-map contains only parameters that are either in the input or in the output parameter map. Additionally, all mandatory input parameter need to have a value in the value map.- Parameters:
values- The values of the parameters, mapping the parameter names to the corresponding values.
The caller is responsible for closing the values if appropriate.inputParams- The input parameters for the data context mapping the parameter name to the corresponding parameter object.outputParams- The output parameters for the data context mapping the parameter name to the corresponding parameter object.
-
SettableDataContext
public SettableDataContext(Map<String,Serializable> values, Map<String,ProcessModelParameter> inputParams, Map<String,ProcessModelParameter> outputParams, Logger logger)
Creates a newSettableDataContextwith the designated parameters and values. Please ensure that the maps are consistent, that is the value-map contains only parameters that are either in the input or in the output parameter map. Additionally, all mandatory input parameter need to have a value in the value map.- Parameters:
values- The values of the parameters, mapping the parameter names to the corresponding values.
The caller is responsible for closing the values if appropriate.inputParams- The input parameters for the data context mapping the parameter name to the corresponding parameter object.outputParams- The output parameters for the data context mapping the parameter name to the corresponding parameter object.logger- The logger of the using service-instance specific for this class.
-
-
Method Detail
-
addInputParameter
public void addInputParameter(ProcessModelParameter param, Serializable value)
Adds the designated parameter as input parameter to this data context having the designated value. If you need to have it as output parameter as well, alsoadd it as output parameter. If the value is not set yet, usenullas value. But do not providenullfor a mandatory input parameter!- Parameters:
param- The parameter to add as input parameter to this data context.value- The value of the input parameter (may benull). The caller is responsible for closing if appropriate.- Throws:
ClassCastException- If the designated value is not of the Java-type corresponding to the ADEPT-data type of the designated parameter, aClassCastExceptionwill be thrown.
-
addOutputParameter
public void addOutputParameter(ProcessModelParameter param)
Adds the designated parameter as output parameter to this data context. If you need to have it as input parameter as well, alsoadd it as input parameter.- Parameters:
param- The parameter to add as output parameter to this data context.
-
getValues
public Map<String,Serializable> getValues()
Returns the values set for the data context, that is a mapping from parameter names to the corresponding values as Java-objects.- Returns:
- All values as mapping from parameter names to the values as Java-objects.
The values will be coupled to thisDataContext, so do not close them; clone them if required longer than thisDataContext.
-
checkType
protected void checkType(Object value, ProcessConstants.AdeptDataType expectedType)
Checks whether the designated value is of the Java-type corresponding to the designated ADEPT-data type.- Parameters:
value- The value to check the type of.expectedType- The ADEPT-data type that the value is expected to be.- Throws:
ClassCastException- If the designated value is not of an appropriate type, aClassCastExceptionwill be thrown.
-
isNull
public boolean isNull(String parameterName) throws NoSuchParameterException
Description copied from interface:InputDataContextReturns whether the value of the designated parameter is NULL which means the data element has not been written or has been consumed yet or has been explicitly set to NULL by a previous application. This method has to be called before retrieving a value.- Specified by:
isNullin interfaceInputDataContext- Parameters:
parameterName- The name of the parameter to check on NULL.- Returns:
trueif the value of the designated parameter is NULL and therefore has not been written or has been consumed yet.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.
-
retrieveIntegerParameterValue
public long retrieveIntegerParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of type long.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveIntegerParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type INTEGER, anInvalidDataTypeExceptionwill be raised.
-
retrieveFloatParameterValue
public double retrieveFloatParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of type double.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveFloatParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type FLOAT, anInvalidDataTypeExceptionwill be raised.
-
retrieveBooleanParameterValue
public boolean retrieveBooleanParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of type boolean.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveBooleanParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type BOOLEAN, anInvalidDataTypeExceptionwill be raised.
-
retrieveStringParameterValue
public String retrieveStringParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of type String.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveStringParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type STRING, anInvalidDataTypeExceptionwill be raised.
-
retrieveDateParameterValue
public Date retrieveDateParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of typejava.util.Date.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveDateParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type DATE, anInvalidDataTypeExceptionwill be raised.
-
retrieveURIParameterValue
public URI retrieveURIParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of type URI.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveURIParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter.
- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type URI, anInvalidDataTypeExceptionwill be raised.
-
retrieveUDTParameterValue
public UDTValue retrieveUDTParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContextReads from an input parameter. The associated value must be of an user-defined type.
Callers should first check whether the value is NULL by callingInputDataContext.isNull(String). Otherwise in case of NULL anIllegalStateExceptionwill be thrown.- Specified by:
retrieveUDTParameterValuein interfaceInputDataContext- Parameters:
parameterName- the name of the input parameter to be read- Returns:
- The value for the designated input parameter. The UDTValue will be coupled
to this
InputDataContext, so do not close it; clone it if required longer than thisInputDataContext. - Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type UDT, anInvalidDataTypeExceptionwill be raised.
-
checkInputExistence
protected void checkInputExistence(String parameterName) throws NoSuchParameterException
Checks whether the designated parameter is an input parameter (exists in the input parameter map).- Parameters:
parameterName- The name of the input parameter to check for its existence.- Throws:
NoSuchParameterException- If the designated parameter name is not known as input parameter, aNoSuchParameterExceptionwill be thrown.
-
checkInputExistenceAndType
protected void checkInputExistenceAndType(String parameterName, ProcessConstants.AdeptDataType expectedType) throws NoSuchParameterException, InvalidDataTypeException
Checks whether the designated parameter is an input parameter (exists in the input parameter map) and whether it is of the Java-type corresponding to the designated expected ADEPT-data type. If the value of the input parameter is NULL anIllegalStateExceptionis thrown.- Parameters:
parameterName- The name of the input parameter to check for its existence and type.expectedType- The type that is expected for the designated parameter.- Throws:
NoSuchParameterException- If the designated parameter name is not known as input parameter, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is known but its value is not of the Java-type corresponding to the designated expected type.IllegalStateException- If the value of the designated parameter is null anIllegalStateExceptionwill be thrown.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DataContextReturns whether this data container is read only and therefore does not allow to store values (and throws anUnsupportedOperationExceptionat the corresponding methods).- Specified by:
isReadOnlyin interfaceDataContext- Returns:
- Whether this data container is read only and therefore does not allow to store values.
-
ignoreValue
public void ignoreValue(String parameterName) throws NoSuchParameterException
Description copied from interface:DataContextIgnores the value of the designated parameter that is the value has not been written.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
ignoreValuein interfaceDataContext- Parameters:
parameterName- The name of the parameter to be ignored.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.
-
ignoredValue
public boolean ignoredValue(String parameterName) throws NoSuchParameterException
Description copied from interface:DataContextReturns whether the value of the designated output parameter is not or has not been set (ignored) by the application.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
ignoredValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to check for being unset.- Returns:
trueif the value of the designated output parameter is or has not been written.- Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.
-
storeIntegerParameterValue
public void storeIntegerParameterValue(String parameterName, long value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of the type integer (in java: long) to the data context of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeIntegerParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type INTEGER, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedIntegerParameterValue
public long storedIntegerParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the long value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedIntegerParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the parameter of ADEPT2-type INTEGER and of Java-type
long. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type INTEGER, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.INTEGER
-
storeFloatParameterValue
public void storeFloatParameterValue(String parameterName, double value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of the type float to the data container of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeFloatParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type FLOAT, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedFloatParameterValue
public double storedFloatParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the double value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedFloatParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the output parameter of ADEPT2-type FLOAT and of Java-type
double. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type FLOAT, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.FLOAT
-
storeBooleanParameterValue
public void storeBooleanParameterValue(String parameterName, boolean value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of the type boolean to the data container of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeBooleanParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type BOOLEAN, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedBooleanParameterValue
public boolean storedBooleanParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the boolean value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedBooleanParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the output parameter of ADEPT2-type BOOLEAN and of Java-type
boolean. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type BOOLEAN, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.BOOLEAN
-
storeStringParameterValue
public void storeStringParameterValue(String parameterName, String value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of type String to the data container of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeStringParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type STRING, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedStringParameterValue
public String storedStringParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the string value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedStringParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the output parameter of ADEPT2-type STRING and of Java-type
String. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type STRING, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.STRING
-
storeDateParameterValue
public void storeDateParameterValue(String parameterName, Date value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of the type date to the data context of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeDateParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type DATE, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedDateParameterValue
public Date storedDateParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the date value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedDateParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the parameter of ADEPT2-type DATE and of Java-type
java.util.Date. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type DATE, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.DATE
-
storeURIParameterValue
public void storeURIParameterValue(String parameterName, URI value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of type URI to the data container of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeURIParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type URI, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedURIParameterValue
public URI storedURIParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the URI value of the designated output parameter.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedURIParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the parameter of ADEPT2-type URI and of Java-type
java.net.URI. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the output designated parameter is not of type URI, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.URI
-
storeUDTParameterValue
public void storeUDTParameterValue(String parameterName, UDTValue value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextWrites an output parameter of an user defined type to the data container of the process management system. The RuntimeEnvironment executes some management routines, e. g. access control, and delegates the function call to the DataContainer object.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeUDTParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be written.value- The value that is written for the designated output parameter. The caller is responsible for closing.- Throws:
NoSuchParameterException- If the parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is not of type UDT, anInvalidDataTypeExceptionwill be raised.- See Also:
DataContainer
-
storedUDTParameterValue
public UDTValue storedUDTParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContextReads the value of the designated output parameter of user-defined type.
AnInvalidExecutorThreadExceptionwill be thrown if the method is not called by the main thread of the corresponding component.
Callers should first check whether the value is null by callingDataContext.ignoredValue(String). Otherwise in case of NULL anIllegalStateExceptionis thrown.- Specified by:
storedUDTParameterValuein interfaceDataContext- Parameters:
parameterName- The name of the output parameter to be read.- Returns:
- The value of the output parameter of ADEPT2-type USERDEFINED and of Java-type
UDTValue. The UDTValue will be coupled to thisDataContext, so do not close it; clone it if required longer than thisDataContext. - Throws:
NoSuchParameterException- If the output parameter of the designated name does not exist, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated output parameter is not of type USERDEFINED, anInvalidDataTypeExceptionwill be raised.- See Also:
ProcessConstants.AdeptDataType.USERDEFINED
-
checkOutputExistence
protected void checkOutputExistence(String parameterName) throws NoSuchParameterException
Checks whether the designated parameter is an output parameter (exists in the output parameter map).- Parameters:
parameterName- The name of the output parameter to check for its existence.- Throws:
NoSuchParameterException- If the designated parameter name is not known as output parameter, aNoSuchParameterExceptionwill be thrown.
-
checkOutputExistenceAndType
protected void checkOutputExistenceAndType(String parameterName, ProcessConstants.AdeptDataType expectedType) throws NoSuchParameterException, InvalidDataTypeException
Checks whether the designated parameter is an output parameter (exists in the output parameter map) and whether it is of the Java-type corresponding to the designated expected ADEPT-data type.- Parameters:
parameterName- The name of the output parameter to check for its existence and type.expectedType- The type that is expected for the designated parameter.- Throws:
NoSuchParameterException- If the designated parameter name is not known as output parameter, aNoSuchParameterExceptionwill be thrown.InvalidDataTypeException- If the designated parameter is known but its value is not of the Java-type corresponding to the designated expected type.
-
checkOutputIgnored
protected void checkOutputIgnored(String parameterName) throws NoSuchParameterException
Check whether the actual output parameter isnull. In case of NULL anIllegalStateExceptionwill thrown.- Parameters:
parameterName- The name of the output parameter to check.- Throws:
NoSuchParameterException- If the designated parameter name is not known as output parameter, aNoSuchParameterExceptionwill be thrown.IllegalStateException- If the value of the designated parameter is NULL anIllegalStateExceptionwill be thrown.
-
subEquals
public boolean subEquals(Object obj)
An implementation ofObject.equals(Object)for various purpose. Due to several reasons we do not want actually overrideObject.equals(Object).- Overrides:
subEqualsin classde.aristaflow.adept2.model.common.defaultimplementation.DefaultPluginDataContainer- Parameters:
obj- The object with which to compare.- Returns:
- Whether this is the same object as the designated one.
-
subHashCode
public int subHashCode()
An implementation ofObject.hashCode()for various purpose. Due to several reasons we do not want actually overrideObject.hashCode().
The implementation conforms to the implementation ofsubEquals(Object)with respect toObject.equals(Object).- Overrides:
subHashCodein classde.aristaflow.adept2.model.common.defaultimplementation.DefaultPluginDataContainer- Returns:
- A hash code value for this object.
-
-