Package com.caucho.hessian.io
Class AbstractHessianInput
- java.lang.Object
-
- com.caucho.hessian.io.AbstractHessianInput
-
- Direct Known Subclasses:
AbstractBurlapInput,Hessian2Input,HessianInput
public abstract class AbstractHessianInput extends java.lang.ObjectAbstract 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
-
-
Constructor Summary
Constructors Constructor Description AbstractHessianInput()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract intaddRef(java.lang.Object obj)Adds an object reference.voidclose()abstract voidcompleteCall()Completes reading the callabstract voidcompleteReply()Completes reading the callabstract java.lang.StringgetMethod()Returns the call's methodabstract java.io.ReadergetReader()Starts reading a string.HessianRemoteResolvergetRemoteResolver()Sets the resolver used to lookup remote objects.voidinit(java.io.InputStream is)Initialize the Hessian stream with the underlying input stream.abstract booleanisEnd()Returns true if the data has ended.abstract booleanreadBoolean()Reads a booleanabstract byte[]readBytes()Reads a byte array.abstract intreadCall()Reads the callabstract doublereadDouble()Reads a double.abstract voidreadEnd()Read the end byteabstract java.lang.StringreadHeader()Reads a header, returning null if there are no headers.abstract java.io.InputStreamreadInputStream()Starts reading a byte array using an input stream.abstract intreadInt()Reads an integerabstract intreadLength()Reads the length of a list.abstract voidreadListEnd()Read the end byteabstract intreadListStart()Reads the start of a listabstract longreadLong()Reads a longabstract voidreadMapEnd()Read the end byteabstract intreadMapStart()Reads the start of a mapabstract java.lang.StringreadMethod()Starts reading the callintreadMethodArgLength()Reads the number of method argumentsorg.w3c.dom.NodereadNode()Reads an XML node encoded in UTF-8abstract voidreadNull()Reads a nullabstract java.lang.ObjectreadObject()Reads an arbitrary object from the input stream.abstract java.lang.ObjectreadObject(java.lang.Class expectedClass)Reads an arbitrary object from the input stream.abstract java.lang.ObjectreadRef()Reads a referenceabstract java.lang.ObjectreadRemote()Reads a remote object reference to the stream.abstract java.lang.ObjectreadReply(java.lang.Class expectedClass)Reads a reply as an object.abstract java.lang.StringreadString()Reads a string encoded in UTF-8booleanreadToOutputStream(java.io.OutputStream os)Reads data to an output stream.abstract java.lang.StringreadType()Reads an object type.abstract longreadUTCDate()Reads a date.voidresetReferences()Resets the references for streaming.abstract voidsetRef(int i, java.lang.Object obj)Sets an object reference.voidsetRemoteResolver(HessianRemoteResolver resolver)Sets the resolver used to lookup remote objects.voidsetSerializerFactory(SerializerFactory ser)Sets the serializer factory.voidskipOptionalCall()For backward compatibility with HessianSkeletonabstract voidstartCall()Starts reading the call, including the headers.abstract voidstartReply()Starts reading the replyvoidstartReplyBody()Starts reading the body of the reply, i.e.
-
-
-
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.IOExceptionReads the callc major minor
- Throws:
java.io.IOException
-
skipOptionalCall
public void skipOptionalCall() throws java.io.IOExceptionFor backward compatibility with HessianSkeleton- Throws:
java.io.IOException
-
readHeader
public abstract java.lang.String readHeader() throws java.io.IOExceptionReads 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.IOExceptionStarts reading the callA successful completion will have a single value:
m b16 b8 method
- Throws:
java.io.IOException
-
readMethodArgLength
public int readMethodArgLength() throws java.io.IOExceptionReads 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.IOExceptionStarts 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.IOExceptionCompletes reading the callThe 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.ThrowableReads 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.ThrowableStarts reading the replyA successful completion will have a single value:
r v
- Throws:
java.lang.Throwable
-
startReplyBody
public void startReplyBody() throws java.lang.ThrowableStarts 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.IOExceptionCompletes reading the callA successful completion will have a single value:
z
- Throws:
java.io.IOException
-
readBoolean
public abstract boolean readBoolean() throws java.io.IOExceptionReads a booleanT F
- Throws:
java.io.IOException
-
readNull
public abstract void readNull() throws java.io.IOExceptionReads a nullN
- Throws:
java.io.IOException
-
readInt
public abstract int readInt() throws java.io.IOExceptionReads an integerI b32 b24 b16 b8
- Throws:
java.io.IOException
-
readLong
public abstract long readLong() throws java.io.IOExceptionReads a longL b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
java.io.IOException
-
readDouble
public abstract double readDouble() throws java.io.IOExceptionReads a double.D b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
java.io.IOException
-
readUTCDate
public abstract long readUTCDate() throws java.io.IOExceptionReads 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.IOExceptionReads a string encoded in UTF-8s 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.IOExceptionReads an XML node encoded in UTF-8x 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.IOExceptionStarts 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.IOExceptionStarts 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.IOExceptionReads 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.IOExceptionReads 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.IOExceptionReads 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.IOExceptionReads an arbitrary object from the input stream.- Throws:
java.io.IOException
-
readRemote
public abstract java.lang.Object readRemote() throws java.io.IOExceptionReads 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.IOExceptionReads a referenceR b32 b24 b16 b8
- Throws:
java.io.IOException
-
addRef
public abstract int addRef(java.lang.Object obj) throws java.io.IOExceptionAdds an object reference.- Throws:
java.io.IOException
-
setRef
public abstract void setRef(int i, java.lang.Object obj) throws java.io.IOExceptionSets an object reference.- Throws:
java.io.IOException
-
resetReferences
public void resetReferences()
Resets the references for streaming.
-
readListStart
public abstract int readListStart() throws java.io.IOExceptionReads the start of a list- Throws:
java.io.IOException
-
readLength
public abstract int readLength() throws java.io.IOExceptionReads the length of a list.- Throws:
java.io.IOException
-
readMapStart
public abstract int readMapStart() throws java.io.IOExceptionReads the start of a map- Throws:
java.io.IOException
-
readType
public abstract java.lang.String readType() throws java.io.IOExceptionReads an object type.- Throws:
java.io.IOException
-
isEnd
public abstract boolean isEnd() throws java.io.IOExceptionReturns true if the data has ended.- Throws:
java.io.IOException
-
readEnd
public abstract void readEnd() throws java.io.IOExceptionRead the end byte- Throws:
java.io.IOException
-
readMapEnd
public abstract void readMapEnd() throws java.io.IOExceptionRead the end byte- Throws:
java.io.IOException
-
readListEnd
public abstract void readListEnd() throws java.io.IOExceptionRead the end byte- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
-