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:
Serializable
,IDLEntity
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
(package private) static boolean[]
private Object
protected ORB
private static final long
private CDRInputObject
private TypeCodeImpl
private long
private static final ORBUtilSystemException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkExtractBadOperation
(int expected) private void
checkExtractBadOperationList
(int[] expected) returns an input stream that an Any value can be marshaled out of.returns an output stream that an Any value can be marshaled into.static TypeCode
createTypeCodeForClass
(Class c, ORB tcORB) Utility method for insert_Value and Util.writeAny.boolean
checks for equality between Anys.private boolean
equalMember
(TypeCode memberType, InputStream myStream, InputStream otherStream) See the description of the general Any operations.boolean
See the description of the general Any operations.char
See the description of the general Any operations.double
See the description of the general Any operations.Extracts thejava.math.BigDecimal
object in thisAny
object'svalue
field.float
See the description of the general Any operations.int
See the description of the general Any operations.long
See the description of the general Any operations.See the description of the general Any operations.byte
See the description of the general Any operations.Extracts thePrincipal
object in thisAny
object'svalue
field.short
See the description of the general Any operations.Extracts aStreamable
from thisAny
object'svalue
field.See the description of the general Any operations.See the description of the general Any operations.int
See the description of the general Any operations.long
See the description of the general Any operations.short
See the description of the general Any operations.Note that the Serializable really should be an IDLEntity of some kind.char
See the description of the general Any operations.See the description of the general Any operations.static Any
extractAnyFromStream
(TypeCode memberType, InputStream input, ORB orb) private static TypeCode
getPrimitiveTypeCodeForClass
(Class c, ORB tcORB) It looks like this was copied from io.ValueUtility at some point.private String
getTCKindName
(int tc) void
insert_any
(Any a) See the description of the general Any operations.void
insert_boolean
(boolean b) See the description of the general Any operations.void
insert_char
(char c) See the description of the general Any operations.void
insert_double
(double d) See the description of the general Any operations.void
insert_fixed
(BigDecimal value) Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.void
insert_fixed
(BigDecimal value, TypeCode type) Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.void
insert_float
(float f) See the description of the general Any operations.void
insert_long
(int l) See the description of the general Any operations.void
insert_longlong
(long l) See the description of the general Any operations.void
See the description of the general Any operations.void
insert_Object
(Object o, TypeCode tc) A variant of the insertion operation that takes a typecode argument as well.void
insert_octet
(byte b) See the description of the general Any operations.void
Inserts the givenPrincipal
object into thisAny
object'svalue
field.void
insert_short
(short s) See the description of the general Any operations.void
takes a streamable and inserts its reference into the anyvoid
See the description of the general Any operations.void
See the description of the general Any operations.void
insert_ulong
(int l) See the description of the general Any operations.void
insert_ulonglong
(long l) See the description of the general Any operations.void
insert_ushort
(short s) See the description of the general Any operations.void
Inserts the givenjava.io.Serializable
object into thisAny
object'svalue
field.void
insert_Value
(Serializable v, TypeCode t) Inserts the givenjava.io.Serializable
object into thisAny
object'svalue
field.void
insert_wchar
(char c) See the description of the general Any operations.void
See the description of the general Any operations.boolean
void
read_value
(InputStream in, TypeCode tc) Reads off (unmarshals) the value of anAny
object from the given input stream using the given typecode.private void
private TypeCode
realType()
private TypeCode
type()
returns the type of the element contained in the Any.void
sets the type of the element to be contained in the Any.void
write_value
(OutputStream out) Writes out the value of thisAny
object to the given output stream.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
typeCode
-
orb
-
wrapper
-
stream
-
value
private long value -
object
-
isInitialized
private boolean isInitialized -
isStreamed
static boolean[] isStreamed
-
-
Constructor Details
-
AnyImpl
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
-
-
Method Details
-
readObject
- Throws:
IOException
ClassNotFoundException
-
type
returns the type of the element contained in the Any. -
realType
-
realType
-
type
sets the type of the element to be contained in the Any. -
equal
checks for equality between Anys. -
equalMember
-
create_output_stream
returns an output stream that an Any value can be marshaled into.- Specified by:
create_output_stream
in classAny
- Returns:
- the OutputStream to marshal value of Any into
-
create_input_stream
returns an input stream that an Any value can be marshaled out of.- Specified by:
create_input_stream
in classAny
- Returns:
- the InputStream to marshal value of Any out of.
-
read_value
Description copied from class:Any
Reads off (unmarshals) the value of anAny
object from the given input stream using the given typecode.- Specified by:
read_value
in classAny
- Parameters:
in
- theorg.omg.CORBA.portable.InputStream
object from which to read the value contained in thisAny
objecttc
- aTypeCode
object containing type information about the value to be read
-
write_value
Description copied from class:Any
Writes out the value of thisAny
object to the given output stream. If bothtypecode
andvalue
need to be written, usecreate_output_stream()
to create anOutputStream
, then usewrite_any
on theOutputStream
.If this method is called on an
Any
object that has not had a value inserted into itsvalue
field, it will throw the exceptionjava.lang.NullPointerException
.- Specified by:
write_value
in classAny
- Parameters:
out
- theorg.omg.CORBA.portable.OutputStream
object into which to marshal the value of thisAny
object
-
insert_Streamable
takes a streamable and inserts its reference into the any- Overrides:
insert_Streamable
in classAny
- Parameters:
s
- the streamable to insert- See Also:
-
extract_Streamable
Description copied from class:Any
Extracts aStreamable
from thisAny
object'svalue
field. This method allows the extraction of non-primitive IDL types.- Overrides:
extract_Streamable
in classAny
- Returns:
- the
Streamable
stored in theAny
object. - See Also:
-
insert_short
public void insert_short(short s) See the description of the general Any operations.- Specified by:
insert_short
in classAny
- Parameters:
s
- theshort
to insert into thisAny
object
-
getTCKindName
-
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 classAny
- Returns:
- the
short
stored in thisAny
object
-
insert_long
public void insert_long(int l) See the description of the general Any operations.- Specified by:
insert_long
in classAny
- Parameters:
l
- theint
to insert into thisAny
object
-
extract_long
public int extract_long()See the description of the general Any operations.- Specified by:
extract_long
in classAny
- Returns:
- the
int
stored in thisAny
object
-
insert_ushort
public void insert_ushort(short s) See the description of the general Any operations.- Specified by:
insert_ushort
in classAny
- Parameters:
s
- theshort
to insert into thisAny
object
-
extract_ushort
public short extract_ushort()See the description of the general Any operations.- Specified by:
extract_ushort
in classAny
- Returns:
- the
short
stored in thisAny
object
-
insert_ulong
public void insert_ulong(int l) See the description of the general Any operations.- Specified by:
insert_ulong
in classAny
- Parameters:
l
- theint
to insert into thisAny
object
-
extract_ulong
public int extract_ulong()See the description of the general Any operations.- Specified by:
extract_ulong
in classAny
- Returns:
- the
int
stored in thisAny
object
-
insert_float
public void insert_float(float f) See the description of the general Any operations.- Specified by:
insert_float
in classAny
- Parameters:
f
- thefloat
to insert into thisAny
object
-
extract_float
public float extract_float()See the description of the general Any operations.- Specified by:
extract_float
in classAny
- Returns:
- the
float
stored in thisAny
object
-
insert_double
public void insert_double(double d) See the description of the general Any operations.- Specified by:
insert_double
in classAny
- Parameters:
d
- thedouble
to insert into thisAny
object
-
extract_double
public double extract_double()See the description of the general Any operations.- Specified by:
extract_double
in classAny
- Returns:
- the
double
stored in thisAny
object
-
insert_longlong
public void insert_longlong(long l) See the description of the general Any operations.- Specified by:
insert_longlong
in classAny
- Parameters:
l
- thelong
to insert into thisAny
object
-
extract_longlong
public long extract_longlong()See the description of the general Any operations.- Specified by:
extract_longlong
in classAny
- Returns:
- the
long
stored in thisAny
object
-
insert_ulonglong
public void insert_ulonglong(long l) See the description of the general Any operations.- Specified by:
insert_ulonglong
in classAny
- Parameters:
l
- thelong
to insert into thisAny
object
-
extract_ulonglong
public long extract_ulonglong()See the description of the general Any operations.- Specified by:
extract_ulonglong
in classAny
- Returns:
- the
long
stored in thisAny
object
-
insert_boolean
public void insert_boolean(boolean b) See the description of the general Any operations.- Specified by:
insert_boolean
in classAny
- Parameters:
b
- theboolean
to insert into thisAny
object
-
extract_boolean
public boolean extract_boolean()See the description of the general Any operations.- Specified by:
extract_boolean
in classAny
- Returns:
- the
boolean
stored in thisAny
object
-
insert_char
public void insert_char(char c) See the description of the general Any operations.- Specified by:
insert_char
in classAny
- Parameters:
c
- thechar
to insert into thisAny
object
-
extract_char
public char extract_char()See the description of the general Any operations.- Specified by:
extract_char
in classAny
- Returns:
- the
char
stored in thisAny
object
-
insert_wchar
public void insert_wchar(char c) See the description of the general Any operations.- Specified by:
insert_wchar
in classAny
- Parameters:
c
- thechar
to insert into thisAny
object
-
extract_wchar
public char extract_wchar()See the description of the general Any operations.- Specified by:
extract_wchar
in classAny
- Returns:
- the
char
stored in thisAny
object
-
insert_octet
public void insert_octet(byte b) See the description of the general Any operations.- Specified by:
insert_octet
in classAny
- Parameters:
b
- thebyte
to insert into thisAny
object
-
extract_octet
public byte extract_octet()See the description of the general Any operations.- Specified by:
extract_octet
in classAny
- Returns:
- the
byte
stored in thisAny
object
-
insert_string
See the description of the general Any operations.- Specified by:
insert_string
in classAny
- Parameters:
s
- theString
object to insert into thisAny
object
-
extract_string
See the description of the general Any operations.- Specified by:
extract_string
in classAny
- Returns:
- the
String
object stored in thisAny
object
-
insert_wstring
See the description of the general Any operations.- Specified by:
insert_wstring
in classAny
- Parameters:
s
- theString
object to insert into thisAny
object
-
extract_wstring
See the description of the general Any operations.- Specified by:
extract_wstring
in classAny
- Returns:
- the
String
object stored in thisAny
object
-
insert_any
See the description of the general Any operations.- Specified by:
insert_any
in classAny
- Parameters:
a
- theAny
object to insert into thisAny
object
-
extract_any
See the description of the general Any operations.- Specified by:
extract_any
in classAny
- Returns:
- the
Any
object stored in thisAny
object
-
insert_Object
See the description of the general Any operations.- Specified by:
insert_Object
in classAny
- Parameters:
o
- theorg.omg.CORBA.Object
object to insert into thisAny
object
-
insert_Object
A variant of the insertion operation that takes a typecode argument as well.- Specified by:
insert_Object
in classAny
- Parameters:
o
- theorg.omg.CORBA.Object
instance to insert into thisAny
objecttc
- TypeCode to insert into o.
-
extract_Object
See the description of the general Any operations.- Specified by:
extract_Object
in classAny
- Returns:
- the
org.omg.CORBA.Object
stored in thisAny
object
-
insert_TypeCode
See the description of the general Any operations.- Specified by:
insert_TypeCode
in classAny
- Parameters:
tc
- TypeCode to insert.
-
extract_TypeCode
See the description of the general Any operations.- Specified by:
extract_TypeCode
in classAny
- Returns:
- the
TypeCode
object stored in thisAny
object
-
insert_Principal
Description copied from class:Any
Inserts the givenPrincipal
object into thisAny
object'svalue
field. Note that the classPrincipal
has been deprecated.- Overrides:
insert_Principal
in classAny
- Parameters:
p
- thePrincipal
object to insert into thisAny
object- See Also:
-
extract_Principal
Description copied from class:Any
Extracts thePrincipal
object in thisAny
object'svalue
field. Note that the classPrincipal
has been deprecated.- Overrides:
extract_Principal
in classAny
- Returns:
- the
Principal
object stored in thisAny
object - See Also:
-
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 classAny
- Returns:
- the
java.io.Serializable
object stored in thisAny
object
-
insert_Value
Description copied from class:Any
Inserts the givenjava.io.Serializable
object into thisAny
object'svalue
field.- Specified by:
insert_Value
in classAny
- Parameters:
v
- thejava.io.Serializable
object to insert into thisAny
object
-
insert_Value
Description copied from class:Any
Inserts the givenjava.io.Serializable
object into thisAny
object'svalue
field.- Specified by:
insert_Value
in classAny
- Parameters:
v
- thejava.io.Serializable
object to insert into thisAny
objectt
- theTypeCode
object that is to be inserted into thisAny
object'stype
field and that describes thejava.io.Serializable
object being inserted
-
insert_fixed
Description copied from class:Any
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.Inserts the given
java.math.BigDecimal
object into thisAny
object'svalue
field.- Overrides:
insert_fixed
in classAny
- Parameters:
value
- thejava.math.BigDecimal
object to insert into thisAny
object- See Also:
-
insert_fixed
Description copied from class:Any
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.Inserts the given
java.math.BigDecimal
object into thisAny
object'svalue
field.- Overrides:
insert_fixed
in classAny
- Parameters:
value
- thejava.math.BigDecimal
object to insert into thisAny
objecttype
- theTypeCode
object that is to be inserted into thisAny
object'stype
field and that describes thejava.math.BigDecimal
object being inserted- See Also:
-
extract_fixed
Description copied from class:Any
Extracts thejava.math.BigDecimal
object in thisAny
object'svalue
field.- Overrides:
extract_fixed
in classAny
- Returns:
- the
java.math.BigDecimal
object stored in thisAny
object - See Also:
-
createTypeCodeForClass
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
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
-
isInitialized
public boolean isInitialized()
-