Package com.sun.corba.ee.impl.corba
Class AnyImpl
- java.lang.Object
-
- org.omg.CORBA.Any
-
- com.sun.corba.ee.impl.corba.AnyImpl
-
- All Implemented Interfaces:
java.io.Serializable,IDLEntity
public class AnyImpl extends Any
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAnyImpl.AnyInputStreamprivate static classAnyImpl.AnyOutputStream
-
Field Summary
Fields Modifier and Type Field Description private booleanisInitialized(package private) static boolean[]isStreamedprivate java.lang.Objectobjectprotected ORBorbprivate static longserialVersionUIDprivate CDRInputObjectstreamprivate TypeCodeImpltypeCodeprivate longvalueprivate static ORBUtilSystemExceptionwrapper
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckExtractBadOperation(int expected)private voidcheckExtractBadOperationList(int[] expected)InputStreamcreate_input_stream()returns an input stream that an Any value can be marshaled out of.OutputStreamcreate_output_stream()returns an output stream that an Any value can be marshaled into.static TypeCodecreateTypeCodeForClass(java.lang.Class c, ORB tcORB)Utility method for insert_Value and Util.writeAny.booleanequal(Any otherAny)checks for equality between Anys.private booleanequalMember(TypeCode memberType, InputStream myStream, InputStream otherStream)Anyextract_any()See the description of the general Any operations.booleanextract_boolean()See the description of the general Any operations.charextract_char()See the description of the general Any operations.doubleextract_double()See the description of the general Any operations.java.math.BigDecimalextract_fixed()Extracts thejava.math.BigDecimalobject in thisAnyobject'svaluefield.floatextract_float()See the description of the general Any operations.intextract_long()See the description of the general Any operations.longextract_longlong()See the description of the general Any operations.Objectextract_Object()See the description of the general Any operations.byteextract_octet()See the description of the general Any operations.Principalextract_Principal()Extracts thePrincipalobject in thisAnyobject'svaluefield.shortextract_short()See the description of the general Any operations.Streamableextract_Streamable()Extracts aStreamablefrom thisAnyobject'svaluefield.java.lang.Stringextract_string()See the description of the general Any operations.TypeCodeextract_TypeCode()See the description of the general Any operations.intextract_ulong()See the description of the general Any operations.longextract_ulonglong()See the description of the general Any operations.shortextract_ushort()See the description of the general Any operations.java.io.Serializableextract_Value()Note that the Serializable really should be an IDLEntity of some kind.charextract_wchar()See the description of the general Any operations.java.lang.Stringextract_wstring()See the description of the general Any operations.static AnyextractAnyFromStream(TypeCode memberType, InputStream input, ORB orb)private static TypeCodegetPrimitiveTypeCodeForClass(java.lang.Class c, ORB tcORB)It looks like this was copied from io.ValueUtility at some point.private java.lang.StringgetTCKindName(int tc)voidinsert_any(Any a)See the description of the general Any operations.voidinsert_boolean(boolean b)See the description of the general Any operations.voidinsert_char(char c)See the description of the general Any operations.voidinsert_double(double d)See the description of the general Any operations.voidinsert_fixed(java.math.BigDecimal value)Throws anorg.omg.CORBA.NO_IMPLEMENTexception.voidinsert_fixed(java.math.BigDecimal value, TypeCode type)Throws anorg.omg.CORBA.NO_IMPLEMENTexception.voidinsert_float(float f)See the description of the general Any operations.voidinsert_long(int l)See the description of the general Any operations.voidinsert_longlong(long l)See the description of the general Any operations.voidinsert_Object(Object o)See the description of the general Any operations.voidinsert_Object(Object o, TypeCode tc)A variant of the insertion operation that takes a typecode argument as well.voidinsert_octet(byte b)See the description of the general Any operations.voidinsert_Principal(Principal p)Inserts the givenPrincipalobject into thisAnyobject'svaluefield.voidinsert_short(short s)See the description of the general Any operations.voidinsert_Streamable(Streamable s)takes a streamable and inserts its reference into the anyvoidinsert_string(java.lang.String s)See the description of the general Any operations.voidinsert_TypeCode(TypeCode tc)See the description of the general Any operations.voidinsert_ulong(int l)See the description of the general Any operations.voidinsert_ulonglong(long l)See the description of the general Any operations.voidinsert_ushort(short s)See the description of the general Any operations.voidinsert_Value(java.io.Serializable v)Inserts the givenjava.io.Serializableobject into thisAnyobject'svaluefield.voidinsert_Value(java.io.Serializable v, TypeCode t)Inserts the givenjava.io.Serializableobject into thisAnyobject'svaluefield.voidinsert_wchar(char c)See the description of the general Any operations.voidinsert_wstring(java.lang.String s)See the description of the general Any operations.booleanisInitialized()voidread_value(InputStream in, TypeCode tc)Reads off (unmarshals) the value of anAnyobject from the given input stream using the given typecode.private voidreadObject(java.io.ObjectInputStream is)private TypeCoderealType()private TypeCoderealType(TypeCode aType)TypeCodetype()returns the type of the element contained in the Any.voidtype(TypeCode tc)sets the type of the element to be contained in the Any.voidwrite_value(OutputStream out)Writes out the value of thisAnyobject to the given output stream.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 java.lang.Object object
-
isInitialized
private boolean isInitialized
-
isStreamed
static boolean[] isStreamed
-
-
Constructor Detail
-
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
-
-
Method Detail
-
readObject
private void readObject(java.io.ObjectInputStream is) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
type
public TypeCode type()
returns the type of the element contained in the Any.
-
realType
private TypeCode realType()
-
type
public void type(TypeCode tc)
sets the type of the element to be contained in the Any.
-
equal
public boolean equal(Any otherAny)
checks for equality between Anys.- Specified by:
equalin classAny- Parameters:
otherAny- the Any to be compared with.- Returns:
- true if the Anys are equal, false otherwise.
- See Also:
CORBApackage comments for unimplemented features
-
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_streamin classAny- 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_streamin classAny- Returns:
- the InputStream to marshal value of Any out of.
-
read_value
public void read_value(InputStream in, TypeCode tc)
Description copied from class:AnyReads off (unmarshals) the value of anAnyobject from the given input stream using the given typecode.- Specified by:
read_valuein classAny- Parameters:
in- theorg.omg.CORBA.portable.InputStreamobject from which to read the value contained in thisAnyobjecttc- aTypeCodeobject containing type information about the value to be read
-
write_value
public void write_value(OutputStream out)
Description copied from class:AnyWrites out the value of thisAnyobject to the given output stream. If bothtypecodeandvalueneed to be written, usecreate_output_stream()to create anOutputStream, then usewrite_anyon theOutputStream.If this method is called on an
Anyobject that has not had a value inserted into itsvaluefield, it will throw the exceptionjava.lang.NullPointerException.- Specified by:
write_valuein classAny- Parameters:
out- theorg.omg.CORBA.portable.OutputStreamobject into which to marshal the value of thisAnyobject
-
insert_Streamable
public void insert_Streamable(Streamable s)
takes a streamable and inserts its reference into the any- Overrides:
insert_Streamablein classAny- Parameters:
s- the streamable to insert- See Also:
CORBApackage comments for unimplemented features
-
extract_Streamable
public Streamable extract_Streamable()
Description copied from class:AnyExtracts aStreamablefrom thisAnyobject'svaluefield. This method allows the extraction of non-primitive IDL types.- Overrides:
extract_Streamablein classAny- Returns:
- the
Streamablestored in theAnyobject. - See Also:
CORBApackage comments for unimplemented features
-
insert_short
public void insert_short(short s)
See the description of the general Any operations.- Specified by:
insert_shortin classAny- Parameters:
s- theshortto insert into thisAnyobject
-
getTCKindName
private java.lang.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_shortin classAny- Returns:
- the
shortstored in thisAnyobject
-
insert_long
public void insert_long(int l)
See the description of the general Any operations.- Specified by:
insert_longin classAny- Parameters:
l- theintto insert into thisAnyobject
-
extract_long
public int extract_long()
See the description of the general Any operations.- Specified by:
extract_longin classAny- Returns:
- the
intstored in thisAnyobject
-
insert_ushort
public void insert_ushort(short s)
See the description of the general Any operations.- Specified by:
insert_ushortin classAny- Parameters:
s- theshortto insert into thisAnyobject
-
extract_ushort
public short extract_ushort()
See the description of the general Any operations.- Specified by:
extract_ushortin classAny- Returns:
- the
shortstored in thisAnyobject
-
insert_ulong
public void insert_ulong(int l)
See the description of the general Any operations.- Specified by:
insert_ulongin classAny- Parameters:
l- theintto insert into thisAnyobject
-
extract_ulong
public int extract_ulong()
See the description of the general Any operations.- Specified by:
extract_ulongin classAny- Returns:
- the
intstored in thisAnyobject
-
insert_float
public void insert_float(float f)
See the description of the general Any operations.- Specified by:
insert_floatin classAny- Parameters:
f- thefloatto insert into thisAnyobject
-
extract_float
public float extract_float()
See the description of the general Any operations.- Specified by:
extract_floatin classAny- Returns:
- the
floatstored in thisAnyobject
-
insert_double
public void insert_double(double d)
See the description of the general Any operations.- Specified by:
insert_doublein classAny- Parameters:
d- thedoubleto insert into thisAnyobject
-
extract_double
public double extract_double()
See the description of the general Any operations.- Specified by:
extract_doublein classAny- Returns:
- the
doublestored in thisAnyobject
-
insert_longlong
public void insert_longlong(long l)
See the description of the general Any operations.- Specified by:
insert_longlongin classAny- Parameters:
l- thelongto insert into thisAnyobject
-
extract_longlong
public long extract_longlong()
See the description of the general Any operations.- Specified by:
extract_longlongin classAny- Returns:
- the
longstored in thisAnyobject
-
insert_ulonglong
public void insert_ulonglong(long l)
See the description of the general Any operations.- Specified by:
insert_ulonglongin classAny- Parameters:
l- thelongto insert into thisAnyobject
-
extract_ulonglong
public long extract_ulonglong()
See the description of the general Any operations.- Specified by:
extract_ulonglongin classAny- Returns:
- the
longstored in thisAnyobject
-
insert_boolean
public void insert_boolean(boolean b)
See the description of the general Any operations.- Specified by:
insert_booleanin classAny- Parameters:
b- thebooleanto insert into thisAnyobject
-
extract_boolean
public boolean extract_boolean()
See the description of the general Any operations.- Specified by:
extract_booleanin classAny- Returns:
- the
booleanstored in thisAnyobject
-
insert_char
public void insert_char(char c)
See the description of the general Any operations.- Specified by:
insert_charin classAny- Parameters:
c- thecharto insert into thisAnyobject
-
extract_char
public char extract_char()
See the description of the general Any operations.- Specified by:
extract_charin classAny- Returns:
- the
charstored in thisAnyobject
-
insert_wchar
public void insert_wchar(char c)
See the description of the general Any operations.- Specified by:
insert_wcharin classAny- Parameters:
c- thecharto insert into thisAnyobject
-
extract_wchar
public char extract_wchar()
See the description of the general Any operations.- Specified by:
extract_wcharin classAny- Returns:
- the
charstored in thisAnyobject
-
insert_octet
public void insert_octet(byte b)
See the description of the general Any operations.- Specified by:
insert_octetin classAny- Parameters:
b- thebyteto insert into thisAnyobject
-
extract_octet
public byte extract_octet()
See the description of the general Any operations.- Specified by:
extract_octetin classAny- Returns:
- the
bytestored in thisAnyobject
-
insert_string
public void insert_string(java.lang.String s)
See the description of the general Any operations.- Specified by:
insert_stringin classAny- Parameters:
s- theStringobject to insert into thisAnyobject
-
extract_string
public java.lang.String extract_string()
See the description of the general Any operations.- Specified by:
extract_stringin classAny- Returns:
- the
Stringobject stored in thisAnyobject
-
insert_wstring
public void insert_wstring(java.lang.String s)
See the description of the general Any operations.- Specified by:
insert_wstringin classAny- Parameters:
s- theStringobject to insert into thisAnyobject
-
extract_wstring
public java.lang.String extract_wstring()
See the description of the general Any operations.- Specified by:
extract_wstringin classAny- Returns:
- the
Stringobject stored in thisAnyobject
-
insert_any
public void insert_any(Any a)
See the description of the general Any operations.- Specified by:
insert_anyin classAny- Parameters:
a- theAnyobject to insert into thisAnyobject
-
extract_any
public Any extract_any()
See the description of the general Any operations.- Specified by:
extract_anyin classAny- Returns:
- the
Anyobject stored in thisAnyobject
-
insert_Object
public void insert_Object(Object o)
See the description of the general Any operations.- Specified by:
insert_Objectin classAny- Parameters:
o- theorg.omg.CORBA.Objectobject to insert into thisAnyobject
-
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_Objectin classAny- Parameters:
tc- TypeCode to insert into o.o- theorg.omg.CORBA.Objectinstance to insert into thisAnyobject
-
extract_Object
public Object extract_Object()
See the description of the general Any operations.- Specified by:
extract_Objectin classAny- Returns:
- the
org.omg.CORBA.Objectstored in thisAnyobject
-
insert_TypeCode
public void insert_TypeCode(TypeCode tc)
See the description of the general Any operations.- Specified by:
insert_TypeCodein classAny- Parameters:
tc- TypeCode to insert.
-
extract_TypeCode
public TypeCode extract_TypeCode()
See the description of the general Any operations.- Specified by:
extract_TypeCodein classAny- Returns:
- the
TypeCodeobject stored in thisAnyobject
-
insert_Principal
public void insert_Principal(Principal p)
Description copied from class:AnyInserts the givenPrincipalobject into thisAnyobject'svaluefield. Note that the classPrincipalhas been deprecated.- Overrides:
insert_Principalin classAny- Parameters:
p- thePrincipalobject to insert into thisAnyobject- See Also:
CORBApackage comments for unimplemented features
-
extract_Principal
public Principal extract_Principal()
Description copied from class:AnyExtracts thePrincipalobject in thisAnyobject'svaluefield. Note that the classPrincipalhas been deprecated.- Overrides:
extract_Principalin classAny- Returns:
- the
Principalobject stored in thisAnyobject - See Also:
CORBApackage comments for unimplemented features
-
extract_Value
public java.io.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_Valuein classAny- Returns:
- the
java.io.Serializableobject stored in thisAnyobject
-
insert_Value
public void insert_Value(java.io.Serializable v)
Description copied from class:AnyInserts the givenjava.io.Serializableobject into thisAnyobject'svaluefield.- Specified by:
insert_Valuein classAny- Parameters:
v- thejava.io.Serializableobject to insert into thisAnyobject
-
insert_Value
public void insert_Value(java.io.Serializable v, TypeCode t)Description copied from class:AnyInserts the givenjava.io.Serializableobject into thisAnyobject'svaluefield.- Specified by:
insert_Valuein classAny- Parameters:
v- thejava.io.Serializableobject to insert into thisAnyobjectt- theTypeCodeobject that is to be inserted into thisAnyobject'stypefield and that describes thejava.io.Serializableobject being inserted
-
insert_fixed
public void insert_fixed(java.math.BigDecimal value)
Description copied from class:AnyThrows anorg.omg.CORBA.NO_IMPLEMENTexception.Inserts the given
java.math.BigDecimalobject into thisAnyobject'svaluefield.- Overrides:
insert_fixedin classAny- Parameters:
value- thejava.math.BigDecimalobject to insert into thisAnyobject- See Also:
CORBApackage comments for unimplemented features
-
insert_fixed
public void insert_fixed(java.math.BigDecimal value, TypeCode type)Description copied from class:AnyThrows anorg.omg.CORBA.NO_IMPLEMENTexception.Inserts the given
java.math.BigDecimalobject into thisAnyobject'svaluefield.- Overrides:
insert_fixedin classAny- Parameters:
value- thejava.math.BigDecimalobject to insert into thisAnyobjecttype- theTypeCodeobject that is to be inserted into thisAnyobject'stypefield and that describes thejava.math.BigDecimalobject being inserted- See Also:
CORBApackage comments for unimplemented features
-
extract_fixed
public java.math.BigDecimal extract_fixed()
Description copied from class:AnyExtracts thejava.math.BigDecimalobject in thisAnyobject'svaluefield.- Overrides:
extract_fixedin classAny- Returns:
- the
java.math.BigDecimalobject stored in thisAnyobject - See Also:
CORBApackage comments for unimplemented features
-
createTypeCodeForClass
public static TypeCode createTypeCodeForClass(java.lang.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(java.lang.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 classtcORB- 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()
-
-