Class AnyImpl

java.lang.Object
org.omg.CORBA.Any
com.sun.corba.ee.impl.corba.AnyImpl
All Implemented Interfaces:
Serializable, IDLEntity

public class AnyImpl extends Any
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • typeCode

      private TypeCodeImpl typeCode
    • orb

      @Copy(IDENTITY) protected transient ORB orb
    • wrapper

      @Copy(IDENTITY) private static final ORBUtilSystemException wrapper
    • stream

      @Copy(IDENTITY) private transient CDRInputObject stream
    • value

      private long value
    • object

      private Object object
    • isInitialized

      private boolean isInitialized
    • isStreamed

      static boolean[] isStreamed
  • Constructor Details

    • AnyImpl

      public AnyImpl(ORB orb)
      A constructor that sets the Any to contain a null. It also marks the value as being invalid so that extractions throw an exception until an insertion has been performed.
      Parameters:
      orb - ORB to use for this any
    • AnyImpl

      public AnyImpl(ORB orb, Any obj)
  • Method Details

    • readObject

      private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException
    • type

      public TypeCode type()
      returns the type of the element contained in the Any.
      Specified by:
      type in class Any
      Returns:
      the TypeCode for the element in the Any
    • realType

      private TypeCode realType()
    • realType

      private TypeCode realType(TypeCode aType)
    • type

      public void type(TypeCode tc)
      sets the type of the element to be contained in the Any.
      Specified by:
      type in class Any
      Parameters:
      tc - the TypeCode for the element in the Any
    • equal

      public boolean equal(Any otherAny)
      checks for equality between Anys.
      Specified by:
      equal in class Any
      Parameters:
      otherAny - the Any to be compared with.
      Returns:
      true if the Anys are equal, false otherwise.
      See Also:
    • equalMember

      private boolean equalMember(TypeCode memberType, InputStream myStream, InputStream otherStream)
    • create_output_stream

      public OutputStream create_output_stream()
      returns an output stream that an Any value can be marshaled into.
      Specified by:
      create_output_stream in class Any
      Returns:
      the OutputStream to marshal value of Any into
    • create_input_stream

      public InputStream create_input_stream()
      returns an input stream that an Any value can be marshaled out of.
      Specified by:
      create_input_stream in class Any
      Returns:
      the InputStream to marshal value of Any out of.
    • read_value

      public void read_value(InputStream in, TypeCode tc)
      Description copied from class: Any
      Reads off (unmarshals) the value of an Any object from the given input stream using the given typecode.
      Specified by:
      read_value in class Any
      Parameters:
      in - the org.omg.CORBA.portable.InputStream object from which to read the value contained in this Any object
      tc - a TypeCode object containing type information about the value to be read
    • write_value

      public void write_value(OutputStream out)
      Description copied from class: Any
      Writes out the value of this Any object to the given output stream. If both typecode and value need to be written, use create_output_stream() to create an OutputStream, then use write_any on the OutputStream.

      If this method is called on an Any object that has not had a value inserted into its value field, it will throw the exception java.lang.NullPointerException.

      Specified by:
      write_value in class Any
      Parameters:
      out - the org.omg.CORBA.portable.OutputStream object into which to marshal the value of this Any object
    • insert_Streamable

      public void insert_Streamable(Streamable s)
      takes a streamable and inserts its reference into the any
      Overrides:
      insert_Streamable in class Any
      Parameters:
      s - the streamable to insert
      See Also:
    • extract_Streamable

      public Streamable extract_Streamable()
      Description copied from class: Any
      Extracts a Streamable from this Any object's value field. This method allows the extraction of non-primitive IDL types.
      Overrides:
      extract_Streamable in class Any
      Returns:
      the Streamable stored in the Any object.
      See Also:
    • insert_short

      public void insert_short(short s)
      See the description of the general Any operations.
      Specified by:
      insert_short in class Any
      Parameters:
      s - the short to insert into this Any object
    • getTCKindName

      private String getTCKindName(int tc)
    • checkExtractBadOperation

      private void checkExtractBadOperation(int expected)
    • checkExtractBadOperationList

      private void checkExtractBadOperationList(int[] expected)
    • extract_short

      public short extract_short()
      See the description of the general Any operations.
      Specified by:
      extract_short in class Any
      Returns:
      the short stored in this Any object
    • insert_long

      public void insert_long(int l)
      See the description of the general Any operations.
      Specified by:
      insert_long in class Any
      Parameters:
      l - the int to insert into this Any object
    • extract_long

      public int extract_long()
      See the description of the general Any operations.
      Specified by:
      extract_long in class Any
      Returns:
      the int stored in this Any object
    • insert_ushort

      public void insert_ushort(short s)
      See the description of the general Any operations.
      Specified by:
      insert_ushort in class Any
      Parameters:
      s - the short to insert into this Any object
    • extract_ushort

      public short extract_ushort()
      See the description of the general Any operations.
      Specified by:
      extract_ushort in class Any
      Returns:
      the short stored in this Any object
    • insert_ulong

      public void insert_ulong(int l)
      See the description of the general Any operations.
      Specified by:
      insert_ulong in class Any
      Parameters:
      l - the int to insert into this Any object
    • extract_ulong

      public int extract_ulong()
      See the description of the general Any operations.
      Specified by:
      extract_ulong in class Any
      Returns:
      the int stored in this Any object
    • insert_float

      public void insert_float(float f)
      See the description of the general Any operations.
      Specified by:
      insert_float in class Any
      Parameters:
      f - the float to insert into this Any object
    • extract_float

      public float extract_float()
      See the description of the general Any operations.
      Specified by:
      extract_float in class Any
      Returns:
      the float stored in this Any object
    • insert_double

      public void insert_double(double d)
      See the description of the general Any operations.
      Specified by:
      insert_double in class Any
      Parameters:
      d - the double to insert into this Any object
    • extract_double

      public double extract_double()
      See the description of the general Any operations.
      Specified by:
      extract_double in class Any
      Returns:
      the double stored in this Any object
    • insert_longlong

      public void insert_longlong(long l)
      See the description of the general Any operations.
      Specified by:
      insert_longlong in class Any
      Parameters:
      l - the long to insert into this Any object
    • extract_longlong

      public long extract_longlong()
      See the description of the general Any operations.
      Specified by:
      extract_longlong in class Any
      Returns:
      the long stored in this Any object
    • insert_ulonglong

      public void insert_ulonglong(long l)
      See the description of the general Any operations.
      Specified by:
      insert_ulonglong in class Any
      Parameters:
      l - the long to insert into this Any object
    • extract_ulonglong

      public long extract_ulonglong()
      See the description of the general Any operations.
      Specified by:
      extract_ulonglong in class Any
      Returns:
      the long stored in this Any object
    • insert_boolean

      public void insert_boolean(boolean b)
      See the description of the general Any operations.
      Specified by:
      insert_boolean in class Any
      Parameters:
      b - the boolean to insert into this Any object
    • extract_boolean

      public boolean extract_boolean()
      See the description of the general Any operations.
      Specified by:
      extract_boolean in class Any
      Returns:
      the boolean stored in this Any object
    • insert_char

      public void insert_char(char c)
      See the description of the general Any operations.
      Specified by:
      insert_char in class Any
      Parameters:
      c - the char to insert into this Any object
    • extract_char

      public char extract_char()
      See the description of the general Any operations.
      Specified by:
      extract_char in class Any
      Returns:
      the char stored in this Any object
    • insert_wchar

      public void insert_wchar(char c)
      See the description of the general Any operations.
      Specified by:
      insert_wchar in class Any
      Parameters:
      c - the char to insert into this Any object
    • extract_wchar

      public char extract_wchar()
      See the description of the general Any operations.
      Specified by:
      extract_wchar in class Any
      Returns:
      the char stored in this Any object
    • insert_octet

      public void insert_octet(byte b)
      See the description of the general Any operations.
      Specified by:
      insert_octet in class Any
      Parameters:
      b - the byte to insert into this Any object
    • extract_octet

      public byte extract_octet()
      See the description of the general Any operations.
      Specified by:
      extract_octet in class Any
      Returns:
      the byte stored in this Any object
    • insert_string

      public void insert_string(String s)
      See the description of the general Any operations.
      Specified by:
      insert_string in class Any
      Parameters:
      s - the String object to insert into this Any object
    • extract_string

      public String extract_string()
      See the description of the general Any operations.
      Specified by:
      extract_string in class Any
      Returns:
      the String object stored in this Any object
    • insert_wstring

      public void insert_wstring(String s)
      See the description of the general Any operations.
      Specified by:
      insert_wstring in class Any
      Parameters:
      s - the String object to insert into this Any object
    • extract_wstring

      public String extract_wstring()
      See the description of the general Any operations.
      Specified by:
      extract_wstring in class Any
      Returns:
      the String object stored in this Any object
    • insert_any

      public void insert_any(Any a)
      See the description of the general Any operations.
      Specified by:
      insert_any in class Any
      Parameters:
      a - the Any object to insert into this Any object
    • extract_any

      public Any extract_any()
      See the description of the general Any operations.
      Specified by:
      extract_any in class Any
      Returns:
      the Any object stored in this Any object
    • insert_Object

      public void insert_Object(Object o)
      See the description of the general Any operations.
      Specified by:
      insert_Object in class Any
      Parameters:
      o - the org.omg.CORBA.Object object to insert into this Any object
    • insert_Object

      public void insert_Object(Object o, TypeCode tc)
      A variant of the insertion operation that takes a typecode argument as well.
      Specified by:
      insert_Object in class Any
      Parameters:
      o - the org.omg.CORBA.Object instance to insert into this Any object
      tc - TypeCode to insert into o.
    • extract_Object

      public Object extract_Object()
      See the description of the general Any operations.
      Specified by:
      extract_Object in class Any
      Returns:
      the org.omg.CORBA.Object stored in this Any object
    • insert_TypeCode

      public void insert_TypeCode(TypeCode tc)
      See the description of the general Any operations.
      Specified by:
      insert_TypeCode in class Any
      Parameters:
      tc - TypeCode to insert.
    • extract_TypeCode

      public TypeCode extract_TypeCode()
      See the description of the general Any operations.
      Specified by:
      extract_TypeCode in class Any
      Returns:
      the TypeCode object stored in this Any object
    • insert_Principal

      public void insert_Principal(Principal p)
      Description copied from class: Any
      Inserts the given Principal object into this Any object's value field. Note that the class Principal has been deprecated.
      Overrides:
      insert_Principal in class Any
      Parameters:
      p - the Principal object to insert into this Any object
      See Also:
    • extract_Principal

      public Principal extract_Principal()
      Description copied from class: Any
      Extracts the Principal object in this Any object's value field. Note that the class Principal has been deprecated.
      Overrides:
      extract_Principal in class Any
      Returns:
      the Principal object stored in this Any object
      See Also:
    • extract_Value

      public Serializable extract_Value()
      Note that the Serializable really should be an IDLEntity of some kind. It shouldn't just be an RMI-IIOP type. Currently, we accept and will produce RMI repIds with the latest calculations if given a non-IDLEntity Serializable.
      Specified by:
      extract_Value in class Any
      Returns:
      the java.io.Serializable object stored in this Any object
    • insert_Value

      public void insert_Value(Serializable v)
      Description copied from class: Any
      Inserts the given java.io.Serializable object into this Any object's value field.
      Specified by:
      insert_Value in class Any
      Parameters:
      v - the java.io.Serializable object to insert into this Any object
    • insert_Value

      public void insert_Value(Serializable v, TypeCode t)
      Description copied from class: Any
      Inserts the given java.io.Serializable object into this Any object's value field.
      Specified by:
      insert_Value in class Any
      Parameters:
      v - the java.io.Serializable object to insert into this Any object
      t - the TypeCode object that is to be inserted into this Any object's type field and that describes the java.io.Serializable object being inserted
    • insert_fixed

      public void insert_fixed(BigDecimal value)
      Description copied from class: Any
      Throws an org.omg.CORBA.NO_IMPLEMENT exception.

      Inserts the given java.math.BigDecimal object into this Any object's value field.

      Overrides:
      insert_fixed in class Any
      Parameters:
      value - the java.math.BigDecimal object to insert into this Any object
      See Also:
    • insert_fixed

      public void insert_fixed(BigDecimal value, TypeCode type)
      Description copied from class: Any
      Throws an org.omg.CORBA.NO_IMPLEMENT exception.

      Inserts the given java.math.BigDecimal object into this Any object's value field.

      Overrides:
      insert_fixed in class Any
      Parameters:
      value - the java.math.BigDecimal object to insert into this Any object
      type - the TypeCode object that is to be inserted into this Any object's type field and that describes the java.math.BigDecimal object being inserted
      See Also:
    • extract_fixed

      public BigDecimal extract_fixed()
      Description copied from class: Any
      Extracts the java.math.BigDecimal object in this Any object's value field.
      Overrides:
      extract_fixed in class Any
      Returns:
      the java.math.BigDecimal object stored in this Any object
      See Also:
    • createTypeCodeForClass

      public static TypeCode createTypeCodeForClass(Class c, ORB tcORB)
      Utility method for insert_Value and Util.writeAny. The ORB passed in should have the desired ORBVersion. It is used to generate the type codes.
      Parameters:
      c - The Class for which a TypeCode is needed.
      tcORB - ORB to use when creating TypeCode.
      Returns:
      The newly created TypeCode.
    • getPrimitiveTypeCodeForClass

      private static TypeCode getPrimitiveTypeCodeForClass(Class c, ORB tcORB)
      It looks like this was copied from io.ValueUtility at some point. It's used by createTypeCodeForClass. The tcORB passed in should have the desired ORB version, and is used to create the type codes.
      Parameters:
      c - the class
      tcORB - the orb to use to find the type code
      Returns:
      the appropriate primitive type code
    • extractAnyFromStream

      public static Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb)
    • isInitialized

      public boolean isInitialized()