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 class
AnyImpl.AnyInputStream
private static class
AnyImpl.AnyOutputStream
-
Field Summary
Fields Modifier and Type Field Description private boolean
isInitialized
(package private) static boolean[]
isStreamed
private java.lang.Object
object
protected ORB
orb
private static long
serialVersionUID
private CDRInputObject
stream
private TypeCodeImpl
typeCode
private long
value
private static ORBUtilSystemException
wrapper
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkExtractBadOperation(int expected)
private void
checkExtractBadOperationList(int[] expected)
InputStream
create_input_stream()
returns an input stream that an Any value can be marshaled out of.OutputStream
create_output_stream()
returns an output stream that an Any value can be marshaled into.static TypeCode
createTypeCodeForClass(java.lang.Class c, ORB tcORB)
Utility method for insert_Value and Util.writeAny.boolean
equal(Any otherAny)
checks for equality between Anys.private boolean
equalMember(TypeCode memberType, InputStream myStream, InputStream otherStream)
Any
extract_any()
See the description of the general Any operations.boolean
extract_boolean()
See the description of the general Any operations.char
extract_char()
See the description of the general Any operations.double
extract_double()
See the description of the general Any operations.java.math.BigDecimal
extract_fixed()
Extracts thejava.math.BigDecimal
object in thisAny
object'svalue
field.float
extract_float()
See the description of the general Any operations.int
extract_long()
See the description of the general Any operations.long
extract_longlong()
See the description of the general Any operations.Object
extract_Object()
See the description of the general Any operations.byte
extract_octet()
See the description of the general Any operations.Principal
extract_Principal()
Extracts thePrincipal
object in thisAny
object'svalue
field.short
extract_short()
See the description of the general Any operations.Streamable
extract_Streamable()
Extracts aStreamable
from thisAny
object'svalue
field.java.lang.String
extract_string()
See the description of the general Any operations.TypeCode
extract_TypeCode()
See the description of the general Any operations.int
extract_ulong()
See the description of the general Any operations.long
extract_ulonglong()
See the description of the general Any operations.short
extract_ushort()
See the description of the general Any operations.java.io.Serializable
extract_Value()
Note that the Serializable really should be an IDLEntity of some kind.char
extract_wchar()
See the description of the general Any operations.java.lang.String
extract_wstring()
See the description of the general Any operations.static Any
extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb)
private static TypeCode
getPrimitiveTypeCodeForClass(java.lang.Class c, ORB tcORB)
It looks like this was copied from io.ValueUtility at some point.private java.lang.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(java.math.BigDecimal value)
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception.void
insert_fixed(java.math.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
insert_Object(Object o)
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
insert_Principal(Principal p)
Inserts the givenPrincipal
object into thisAny
object'svalue
field.void
insert_short(short s)
See the description of the general Any operations.void
insert_Streamable(Streamable s)
takes a streamable and inserts its reference into the anyvoid
insert_string(java.lang.String s)
See the description of the general Any operations.void
insert_TypeCode(TypeCode tc)
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
insert_Value(java.io.Serializable v)
Inserts the givenjava.io.Serializable
object into thisAny
object'svalue
field.void
insert_Value(java.io.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
insert_wstring(java.lang.String s)
See the description of the general Any operations.boolean
isInitialized()
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
readObject(java.io.ObjectInputStream is)
private TypeCode
realType()
private TypeCode
realType(TypeCode aType)
TypeCode
type()
returns the type of the element contained in the Any.void
type(TypeCode tc)
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 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.IOException
java.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:
equal
in classAny
- Parameters:
otherAny
- the Any to be compared with.- Returns:
- true if the Anys are equal, false otherwise.
- See Also:
CORBA
package 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_stream
in 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_stream
in 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: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
public void write_value(OutputStream out)
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
public void insert_Streamable(Streamable s)
takes a streamable and inserts its reference into the any- Overrides:
insert_Streamable
in classAny
- Parameters:
s
- the streamable to insert- See Also:
CORBA
package comments for unimplemented features
-
extract_Streamable
public Streamable 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:
CORBA
package comments for unimplemented features
-
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
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_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
public void insert_string(java.lang.String s)
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
public java.lang.String 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
public void insert_wstring(java.lang.String s)
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
public java.lang.String 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
public void insert_any(Any a)
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
public Any 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
public void insert_Object(Object o)
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
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 classAny
- Parameters:
tc
- TypeCode to insert into o.o
- theorg.omg.CORBA.Object
instance to insert into thisAny
object
-
extract_Object
public Object 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
public void insert_TypeCode(TypeCode tc)
See the description of the general Any operations.- Specified by:
insert_TypeCode
in classAny
- Parameters:
tc
- TypeCode to insert.
-
extract_TypeCode
public TypeCode 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
public void insert_Principal(Principal p)
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:
CORBA
package comments for unimplemented features
-
extract_Principal
public Principal 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:
CORBA
package 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_Value
in classAny
- Returns:
- the
java.io.Serializable
object stored in thisAny
object
-
insert_Value
public void insert_Value(java.io.Serializable v)
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
public void insert_Value(java.io.Serializable v, TypeCode t)
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
public void insert_fixed(java.math.BigDecimal value)
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:
CORBA
package comments for unimplemented features
-
insert_fixed
public void insert_fixed(java.math.BigDecimal value, TypeCode type)
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:
CORBA
package comments for unimplemented features
-
extract_fixed
public java.math.BigDecimal 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:
CORBA
package 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()
-
-