javax.rmi.CORBA

Interface ValueHandler

public interface ValueHandler

Serializes Java objects to and from CDR (GIOP) streams. The working instance of the value handler is returned by {@link 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
StringgetRMIRepositoryID(Class clz)
Get CORBA repository Id for the given java class.
RunTimegetRunTimeCodeBase()
Returns the CodeBase for this ValueHandler.
booleanisCustomMarshaled(Class clz)
Indicates that the given class is responsible itself for writing its content to the stream.
SerializablereadValue(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.
SerializablewriteReplace(Serializable value)
When the value provides the writeReplace method, the result of this method is written.
voidwriteValue(OutputStream out, Serializable value)
Write value to CORBA output stream using java senmatics.

Method Detail

getRMIRepositoryID

public 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

public RunTime getRunTimeCodeBase()
Returns the CodeBase for this ValueHandler.

Returns: the codebase.

isCustomMarshaled

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

Parameters: clz the class being checked.

Returns: true if the class supports custom or default marshalling, false otherwise.

readValue

public 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

public 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: the value that should be written to the stream.

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

writeValue

public 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.