ProcessVariableValue Interface
- public interface ProcessVariableValue
extends Serializable
Represents the value of a process variable on a client that is not running within the server JVM.
This representation is needed because the client who is requesting the values of variables may not
have all the classes in its classpath, and simply returning a value would cause a
ClassNotFoundException
. This class attempts to solve this problem by providing
a representation for values whose class may or may not be known by the client.
This class is also used to pass a short representation of a variable value.
-
All Superinterfaces
-
Serializable
deserializeValue() Method
public Object
deserializeValue()
throws IOException
, ClassNotFoundException
Convenience method for constructing the value object from its serialized form.
This method should only be called if ProcessVariableValue.isSerializedValueRep()
returns true
Exceptions
-
IOException
-
ClassNotFoundException
- if the class for the object being represented is not found.
getDeclaredType() Method
public String
getDeclaredType()
Returns the declared type of the variable.
getName() Method
public String
getName()
Returns the name of the process variable whose value is represented
getOriginalInstanceType() Method
public String
getOriginalInstanceType()
Returns the original type of the value
getValueRepresentation() Method
public Object
getValueRepresentation()
Returns a representation of the value of the process variable. Depending on the
type(class) of the process variable one of the following values is returned.
if this object represents the summary value of a variable the result is always String and
the value of String is obtained by calling the toString method on the original value. The
value will be truncated if it is large. The size is system dependent. However short representation of
XML values and RawData is always null. This is done in order to avoid materializing potentially huge
amounts of data.
otherwise if the variable is a primitive type the return type will be the class type of the
primitive type. e.g., a value of type Integer
will be returned
if the variable type is int.
otherwise if the variable is a String, or a class type of a primitive type (e.g., Integer
then the original value is returned.
otherwise if the variable is an XML type then an untyped XmlObject
is returned,
regardless of the type of the xml.
otherwise if the variable is an instance of RawData
, the result is a byte array
containing the bytes of the raw data.
otherwise if the variable is an instance of throwable then the type of the return value will be
the same as the original throwable value provided that it is on clients classpath. If the throwable
is not on clients classpath then an approximate representation of the original throwable value is returned.
See WrappedThrowable
for more information about simple form of throwables.
Otherwise If the variable can be serialized without errors the result will be the byte array representing
the serialized value. See ProcessVariableValue.deserializeValue()
for obtaining the original value.
Otherwise the variable is not representable on the client and a null value is returned. Note
that a null value may indicate a proper value rather than representability of a value. Consult
ProcessVariableValue.isUnrepresentableValue()
before using the value.
Always use ProcessVariableValue.isTooLarge()
, ProcessVariableValue.isObjectValueRep()
, ProcessVariableValue.isSerializedValueRep()
,
ProcessVariableValue.isUnrepresentableValue()
to interpret the return value of this method.
isObjectValueRep() Method
public boolean isObjectValueRep()
Returns true if the value of the variable obtained via ProcessVariableValue.getValueRepresentation()
is some form of the original value, rather than serialized value.
isSerializedValueRep() Method
public boolean isSerializedValueRep()
Returns true if the value of the variable is repesented in its serialized form. This
implies that ProcessVariableValue.getValueRepresentation()
returns the serialized form in a byte array.
You should first try to get the deserialized (original) Object via ProcessVariableValue.deserializeValue()
.
isShortRepresentation() Method
public boolean isShortRepresentation()
Returns true if this object contains a short String based representation of the variable value.
If so the value returned by ProcessVariableValue.getValueRepresentation()
will always be a String (possibly null)
subject to size limitations.
isTooLarge() Method
public boolean isTooLarge()
Returns true if the object was too large. If so the value returned by ProcessVariableValue.getValueRepresentation()
will always be null.
isUnrepresentableValue() Method
public boolean isUnrepresentableValue()
Returns true if the value of the variable cannot be represented outside the server JVM,
and therefore is unavailable.
isXMLType() Method
public boolean isXMLType()
Returns if the declared type is an XML type.