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
addRef
public abstract int addRef(Object obj)
throws IOException Adds an object reference.
completeCall
public abstract void completeCall()
throws IOException Completes reading the call
The call expects the following protocol data
Z
completeReply
public abstract void completeReply()
throws IOException Completes reading the call
A successful completion will have a single value:
z
getMethod
public abstract String getMethod()
Returns the call's method
getReader
public abstract Reader getReader()
throws 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
getRemoteResolver
public HessianRemoteResolver getRemoteResolver()
Sets the resolver used to lookup remote objects.
init
public abstract void init(InputStream is)
Initialize the Hessian stream with the underlying input stream.
isEnd
public abstract boolean isEnd()
throws IOException Returns true if the data has ended.
readBoolean
public abstract boolean readBoolean()
throws IOException
readBytes
public abstract byte[] readBytes()
throws IOException Reads a byte array.
b b16 b8 non-final binary chunk
B b16 b8 final binary chunk
readDouble
public abstract double readDouble()
throws IOException Reads a double.
D b64 b56 b48 b40 b32 b24 b16 b8
readEnd
public abstract void readEnd()
throws IOException Read the end byte
readInputStream
public abstract InputStream readInputStream()
throws 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
readInt
public abstract int readInt()
throws IOException Reads an integer
I b32 b24 b16 b8
readLength
public abstract int readLength()
throws IOException Reads the length of a list.
readListEnd
public abstract void readListEnd()
throws IOException Read the end byte
readListStart
public abstract int readListStart()
throws IOException Reads the start of a list
readLong
public abstract long readLong()
throws IOException Reads a long
L b64 b56 b48 b40 b32 b24 b16 b8
readMapEnd
public abstract void readMapEnd()
throws IOException Read the end byte
readMapStart
public abstract int readMapStart()
throws IOException Reads the start of a map
readNode
public abstract org.w3c.dom.Node readNode()
throws IOException Reads an XML node encoded in UTF-8
x b16 b8 non-final xml chunk
X b16 b8 final xml chunk
readNull
public abstract void readNull()
throws IOException
readObject
public abstract Object readObject()
throws IOException Reads an arbitrary object from the input stream.
readObject
public abstract Object readObject(Class expectedClass)
throws IOException Reads an arbitrary object from the input stream.
expectedClass - the expected class if the protocol doesn't supply it.
readRef
public abstract Object readRef()
throws IOException Reads a reference
R b32 b24 b16 b8
readRemote
public abstract Object readRemote()
throws IOException Reads a remote object reference to the stream. The type is the
type of the remote interface.
'r' 't' b16 b8 type url
readReply
public abstract Object readReply(Class expectedClass)
throws Throwable Reads a reply as an object.
If the reply has a fault, throws the exception.
readString
public abstract String readString()
throws IOException Reads a string encoded in UTF-8
s b16 b8 non-final string chunk
S b16 b8 final string chunk
readType
public abstract String readType()
throws IOException Reads an object type.
readUTCDate
public abstract long readUTCDate()
throws IOException Reads a date.
T b64 b56 b48 b40 b32 b24 b16 b8
setRef
public abstract void setRef(int i,
Object obj)
throws IOException Sets an object reference.
setRemoteResolver
public void setRemoteResolver(HessianRemoteResolver resolver)
Sets the resolver used to lookup remote objects.
startCall
public abstract void startCall()
throws IOException Starts reading the call
The call expects the following protocol data
c major minor
m b16 b8 method
startReply
public abstract void startReply()
throws Throwable Starts reading the reply
A successful completion will have a single value:
r
v