类 AbstractHessianOutput

  • 直接已知子类:
    Hessian2Output, HessianOutput

    public abstract class AbstractHessianOutput
    extends 
    Abstract output stream for Hessian requests.

     OutputStream os = ...; // from http connection
     AbstractOutput out = new HessianSerializerOutput(os);
     String value;
    
     out.startCall("hello");  // start hello call
     out.writeString("arg1"); // write a string argument
     out.completeCall();      // complete the call
     
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 已过时的方法 
      修饰符和类型 方法 说明
      abstract boolean  object)
      Adds an object to the reference list.
      void  method, [] args)
      Writes a complete method call.
      void close()  
      abstract void completeCall()
      Completes the method call:
      void completeReply()  
      SerializerFactory findSerializerFactory()
      Gets the serializer factory.
      void flush()  
      SerializerFactory getSerializerFactory()
      Gets the serializer factory.
      void  os)
      Initialize the output with a new underlying stream.
      abstract boolean  obj)
      Removes a reference.
      abstract boolean  oldRef,  newRef)
      Replaces a reference from one object to another.
      void resetReferences()
      Resets the references for streaming.
      void setSerializerFactory​(SerializerFactory factory)
      Sets the serializer factory.
      abstract void startCall()
      Starts the method call:
      abstract void  method, int length)
      Starts the method call:
      void startReply()  
      abstract void writeBoolean​(boolean value)
      Writes a boolean value to the stream.
      abstract void writeByteBufferEnd​(byte[] buffer, int offset, int length)
      Writes the last chunk of a byte buffer to the stream.
      abstract void writeByteBufferPart​(byte[] buffer, int offset, int length)
      Writes a byte buffer to the stream.
      abstract void writeByteBufferStart()
      Writes a byte buffer to the stream.
      abstract void writeBytes​(byte[] buffer)
      Writes a byte array to the stream.
      abstract void writeBytes​(byte[] buffer, int offset, int length)
      Writes a byte array to the stream.
      void writeClassFieldLength​(int len)
      Writes the end of the class.
      abstract void writeDouble​(double value)
      Writes a double value to the stream.
      void  code,  message,  detail)  
      void  name)
      已过时。 
      abstract void writeInt​(int value)
      Writes an integer value to the stream.
      abstract boolean writeListBegin​(int length,  type)
      Writes the list header to the stream.
      abstract void writeListEnd()
      Writes the tail of the list to the stream.
      abstract void writeLong​(long value)
      Writes a long value to the stream.
      abstract void  type)
      Writes the map header to the stream.
      abstract void writeMapEnd()
      Writes the tail of the map to the stream.
      abstract void  method)
      Writes the method tag.
      abstract void writeNull()
      Writes a null value to the stream.
      abstract void  object)
      Writes a generic object to the output stream.
      int  type)
      Writes the object header to the stream (for Hessian 2.0), or a Map for Hessian 1.0.
      void writeObjectEnd()
      Writes the tail of the object to the stream.
      void  o)  
      abstract void writeString​(char[] buffer, int offset, int length)
      Writes a string value to the stream using UTF-8 encoding.
      abstract void  value)
      Writes a string value to the stream using UTF-8 encoding.
      abstract void writeUTCDate​(long time)
      Writes a date to the stream.
      • 从类继承的方法 java.lang.

        , , , , , , , ,
    • 构造器详细资料

      • AbstractHessianOutput

        public AbstractHessianOutput()
    • 方法详细资料

      • getSerializerFactory

        public SerializerFactory getSerializerFactory()
        Gets the serializer factory.
      • setSerializerFactory

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

        public final SerializerFactory findSerializerFactory()
        Gets the serializer factory.
      • init

        public void init​( os)
        Initialize the output with a new underlying stream.
      • call

        public void call​( method,
                         [] args)
                  throws 
        Writes a complete method call.
        抛出:
      • startCall

        public abstract void startCall()
                                throws 
        Starts the method call:

         C
         
        参数:
        method - the method name to call.
        抛出:
      • startCall

        public abstract void startCall​( method,
                                       int length)
                                throws 
        Starts the method call:

         C string int
         
        参数:
        method - the method name to call.
        抛出:
      • writeHeader

        public void writeHeader​( name)
                         throws 
        已过时。
        For Hessian 2.0, use the Header envelope instead
        抛出:
      • writeMethod

        public abstract void writeMethod​( method)
                                  throws 
        Writes the method tag.

         string
         
        参数:
        method - the method name to call.
        抛出:
      • completeCall

        public abstract void completeCall()
                                   throws 
        Completes the method call:

         
        抛出:
      • writeBoolean

        public abstract void writeBoolean​(boolean value)
                                   throws 
        Writes a boolean value to the stream. The boolean will be written with the following syntax:

         T
         F
         
        参数:
        value - the boolean value to write.
        抛出:
      • writeInt

        public abstract void writeInt​(int value)
                               throws 
        Writes an integer value to the stream. The integer will be written with the following syntax:

         I b32 b24 b16 b8
         
        参数:
        value - the integer value to write.
        抛出:
      • writeLong

        public abstract void writeLong​(long value)
                                throws 
        Writes a long value to the stream. The long will be written with the following syntax:

         L b64 b56 b48 b40 b32 b24 b16 b8
         
        参数:
        value - the long value to write.
        抛出:
      • writeDouble

        public abstract void writeDouble​(double value)
                                  throws 
        Writes a double value to the stream. The double will be written with the following syntax:

         D b64 b56 b48 b40 b32 b24 b16 b8
         
        参数:
        value - the double value to write.
        抛出:
      • writeUTCDate

        public abstract void writeUTCDate​(long time)
                                   throws 
        Writes a date to the stream.

         T  b64 b56 b48 b40 b32 b24 b16 b8
         
        参数:
        time - the date in milliseconds from the epoch in UTC
        抛出:
      • writeNull

        public abstract void writeNull()
                                throws 
        Writes a null value to the stream. The null will be written with the following syntax

         N
         
        参数:
        value - the string value to write.
        抛出:
      • writeString

        public abstract void writeString​( value)
                                  throws 
        Writes a string value to the stream using UTF-8 encoding. The string will be written with the following syntax:

         S b16 b8 string-value
         

        If the value is null, it will be written as

         N
         
        参数:
        value - the string value to write.
        抛出:
      • writeString

        public abstract void writeString​(char[] buffer,
                                         int offset,
                                         int length)
                                  throws 
        Writes a string value to the stream using UTF-8 encoding. The string will be written with the following syntax:

         S b16 b8 string-value
         

        If the value is null, it will be written as

         N
         
        参数:
        value - the string value to write.
        抛出:
      • writeBytes

        public abstract void writeBytes​(byte[] buffer)
                                 throws 
        Writes a byte array to the stream. The array will be written with the following syntax:

         B b16 b18 bytes
         

        If the value is null, it will be written as

         N
         
        参数:
        value - the string value to write.
        抛出:
      • writeBytes

        public abstract void writeBytes​(byte[] buffer,
                                        int offset,
                                        int length)
                                 throws 
        Writes a byte array to the stream. The array will be written with the following syntax:

         B b16 b18 bytes
         

        If the value is null, it will be written as

         N
         
        参数:
        value - the string value to write.
        抛出:
      • writeByteBufferStart

        public abstract void writeByteBufferStart()
                                           throws 
        Writes a byte buffer to the stream.
        抛出:
      • writeByteBufferPart

        public abstract void writeByteBufferPart​(byte[] buffer,
                                                 int offset,
                                                 int length)
                                          throws 
        Writes a byte buffer to the stream.

         b b16 b18 bytes
         
        参数:
        value - the string value to write.
        抛出:
      • writeByteBufferEnd

        public abstract void writeByteBufferEnd​(byte[] buffer,
                                                int offset,
                                                int length)
                                         throws 
        Writes the last chunk of a byte buffer to the stream.

         b b16 b18 bytes
         
        参数:
        value - the string value to write.
        抛出:
      • removeRef

        public abstract boolean removeRef​( obj)
                                   throws 
        Removes a reference.
        抛出:
      • replaceRef

        public abstract boolean replaceRef​( oldRef,
                                            newRef)
                                    throws 
        Replaces a reference from one object to another.
        抛出:
      • addRef

        public abstract boolean addRef​( object)
                                throws 
        Adds an object to the reference list. If the object already exists, writes the reference, otherwise, the caller is responsible for the serialization.

         R b32 b24 b16 b8
         
        参数:
        object - the object to add as a reference.
        返回:
        true if the object has already been written.
        抛出:
      • resetReferences

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

        public abstract void writeObject​( object)
                                  throws 
        Writes a generic object to the output stream.
        抛出:
      • writeListBegin

        public abstract boolean writeListBegin​(int length,
                                                type)
                                        throws 
        Writes the list header to the stream. List writers will call writeListBegin followed by the list contents and then call writeListEnd.

         V
           x13 java.util.ArrayList   # type
           x93                       # length=3
           x91                       # 1
           x92                       # 2
           x93                       # 3
         </list>
         
        抛出:
      • writeListEnd

        public abstract void writeListEnd()
                                   throws 
        Writes the tail of the list to the stream.
        抛出:
      • writeMapBegin

        public abstract void writeMapBegin​( type)
                                    throws 
        Writes the map header to the stream. Map writers will call writeMapBegin followed by the map contents and then call writeMapEnd.

         M type ( )* Z
         
        抛出:
      • writeMapEnd

        public abstract void writeMapEnd()
                                  throws 
        Writes the tail of the map to the stream.
        抛出:
      • writeObjectBegin

        public int writeObjectBegin​( type)
                             throws 
        Writes the object header to the stream (for Hessian 2.0), or a Map for Hessian 1.0. Object writers will call writeObjectBegin followed by the map contents and then call writeObjectEnd.

         C type int *
         C int *
         
        返回:
        true if the object has already been defined.
        抛出:
      • writeClassFieldLength

        public void writeClassFieldLength​(int len)
                                   throws 
        Writes the end of the class.
        抛出:
      • writeObjectEnd

        public void writeObjectEnd()
                            throws 
        Writes the tail of the object to the stream.
        抛出:
      • writeReply

        public void writeReply​( o)
                        throws 
        抛出:
      • startReply

        public void startReply()
                        throws 
        抛出:
      • completeReply

        public void completeReply()
                           throws 
        抛出:
      • writeFault

        public void writeFault​( code,
                                message,
                                detail)
                        throws 
        抛出:
      • flush

        public void flush()
                   throws 
        抛出:
      • close

        public void close()
                   throws 
        抛出: