javax.rmi.CORBA
Interface ValueHandler

All Known Subinterfaces:
ValueHandlerMultiFormat

public interface ValueHandler

Serializes Java objects to and from CDR (GIOP) streams. The working instance of the value handler is returned by Util.createValueHandler() and can be altered by setting the system property "javax.rmi.CORBA.ValueHandlerClass" to the name of the alternative class that must implement ValueHandler.


Method Summary
 String getRMIRepositoryID(Class clz)
          Get CORBA repository Id for the given java class.
 RunTime getRunTimeCodeBase()
          Returns the CodeBase for this ValueHandler.
 boolean isCustomMarshaled(Class clz)
          Indicates that the given class is responsible itself for writing its content to the stream.
 Serializable readValue(InputStream in, int offset, Class clz, String repositoryID, RunTime sender)
          Read value from the CORBA input stream in the case when the value is not Streamable or CustomMarshall'ed.
 Serializable writeReplace(Serializable value)
          When the value provides the writeReplace method, the result of this method is written.
 void writeValue(OutputStream out, Serializable value)
          Write value to CORBA output stream using java senmatics.
 

Method Detail

getRMIRepositoryID

String getRMIRepositoryID(Class clz)
Get CORBA repository Id for the given java class. The syntax of the repository ID is the initial ?RMI:?, followed by the Java class name, followed by name, followed by a hash code string, followed optionally by a serialization version UID string. For Java identifiers that contain illegal OMG IDL identifier characters such as ?$?, any such illegal characters are replaced by ?\U? followed by the 4 hexadecimal characters (in upper case) representing the Unicode value.

Parameters:
clz - a class for that the repository Id is required.
Returns:
the class repository id.

getRunTimeCodeBase

RunTime getRunTimeCodeBase()
Returns the CodeBase for this ValueHandler.

Returns:
the codebase.

isCustomMarshaled

boolean isCustomMarshaled(Class clz)
Indicates that the given class is responsible itself for writing its content to the stream. Such classes implement either Streamable (default marshalling, generated by IDL-to-java compiler) or CustomMarshal (the user-programmed marshalling).

Parameters:
clz - the class being checked.
Returns:
true if the class supports custom or default marshalling, false otherwise.

readValue

Serializable readValue(InputStream in,
                       int offset,
                       Class clz,
                       String repositoryID,
                       RunTime sender)
Read value from the CORBA input stream in the case when the value is not Streamable or CustomMarshall'ed. The fields of the class being written will be accessed using reflection.

Parameters:
in - a CORBA stream to read.
offset - the current position in the input stream.
clz - the type of value being read.
repositoryID - the repository Id of the value being read.
sender - the sending context that should provide data about the message originator.
Returns:
the object, extracted from the stream.

writeReplace

Serializable writeReplace(Serializable value)
When the value provides the writeReplace method, the result of this method is written. Otherwise, the value itself is written.

Parameters:
value - the value that should be written to the stream.
Returns:
the value that will be actually written to the stream.

writeValue

void writeValue(OutputStream out,
                Serializable value)
Write value to CORBA output stream using java senmatics.

Parameters:
out - a stream to write into.
value - a java object to write.