JavaTM 2 Platform
Std. Ed. v1.3.1

javax.rmi.CORBA
Interface ValueHandler


public interface ValueHandler

Defines methods which allow serialization of Java objects to and from GIOP streams.


Method Summary
 String getRMIRepositoryID(Class clz)
          Returns the CORBA RepositoryId for the given Java class.
 RunTime getRunTimeCodeBase()
          Returns the CodeBase for this ValueHandler.
 boolean isCustomMarshaled(Class clz)
          Indicates whether the given class performs custom or default marshaling.
 Serializable readValue(InputStream in, int offset, Class clz, String repositoryID, RunTime sender)
          Reads a value from the stream using Java semantics.
 Serializable writeReplace(Serializable value)
          If the value contains a writeReplace method then the result is returned.
 void writeValue(OutputStream out, Serializable value)
          Writes a value to the stream using Java semantics.
 

Method Detail

writeValue

public void writeValue(OutputStream out,
                       Serializable value)
Writes a value to the stream using Java semantics.
Parameters:
out - the stream to write the value to.
value - the value to be written to the stream.

readValue

public Serializable readValue(InputStream in,
                              int offset,
                              Class clz,
                              String repositoryID,
                              RunTime sender)
Reads a value from the stream using Java semantics.
Parameters:
in - the stream to read the value from.
offset - the current position in the input stream.
clz - the type of the value to be read in.
repositoryID - the RepositoryId of the value to be read in.
sender - the sending context runtime codebase.
Returns:
the value read from the stream.

getRMIRepositoryID

public String getRMIRepositoryID(Class clz)
Returns the CORBA RepositoryId for the given Java class.
Parameters:
clz - a Java class.
Returns:
the CORBA RepositoryId for the class.

isCustomMarshaled

public boolean isCustomMarshaled(Class clz)
Indicates whether the given class performs custom or default marshaling.
Parameters:
clz - the class to test for custom marshaling.
Returns:
true if the class performs custom marshaling, false if it does not.

getRunTimeCodeBase

public RunTime 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 client does the same on the first GIOP request.
Returns:
the SendingContext.CodeBase of this ValueHandler.

writeReplace

public Serializable writeReplace(Serializable value)
If the value contains a writeReplace method then the result is returned. Otherwise, the value itself is returned.
Parameters:
value - the value to be marshaled.
Returns:
the true value to marshal on the wire.

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.