Package com.sun.corba.ee.impl.io
Class ValueHandlerImpl
java.lang.Object
com.sun.corba.ee.impl.io.ValueHandlerImpl
- All Implemented Interfaces:
ValueHandler
,ValueHandlerMultiFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
private final Map
<InputStream, IIOPInputStream> static final short
static final short
static final short
private static final byte
private static final byte
private static final OMGSystemException
private final Map
<OutputStream, IIOPOutputStream> private static final byte
protected static final UtilSystemException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate IIOPInputStream
private IIOPOutputStream
getClassName
(String id) getDefinedInId
(String id) (package private) static ValueHandlerImpl
(package private) TCKind
Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.byte
Returns the maximum stream format version for RMI/IDL custom value types that is supported by this ValueHandler object.private static byte
getRMIRepositoryID
(Class clz) Returns the repository ID for the given RMI value Class.Returns the CodeBase for this ValueHandler.boolean
isAbstractBase
(Class clazz) private boolean
boolean
isCustomMarshaled
(Class clz) Indicates whether the given Class performs custom or default marshaling.boolean
isSequence
(String id) private Object
read_Array
(IIOPInputStream bridge, InputStream in, Class sequence, CodeBase sender, int offset) private void
readCharArray
(InputStream in, char[] array, int offset, int length) Encapsulates reading of Java char arrays so that the 1.3 subclass can override it without exposing internals across packages.readValue
(InputStream _in, int offset, Class clazz, String repositoryID, RunTime _sender) Reads a value from the stream using java semantics.private Serializable
readValueInternal
(IIOPInputStream bridge, InputStream in, int offset, Class<?> clazz, String repositoryID, CodeBase sender) boolean
useFullValueDescription
(Class clazz, String repositoryID) Returns a boolean of whether or not RepositoryId indicates FullValueDescriptor.private void
write_Array
(OutputStream out, Serializable obj, Class type) private void
writeCharArray
(OutputStream out, char[] array, int offset, int length) Encapsulates writing of Java char arrays so that the 1.3 subclass can override it without exposing internals across packages.writeReplace
(Serializable value) If the value contains a writeReplace method then the result is returned.void
writeValue
(OutputStream _out, Serializable value) Writes the value to the stream using java semantics.void
writeValue
(OutputStream out, Serializable value, byte streamFormatVersion) Allows the ORB to pass the stream format version for RMI/IDL custom value types.private void
writeValueInternal
(IIOPOutputStream bridge, OutputStream out, Serializable value, byte streamFormatVersion) private void
writeValueWithVersion
(OutputStream _out, Serializable value, byte streamFormatVersion)
-
Field Details
-
omgWrapper
-
utilWrapper
-
FORMAT_VERSION_PROPERTY
- See Also:
-
MAX_SUPPORTED_FORMAT_VERSION
private static final byte MAX_SUPPORTED_FORMAT_VERSION- See Also:
-
STREAM_FORMAT_VERSION_1
private static final byte STREAM_FORMAT_VERSION_1- See Also:
-
MAX_STREAM_FORMAT_VERSION
private static final byte MAX_STREAM_FORMAT_VERSION -
kRemoteType
public static final short kRemoteType- See Also:
-
kAbstractType
public static final short kAbstractType- See Also:
-
kValueType
public static final short kValueType- See Also:
-
inputStreamPairs
-
outputStreamPairs
-
-
Constructor Details
-
ValueHandlerImpl
private ValueHandlerImpl()
-
-
Method Details
-
getMaxStreamFormatVersion
private static byte getMaxStreamFormatVersion() -
getMaximumStreamFormatVersion
public byte getMaximumStreamFormatVersion()Description copied from interface:ValueHandlerMultiFormat
Returns the maximum stream format version for RMI/IDL custom value types that is supported by this ValueHandler object. The ValueHandler object must support the returned stream format version and all lower versions. An ORB may use this value to include in a standard IOR tagged component or service context to indicate to other ORBs the maximum RMI-IIOP stream format that it supports. If not included, the default for GIOP 1.2 is stream format version 1, and stream format version 2 for GIOP 1.3 and higher.- Specified by:
getMaximumStreamFormatVersion
in interfaceValueHandlerMultiFormat
- Returns:
- the maximum version supported
-
writeValue
Description copied from interface:ValueHandlerMultiFormat
Allows the ORB to pass the stream format version for RMI/IDL custom value types. If the ORB calls this method, it must pass a stream format version between 1 and the value returned by the getMaximumStreamFormatVersion method inclusive, or else a BAD_PARAM exception with standard minor code will be thrown.If the ORB calls the older ValueHandler.writeValue(OutputStream, Serializable) method, stream format version 1 is implied.
The ORB output stream passed to the ValueHandlerMultiFormat.writeValue method must implement the ValueOutputStream interface, and the ORB input stream passed to the ValueHandler.readValue method must implement the ValueInputStream interface.- Specified by:
writeValue
in interfaceValueHandlerMultiFormat
- Parameters:
out
- stream to write the value out tovalue
- aSerializable
value to writestreamFormatVersion
- stream format version
-
getInstance
-
writeValue
Writes the value to the stream using java semantics.- Specified by:
writeValue
in interfaceValueHandler
- Parameters:
_out
- The stream to write the value tovalue
- The value to be written to the stream
-
writeValueWithVersion
-
writeValueInternal
private void writeValueInternal(IIOPOutputStream bridge, OutputStream out, Serializable value, byte streamFormatVersion) -
readValue
public Serializable readValue(InputStream _in, int offset, Class clazz, String repositoryID, RunTime _sender) Reads a value from the stream using java semantics.- Specified by:
readValue
in interfaceValueHandler
- Parameters:
_in
- The stream to read the value fromoffset
- offset position in the streamclazz
- The type of the value to be read inrepositoryID
- repo ID for the value to read_sender
- The sending context runtime- Returns:
- The serializable value read from the stream
-
readValueInternal
private Serializable readValueInternal(IIOPInputStream bridge, InputStream in, int offset, Class<?> clazz, String repositoryID, CodeBase sender) -
getRMIRepositoryID
Returns the repository ID for the given RMI value Class.- Specified by:
getRMIRepositoryID
in interfaceValueHandler
- Parameters:
clz
- The class to return a repository ID for.- Returns:
- the repository ID of the Class.
-
isCustomMarshaled
Indicates whether the given Class performs custom or default marshaling.- Specified by:
isCustomMarshaled
in interfaceValueHandler
- Parameters:
clz
- The class to test for custom marshaling.- Returns:
- True if the class performs custom marshaling, false if it does not.
-
getRunTimeCodeBase
Returns the CodeBase for this ValueHandler. This is used by the ORB runtime. The server sends the service context containing the IOR for this CodeBase on the first GIOP reply. The clients do the same on the first GIOP request.- Specified by:
getRunTimeCodeBase
in interfaceValueHandler
- Returns:
- the SendingContext.CodeBase of this ValueHandler.
-
useFullValueDescription
Returns a boolean of whether or not RepositoryId indicates FullValueDescriptor. used for backward compatability- Parameters:
clazz
- The type to get description forrepositoryID
- The repository ID- Returns:
- If full description should be retrieved
- Throws:
IOException
- If suids do not match or if the repositoryID is not an RMIValueType.
-
getClassName
-
getClassFromType
- Throws:
ClassNotFoundException
-
getAnyClassFromType
- Throws:
ClassNotFoundException
-
createForAnyType
-
getDefinedInId
-
getUnqualifiedName
-
getSerialVersionUID
-
isAbstractBase
-
isSequence
-
writeReplace
If the value contains a writeReplace method then the result is returned. Otherwise, the value itself is returned.- Specified by:
writeReplace
in interfaceValueHandler
- Parameters:
value
- the value to be marshaled.- Returns:
- the true value to marshal on the wire.
-
writeCharArray
Encapsulates writing of Java char arrays so that the 1.3 subclass can override it without exposing internals across packages. This is a fix for bug 4367783. -
write_Array
-
readCharArray
Encapsulates reading of Java char arrays so that the 1.3 subclass can override it without exposing internals across packages. This is a fix for bug 4367783. -
read_Array
private Object read_Array(IIOPInputStream bridge, InputStream in, Class sequence, CodeBase sender, int offset) -
isArray
-
createOutputStream
-
createInputStream
-
getJavaCharTCKind
TCKind getJavaCharTCKind()Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this. The correct behavior is for a Java char to map to a CORBA wchar, but our older code mapped it to a CORBA char.
-