com.ibm.cics.server

Class CommAreaHolder

  • java.lang.Object
    • com.ibm.cics.server.CommAreaHolder
  • All Implemented Interfaces:
    IHolder, java.io.Serializable


    public class CommAreaHolder
    extends java.lang.Object
    implements java.io.Serializable, IHolder

    The class that represents a COMMAREA. The actual COMMAREA is an instance variable of type byte[] with the name value.

    On input, value contains the COMMAREA that is being passed to the Program by CICS; the Program returns a COMMAREA by copying a new value into this field.

    For example, if you have output in a byte array called 'myByteArray' and the CommAreaHolder instance passed in to the application is referenced as 'ca', you can copy your application's output in to the COMMAREA with the following command:

    System.arraycopy(myByteArray, 0, ca.getValue(), 0, myByteArray.length);

    Alternatively, you can use setValue(newCommarea) to use a new byte[] to provide the output data. In this case, the value provided must be the same size as the COMMAREA that was supplied by CICS.

    See Also:
    Serialized Form
    Since CICS TS version:
    1.3
    Since package version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      byte[] value
      Deprecated. 
      - Direct access to this field will not be allowed in a future release This will be made private, use the getter methods instead.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CommAreaHolder()
      Constructs a CommAreaHolder without a value.
      CommAreaHolder(byte[] __arg)
      Constructs a CommAreaHolder for an existing byte[].
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getStringValue()
      Returns a String derived from the data in the IHolder, assuming that the data is encoded in the LOCALCCSID.
      byte[] getValue()
      Returns the raw byte array from the IHolder
      void setValue(byte[] newCommarea)
      Set a value into the CommAreaHolder
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • value

        @Deprecated
        public byte[] value
        Deprecated. - Direct access to this field will not be allowed in a future release This will be made private, use the getter methods instead.
        The array of bytes comprising the COMMAREA.
        Since CICS TS version:
        1.3
        Since package version:
        1.0
    • Constructor Detail

      • CommAreaHolder

        public CommAreaHolder()
        Constructs a CommAreaHolder without a value.
        Since CICS TS version:
        1.3
        Since package version:
        1.0
      • CommAreaHolder

        public CommAreaHolder(byte[] __arg)
        Constructs a CommAreaHolder for an existing byte[].
        Parameters:
        __arg - The existing array of bytes that is to be used as the COMMAREA.
        Since CICS TS version:
        1.3
        Since package version:
        1.0
    • Method Detail

      • getValue

        public byte[] getValue()
        Description copied from interface: IHolder
        Returns the raw byte array from the IHolder
        Specified by:
        getValue in interface IHolder
        Returns:
        - the raw byte value stored in the IHolder
        See Also:
        IHolder.getValue()
        Since CICS TS version:
        5.1
        Since package version:
        1.401.0
      • setValue

        public void setValue(byte[] newCommarea)
                      throws java.lang.IllegalArgumentException
        Set a value into the CommAreaHolder
        Parameters:
        newCommarea - the COMMAREA to return to CICS. This new COMMAREA must be the same size as the COMMAREA that CICS originally provided.
        Throws:
        java.lang.IllegalArgumentException - The new COMMAREA is the wrong size.
        Since CICS TS version:
        5.2
        Since package version:
        1.500
      • getStringValue

        public java.lang.String getStringValue()
        Description copied from interface: IHolder
        Returns a String derived from the data in the IHolder, assuming that the data is encoded in the LOCALCCSID. The behavior of this method when the bytes are not valid in the LOCALCCSID encoding is unspecified.
        Specified by:
        getStringValue in interface IHolder
        Returns:
        - a String representation of the byte-array in the CICS LOCALCCSID.
        See Also:
        IHolder.getStringValue()
        Since CICS TS version:
        5.1
        Since package version:
        1.401.0