Class AbstractHessianInput

  • Direct Known Subclasses:
    AbstractBurlapInput, Hessian2Input, HessianInput

    public abstract class AbstractHessianInput
    extends java.lang.Object
    Abstract base class for Hessian requests. Hessian users should only need to use the methods in this class.
     AbstractHessianInput in = ...; // get input
     String value;
    
     in.startReply();         // read reply header
     value = in.readString(); // read string value
     in.completeReply();      // read reply footer
     
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract int addRef​(java.lang.Object obj)
      Adds an object reference.
      void close()  
      abstract void completeCall()
      Completes reading the call
      abstract void completeReply()
      Completes reading the call
      abstract java.lang.String getMethod()
      Returns the call's method
      abstract java.io.Reader getReader()
      Starts reading a string.
      HessianRemoteResolver getRemoteResolver()
      Sets the resolver used to lookup remote objects.
      void init​(java.io.InputStream is)
      Initialize the Hessian stream with the underlying input stream.
      abstract boolean isEnd()
      Returns true if the data has ended.
      abstract boolean readBoolean()
      Reads a boolean
      abstract byte[] readBytes()
      Reads a byte array.
      abstract int readCall()
      Reads the call
      abstract double readDouble()
      Reads a double.
      abstract void readEnd()
      Read the end byte
      abstract java.lang.String readHeader()
      Reads a header, returning null if there are no headers.
      abstract java.io.InputStream readInputStream()
      Starts reading a byte array using an input stream.
      abstract int readInt()
      Reads an integer
      abstract int readLength()
      Reads the length of a list.
      abstract void readListEnd()
      Read the end byte
      abstract int readListStart()
      Reads the start of a list
      abstract long readLong()
      Reads a long
      abstract void readMapEnd()
      Read the end byte
      abstract int readMapStart()
      Reads the start of a map
      abstract java.lang.String readMethod()
      Starts reading the call
      int readMethodArgLength()
      Reads the number of method arguments
      org.w3c.dom.Node readNode()
      Reads an XML node encoded in UTF-8
      abstract void readNull()
      Reads a null
      abstract java.lang.Object readObject()
      Reads an arbitrary object from the input stream.
      abstract java.lang.Object readObject​(java.lang.Class expectedClass)
      Reads an arbitrary object from the input stream.
      abstract java.lang.Object readRef()
      Reads a reference
      abstract java.lang.Object readRemote()
      Reads a remote object reference to the stream.
      abstract java.lang.Object readReply​(java.lang.Class expectedClass)
      Reads a reply as an object.
      abstract java.lang.String readString()
      Reads a string encoded in UTF-8
      boolean readToOutputStream​(java.io.OutputStream os)
      Reads data to an output stream.
      abstract java.lang.String readType()
      Reads an object type.
      abstract long readUTCDate()
      Reads a date.
      void resetReferences()
      Resets the references for streaming.
      abstract void setRef​(int i, java.lang.Object obj)
      Sets an object reference.
      void setRemoteResolver​(HessianRemoteResolver resolver)
      Sets the resolver used to lookup remote objects.
      void setSerializerFactory​(SerializerFactory ser)
      Sets the serializer factory.
      void skipOptionalCall()
      For backward compatibility with HessianSkeleton
      abstract void startCall()
      Starts reading the call, including the headers.
      abstract void startReply()
      Starts reading the reply
      void startReplyBody()
      Starts reading the body of the reply, i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractHessianInput

        public AbstractHessianInput()
    • Method Detail

      • init

        public void init​(java.io.InputStream is)
        Initialize the Hessian stream with the underlying input stream.
      • getMethod

        public abstract java.lang.String getMethod()
        Returns the call's method
      • setRemoteResolver

        public void setRemoteResolver​(HessianRemoteResolver resolver)
        Sets the resolver used to lookup remote objects.
      • getRemoteResolver

        public HessianRemoteResolver getRemoteResolver()
        Sets the resolver used to lookup remote objects.
      • setSerializerFactory

        public void setSerializerFactory​(SerializerFactory ser)
        Sets the serializer factory.
      • readCall

        public abstract int readCall()
                              throws java.io.IOException
        Reads the call
         c major minor
         
        Throws:
        java.io.IOException
      • skipOptionalCall

        public void skipOptionalCall()
                              throws java.io.IOException
        For backward compatibility with HessianSkeleton
        Throws:
        java.io.IOException
      • readHeader

        public abstract java.lang.String readHeader()
                                             throws java.io.IOException
        Reads a header, returning null if there are no headers.
         H b16 b8 value
         
        Throws:
        java.io.IOException
      • readMethod

        public abstract java.lang.String readMethod()
                                             throws java.io.IOException
        Starts reading the call

        A successful completion will have a single value:

         m b16 b8 method
         
        Throws:
        java.io.IOException
      • readMethodArgLength

        public int readMethodArgLength()
                                throws java.io.IOException
        Reads the number of method arguments
        Returns:
        -1 for a variable length (hessian 1.0)
        Throws:
        java.io.IOException
      • startCall

        public abstract void startCall()
                                throws java.io.IOException
        Starts reading the call, including the headers.

        The call expects the following protocol data

         c major minor
         m b16 b8 method
         
        Throws:
        java.io.IOException
      • completeCall

        public abstract void completeCall()
                                   throws java.io.IOException
        Completes reading the call

        The call expects the following protocol data

         Z
         
        Throws:
        java.io.IOException
      • readReply

        public abstract java.lang.Object readReply​(java.lang.Class expectedClass)
                                            throws java.lang.Throwable
        Reads a reply as an object. If the reply has a fault, throws the exception.
        Throws:
        java.lang.Throwable
      • startReply

        public abstract void startReply()
                                 throws java.lang.Throwable
        Starts reading the reply

        A successful completion will have a single value:

         r
         v
         
        Throws:
        java.lang.Throwable
      • startReplyBody

        public void startReplyBody()
                            throws java.lang.Throwable
        Starts reading the body of the reply, i.e. after the 'r' has been parsed.
        Throws:
        java.lang.Throwable
      • completeReply

        public abstract void completeReply()
                                    throws java.io.IOException
        Completes reading the call

        A successful completion will have a single value:

         z
         
        Throws:
        java.io.IOException
      • readBoolean

        public abstract boolean readBoolean()
                                     throws java.io.IOException
        Reads a boolean
         T
         F
         
        Throws:
        java.io.IOException
      • readNull

        public abstract void readNull()
                               throws java.io.IOException
        Reads a null
         N
         
        Throws:
        java.io.IOException
      • readInt

        public abstract int readInt()
                             throws java.io.IOException
        Reads an integer
         I b32 b24 b16 b8
         
        Throws:
        java.io.IOException
      • readLong

        public abstract long readLong()
                               throws java.io.IOException
        Reads a long
         L b64 b56 b48 b40 b32 b24 b16 b8
         
        Throws:
        java.io.IOException
      • readDouble

        public abstract double readDouble()
                                   throws java.io.IOException
        Reads a double.
         D b64 b56 b48 b40 b32 b24 b16 b8
         
        Throws:
        java.io.IOException
      • readUTCDate

        public abstract long readUTCDate()
                                  throws java.io.IOException
        Reads a date.
         T b64 b56 b48 b40 b32 b24 b16 b8
         
        Throws:
        java.io.IOException
      • readString

        public abstract java.lang.String readString()
                                             throws java.io.IOException
        Reads a string encoded in UTF-8
         s b16 b8 non-final string chunk
         S b16 b8 final string chunk
         
        Throws:
        java.io.IOException
      • readNode

        public org.w3c.dom.Node readNode()
                                  throws java.io.IOException
        Reads an XML node encoded in UTF-8
         x b16 b8 non-final xml chunk
         X b16 b8 final xml chunk
         
        Throws:
        java.io.IOException
      • getReader

        public abstract java.io.Reader getReader()
                                          throws java.io.IOException
        Starts reading a string. All the characters must be read before calling the next method. The actual characters will be read with the reader's read() or read(char [], int, int).
         s b16 b8 non-final string chunk
         S b16 b8 final string chunk
         
        Throws:
        java.io.IOException
      • readInputStream

        public abstract java.io.InputStream readInputStream()
                                                     throws java.io.IOException
        Starts reading a byte array using an input stream. All the bytes must be read before calling the following method.
         b b16 b8 non-final binary chunk
         B b16 b8 final binary chunk
         
        Throws:
        java.io.IOException
      • readToOutputStream

        public boolean readToOutputStream​(java.io.OutputStream os)
                                   throws java.io.IOException
        Reads data to an output stream.
         b b16 b8 non-final binary chunk
         B b16 b8 final binary chunk
         
        Throws:
        java.io.IOException
      • readBytes

        public abstract byte[] readBytes()
                                  throws java.io.IOException
        Reads a byte array.
         b b16 b8 non-final binary chunk
         B b16 b8 final binary chunk
         
        Throws:
        java.io.IOException
      • readObject

        public abstract java.lang.Object readObject​(java.lang.Class expectedClass)
                                             throws java.io.IOException
        Reads an arbitrary object from the input stream.
        Parameters:
        expectedClass - the expected class if the protocol doesn't supply it.
        Throws:
        java.io.IOException
      • readObject

        public abstract java.lang.Object readObject()
                                             throws java.io.IOException
        Reads an arbitrary object from the input stream.
        Throws:
        java.io.IOException
      • readRemote

        public abstract java.lang.Object readRemote()
                                             throws java.io.IOException
        Reads a remote object reference to the stream. The type is the type of the remote interface.
         'r' 't' b16 b8 type url
         
        Throws:
        java.io.IOException
      • readRef

        public abstract java.lang.Object readRef()
                                          throws java.io.IOException
        Reads a reference
         R b32 b24 b16 b8
         
        Throws:
        java.io.IOException
      • addRef

        public abstract int addRef​(java.lang.Object obj)
                            throws java.io.IOException
        Adds an object reference.
        Throws:
        java.io.IOException
      • setRef

        public abstract void setRef​(int i,
                                    java.lang.Object obj)
                             throws java.io.IOException
        Sets an object reference.
        Throws:
        java.io.IOException
      • resetReferences

        public void resetReferences()
        Resets the references for streaming.
      • readListStart

        public abstract int readListStart()
                                   throws java.io.IOException
        Reads the start of a list
        Throws:
        java.io.IOException
      • readLength

        public abstract int readLength()
                                throws java.io.IOException
        Reads the length of a list.
        Throws:
        java.io.IOException
      • readMapStart

        public abstract int readMapStart()
                                  throws java.io.IOException
        Reads the start of a map
        Throws:
        java.io.IOException
      • readType

        public abstract java.lang.String readType()
                                           throws java.io.IOException
        Reads an object type.
        Throws:
        java.io.IOException
      • isEnd

        public abstract boolean isEnd()
                               throws java.io.IOException
        Returns true if the data has ended.
        Throws:
        java.io.IOException
      • readEnd

        public abstract void readEnd()
                              throws java.io.IOException
        Read the end byte
        Throws:
        java.io.IOException
      • readMapEnd

        public abstract void readMapEnd()
                                 throws java.io.IOException
        Read the end byte
        Throws:
        java.io.IOException
      • readListEnd

        public abstract void readListEnd()
                                  throws java.io.IOException
        Read the end byte
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException