com.bea.wli.management.runtime
Interface ProcessVariableValue

All Superinterfaces:
Serializable

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.


Method Summary
 Object deserializeValue()
          Convenience method for constructing the value object from its serialized form.
 String getDeclaredType()
          Returns the declared type of the variable.
 String getName()
          Returns the name of the process variable whose value is represented
 String getOriginalInstanceType()
          Returns the original type of the value
 Object getValueRepresentation()
          Returns a representation of the value of the process variable.
 boolean isObjectValueRep()
          Returns true if the value of the variable obtained via getValueRepresentation() is some form of the original value, rather than serialized value.
 boolean isSerializedValueRep()
          Returns true if the value of the variable is repesented in its serialized form.
 boolean isShortRepresentation()
          Returns true if this object contains a short String based representation of the variable value.
 boolean isTooLarge()
          Returns true if the object was too large.
 boolean isUnrepresentableValue()
          Returns true if the value of the variable cannot be represented outside the server JVM, and therefore is unavailable.
 boolean isXMLType()
          Returns if the declared type is an XML type.
 

Method Detail

getName

String getName()
Returns the name of the process variable whose value is represented


getDeclaredType

String getDeclaredType()
Returns the declared type of the variable.


getOriginalInstanceType

String getOriginalInstanceType()
Returns the original type of the value


isXMLType

boolean isXMLType()
Returns if the declared type is an XML type.


getValueRepresentation

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 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 isUnrepresentableValue() before using the value. Always use isTooLarge(), isObjectValueRep(), isSerializedValueRep(), isUnrepresentableValue() to interpret the return value of this method.


  • isShortRepresentation

    boolean isShortRepresentation()
    Returns true if this object contains a short String based representation of the variable value. If so the value returned by getValueRepresentation() will always be a String (possibly null) subject to size limitations.


    isTooLarge

    boolean isTooLarge()
    Returns true if the object was too large. If so the value returned by getValueRepresentation() will always be null.


    isObjectValueRep

    boolean isObjectValueRep()
    Returns true if the value of the variable obtained via getValueRepresentation() is some form of the original value, rather than serialized value.


    isSerializedValueRep

    boolean isSerializedValueRep()
    Returns true if the value of the variable is repesented in its serialized form. This implies that getValueRepresentation() returns the serialized form in a byte array. You should first try to get the deserialized (original) Object via deserializeValue().


    isUnrepresentableValue

    boolean isUnrepresentableValue()
    Returns true if the value of the variable cannot be represented outside the server JVM, and therefore is unavailable.


    deserializeValue

    Object deserializeValue()
                            throws IOException,
                                   ClassNotFoundException
    Convenience method for constructing the value object from its serialized form. This method should only be called if isSerializedValueRep() returns true

    Throws:
    IOException
    ClassNotFoundException - if the class for the object being represented is not found.
    UnsupportedOperationException - when isSerializedValueRep() returns false