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
ASettableDataContext
allows 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>
cleanup
The clean-up for closing theCloseable
parameter values.protected static String
CLEANUP_NAME
The object descriptor for the clean-up registered forSettableDataContext
instances.protected HashMap<String,ProcessModelParameter>
inputParams
A map of all input parameters, mapping the name of a parameter to the corresponding parameter object.protected Logger
logger
The logger for logging messages instead of throwing exceptions.protected HashMap<String,ProcessModelParameter>
outputParams
A map of all output parameters, mapping the name of a parameter to the corresponding parameter object.protected ReadWriteLock
valueLock
The lock for synchronising access to the values of this data context.protected HashMap<String,Serializable>
values
The 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 newSettableDataContext
with 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 newSettableDataContext
with the designated parameters and values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInputParameter(ProcessModelParameter param, Serializable value)
Adds the designated parameter as input parameter to this data context having the designated value.void
addOutputParameter(ProcessModelParameter param)
Adds the designated parameter as output parameter to this data context.protected void
checkInputExistence(String parameterName)
Checks whether the designated parameter is an input parameter (exists in the input parameter map).protected void
checkInputExistenceAndType(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 void
checkOutputExistence(String parameterName)
Checks whether the designated parameter is an output parameter (exists in the output parameter map).protected void
checkOutputExistenceAndType(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 void
checkOutputIgnored(String parameterName)
Check whether the actual output parameter isnull
.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.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.boolean
ignoredValue(String parameterName)
Returns whether the value of the designated output parameter is not or has not been set (ignored) by the application.void
ignoreValue(String parameterName)
Ignores the value of the designated parameter that is the value has not been written.boolean
isNull(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.boolean
isReadOnly()
Returns whether this data container is read only and therefore does not allow to store values (and throws anUnsupportedOperationException
at the corresponding methods).boolean
retrieveBooleanParameterValue(String parameterName)
Reads from an input parameter.Date
retrieveDateParameterValue(String parameterName)
Reads from an input parameter.double
retrieveFloatParameterValue(String parameterName)
Reads from an input parameter.long
retrieveIntegerParameterValue(String parameterName)
Reads from an input parameter.String
retrieveStringParameterValue(String parameterName)
Reads from an input parameter.UDTValue
retrieveUDTParameterValue(String parameterName)
Reads from an input parameter.URI
retrieveURIParameterValue(String parameterName)
Reads from an input parameter.void
storeBooleanParameterValue(String parameterName, boolean value)
Writes an output parameter of the type boolean to the data container of the process management system.void
storeDateParameterValue(String parameterName, Date value)
Writes an output parameter of the type date to the data context of the process management system.boolean
storedBooleanParameterValue(String parameterName)
Reads the boolean value of the designated output parameter.Date
storedDateParameterValue(String parameterName)
Reads the date value of the designated output parameter.double
storedFloatParameterValue(String parameterName)
Reads the double value of the designated output parameter.long
storedIntegerParameterValue(String parameterName)
Reads the long value of the designated output parameter.String
storedStringParameterValue(String parameterName)
Reads the string value of the designated output parameter.UDTValue
storedUDTParameterValue(String parameterName)
Reads the value of the designated output parameter of user-defined type.URI
storedURIParameterValue(String parameterName)
Reads the URI value of the designated output parameter.void
storeFloatParameterValue(String parameterName, double value)
Writes an output parameter of the type float to the data container of the process management system.void
storeIntegerParameterValue(String parameterName, long value)
Writes an output parameter of the type integer (in java: long) to the data context of the process management system.void
storeStringParameterValue(String parameterName, String value)
Writes an output parameter of type String to the data container of the process management system.void
storeUDTParameterValue(String parameterName, UDTValue value)
Writes an output parameter of an user defined type to the data container of the process management system.void
storeURIParameterValue(String parameterName, URI value)
Writes an output parameter of type URI to the data container of the process management system.boolean
subEquals(Object obj)
An implementation ofObject.equals(Object)
for various purpose.int
subHashCode()
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 forSettableDataContext
instances.- See Also:
- Constant Field Values
-
cleanup
protected transient Cleanup<RuntimeException> cleanup
The clean-up for closing theCloseable
parameter 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 newSettableDataContext
with no parameters and no values.
-
SettableDataContext
public SettableDataContext(Logger logger)
Creates a newSettableDataContext
with 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 newSettableDataContext
with 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 newSettableDataContext
with 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, usenull
as value. But do not providenull
for 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, aClassCastException
will 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, aClassCastException
will be thrown.
-
isNull
public boolean isNull(String parameterName) throws NoSuchParameterException
Description copied from interface:InputDataContext
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. This method has to be called before retrieving a value.- Specified by:
isNull
in interfaceInputDataContext
- Parameters:
parameterName
- The name of the parameter to check on NULL.- Returns:
true
if 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, aNoSuchParameterException
will be thrown.
-
retrieveIntegerParameterValue
public long retrieveIntegerParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveIntegerParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type INTEGER, anInvalidDataTypeException
will be raised.
-
retrieveFloatParameterValue
public double retrieveFloatParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveFloatParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type FLOAT, anInvalidDataTypeException
will be raised.
-
retrieveBooleanParameterValue
public boolean retrieveBooleanParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveBooleanParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type BOOLEAN, anInvalidDataTypeException
will be raised.
-
retrieveStringParameterValue
public String retrieveStringParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveStringParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type STRING, anInvalidDataTypeException
will be raised.
-
retrieveDateParameterValue
public Date retrieveDateParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveDateParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type DATE, anInvalidDataTypeException
will be raised.
-
retrieveURIParameterValue
public URI retrieveURIParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveURIParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type URI, anInvalidDataTypeException
will be raised.
-
retrieveUDTParameterValue
public UDTValue retrieveUDTParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:InputDataContext
Reads 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 anIllegalStateException
will be thrown.- Specified by:
retrieveUDTParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type UDT, anInvalidDataTypeException
will 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, aNoSuchParameterException
will 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 anIllegalStateException
is 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, aNoSuchParameterException
will 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 anIllegalStateException
will be thrown.
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DataContext
Returns whether this data container is read only and therefore does not allow to store values (and throws anUnsupportedOperationException
at the corresponding methods).- Specified by:
isReadOnly
in 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:DataContext
Ignores the value of the designated parameter that is the value has not been written.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
ignoreValue
in interfaceDataContext
- Parameters:
parameterName
- The name of the parameter to be ignored.- Throws:
NoSuchParameterException
- If the parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.
-
ignoredValue
public boolean ignoredValue(String parameterName) throws NoSuchParameterException
Description copied from interface:DataContext
Returns whether the value of the designated output parameter is not or has not been set (ignored) by the application.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
ignoredValue
in interfaceDataContext
- Parameters:
parameterName
- The name of the output parameter to check for being unset.- Returns:
true
if 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, aNoSuchParameterException
will be thrown.
-
storeIntegerParameterValue
public void storeIntegerParameterValue(String parameterName, long value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeIntegerParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type INTEGER, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedIntegerParameterValue
public long storedIntegerParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the long value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedIntegerParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type INTEGER, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.INTEGER
-
storeFloatParameterValue
public void storeFloatParameterValue(String parameterName, double value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeFloatParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type FLOAT, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedFloatParameterValue
public double storedFloatParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the double value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedFloatParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type FLOAT, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.FLOAT
-
storeBooleanParameterValue
public void storeBooleanParameterValue(String parameterName, boolean value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeBooleanParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type BOOLEAN, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedBooleanParameterValue
public boolean storedBooleanParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the boolean value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedBooleanParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type BOOLEAN, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.BOOLEAN
-
storeStringParameterValue
public void storeStringParameterValue(String parameterName, String value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeStringParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type STRING, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedStringParameterValue
public String storedStringParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the string value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedStringParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type STRING, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.STRING
-
storeDateParameterValue
public void storeDateParameterValue(String parameterName, Date value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeDateParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type DATE, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedDateParameterValue
public Date storedDateParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the date value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedDateParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type DATE, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.DATE
-
storeURIParameterValue
public void storeURIParameterValue(String parameterName, URI value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeURIParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type URI, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedURIParameterValue
public URI storedURIParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the URI value of the designated output parameter.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedURIParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the output designated parameter is not of type URI, anInvalidDataTypeException
will be raised.- See Also:
ProcessConstants.AdeptDataType.URI
-
storeUDTParameterValue
public void storeUDTParameterValue(String parameterName, UDTValue value) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Writes 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.
AnInvalidExecutorThreadException
will be thrown if the method is not called by the main thread of the corresponding component.- Specified by:
storeUDTParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated parameter is not of type UDT, anInvalidDataTypeException
will be raised.- See Also:
DataContainer
-
storedUDTParameterValue
public UDTValue storedUDTParameterValue(String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Description copied from interface:DataContext
Reads the value of the designated output parameter of user-defined type.
AnInvalidExecutorThreadException
will 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 anIllegalStateException
is thrown.- Specified by:
storedUDTParameterValue
in 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, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated output parameter is not of type USERDEFINED, anInvalidDataTypeException
will 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, aNoSuchParameterException
will 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, aNoSuchParameterException
will 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 anIllegalStateException
will thrown.- Parameters:
parameterName
- The name of the output parameter to check.- Throws:
NoSuchParameterException
- If the designated parameter name is not known as output parameter, aNoSuchParameterException
will be thrown.IllegalStateException
- If the value of the designated parameter is NULL anIllegalStateException
will 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:
subEquals
in 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:
subHashCode
in classde.aristaflow.adept2.model.common.defaultimplementation.DefaultPluginDataContainer
- Returns:
- A hash code value for this object.
-
-