Class ValueHandlerImpl

java.lang.Object
com.sun.corba.se.impl.io.ValueHandlerImpl
All Implemented Interfaces:
ValueHandler, ValueHandlerMultiFormat

public final class ValueHandlerImpl extends Object implements ValueHandlerMultiFormat
  • Field Details

  • Method Details

    • 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 interface ValueHandlerMultiFormat
    • writeValue

      public void writeValue(OutputStream out, Serializable value, byte streamFormatVersion)
      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 interface ValueHandlerMultiFormat
    • writeValue

      public void writeValue(OutputStream out, Serializable value)
      Writes the value to the stream using java semantics.
      Specified by:
      writeValue in interface ValueHandler
      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 clazz, String repositoryID, RunTime rt)
      Reads a value from the stream using java semantics.
      Specified by:
      readValue in interface ValueHandler
      Parameters:
      in - The stream to read the value from
      clazz - The type of the value to be read in
      rt - The sending context runtime
      offset - the current position in the input stream.
      repositoryID - the RepositoryId of the value to be read in.
      Returns:
      the value read from the stream.
    • getRMIRepositoryID

      public String getRMIRepositoryID(Class clz)
      Returns the repository ID for the given RMI value Class.
      Specified by:
      getRMIRepositoryID in interface ValueHandler
      Parameters:
      clz - The class to return a repository ID for.
      Returns:
      the repository ID of the Class.
    • isCustomMarshaled

      public boolean isCustomMarshaled(Class clz)
      Indicates whether the given Class performs custom or default marshaling.
      Specified by:
      isCustomMarshaled in interface ValueHandler
      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 clients do the same on the first GIOP request.
      Specified by:
      getRunTimeCodeBase in interface ValueHandler
      Returns:
      the SendingContext.CodeBase of this ValueHandler.
    • useFullValueDescription

      public boolean useFullValueDescription(Class clazz, String repositoryID) throws IOException
      Returns a boolean of whether or not RepositoryId indicates FullValueDescriptor. used for backward compatability
      Throws:
      IOException
    • getClassName

      public String getClassName(String id)
    • getClassFromType

      public Class getClassFromType(String id) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • getAnyClassFromType

      public Class getAnyClassFromType(String id) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • createForAnyType

      public String createForAnyType(Class cl)
    • getDefinedInId

      public String getDefinedInId(String id)
    • getUnqualifiedName

      public String getUnqualifiedName(String id)
    • getSerialVersionUID

      public String getSerialVersionUID(String id)
    • isAbstractBase

      public boolean isAbstractBase(Class clazz)
    • isSequence

      public boolean isSequence(String id)
    • writeReplace

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