org.openorb.rmi.system
Class ValueHandlerImpl

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.openorb.rmi.system.ValueHandlerImpl
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, javax.rmi.CORBA.ValueHandler

public class ValueHandlerImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements javax.rmi.CORBA.ValueHandler

This class is able to marshal and to unmarshal a RMI value.

Author:
Jerome Daniel, Michael Rumpf

Constructor Summary
ValueHandlerImpl()
          Constructor
 
Method Summary
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
           
 java.lang.String getRMIRepositoryID(java.lang.Class clz)
          This method returns the RMI-style repository ID string for clz.
 org.omg.SendingContext.RunTime getRunTimeCodeBase()
          This method returns the ValueHandler object's SendingContext::RunTime object reference, which is used to construct the SendingContextRuntTime service context.
 boolean isCustomMarshaled(java.lang.Class clz)
          This method returns true if the value is custom marshaled and therefore requires a chunked encoding, and false otherwise.
 java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in_sub, int offset, java.lang.Class expected, java.lang.String repoID, org.omg.SendingContext.RunTime sender)
          The readValue method can be used to read GIOP data, including RMI remote objects and serialized data objects, from an underlying portable InputStream.
 java.io.Serializable writeReplace(java.io.Serializable value)
          This method returns the serialization replacement for the value object.
 void writeValue(org.omg.CORBA.portable.OutputStream out_sub, java.io.Serializable value)
          The writeValue method can be used to write GIOP data, including RMI remote objects and serialized data objects, to an underlying portable OutputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueHandlerImpl

public ValueHandlerImpl()
Constructor
Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Overrides:
enableLogging in class org.apache.avalon.framework.logger.AbstractLogEnabled

writeValue

public void writeValue(org.omg.CORBA.portable.OutputStream out_sub,
                       java.io.Serializable value)
The writeValue method can be used to write GIOP data, including RMI remote objects and serialized data objects, to an underlying portable OutputStream. The implementation of the writeValue method interacts with the core Java serialization machinery. The data generated during serialization is written using the underlying OutputStream object.
Specified by:
writeValue in interface javax.rmi.CORBA.ValueHandler

readValue

public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in_sub,
                                      int offset,
                                      java.lang.Class expected,
                                      java.lang.String repoID,
                                      org.omg.SendingContext.RunTime sender)
The readValue method can be used to read GIOP data, including RMI remote objects and serialized data objects, from an underlying portable InputStream. The implementation of the readValue method interacts with the core Java serialization machinery. The data required during deserialization is read using the underlying InputStream object.
Specified by:
readValue in interface javax.rmi.CORBA.ValueHandler
Parameters:
offset - the offset in the stream of the value being unmarshaled.
clz - Java class of the value to be unmarshaled.
repositoryID - repository ID unmarshaled from the value header by the caller of readValue.
sender - the sending context object passed in the optional service context tagged SendingContextRunTime in the GIOP header, if any, or null if no sending context was passed.

getRMIRepositoryID

public java.lang.String getRMIRepositoryID(java.lang.Class clz)
This method returns the RMI-style repository ID string for clz.
Specified by:
getRMIRepositoryID in interface javax.rmi.CORBA.ValueHandler

isCustomMarshaled

public boolean isCustomMarshaled(java.lang.Class clz)
This method returns true if the value is custom marshaled and therefore requires a chunked encoding, and false otherwise.
Specified by:
isCustomMarshaled in interface javax.rmi.CORBA.ValueHandler

getRunTimeCodeBase

public org.omg.SendingContext.RunTime getRunTimeCodeBase()
This method returns the ValueHandler object's SendingContext::RunTime object reference, which is used to construct the SendingContextRuntTime service context.
Specified by:
getRunTimeCodeBase in interface javax.rmi.CORBA.ValueHandler

writeReplace

public java.io.Serializable writeReplace(java.io.Serializable value)
This method returns the serialization replacement for the value object.
Specified by:
writeReplace in interface javax.rmi.CORBA.ValueHandler