|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jbase.jremote.io.AbstractJBaseObjectReader
public abstract class AbstractJBaseObjectReader
Deserializes JBaseSerializable objects sent from the jbase_agent server, or any other source of serialized JCF objects. The clients of the class use readRootObject method to read deserialized JBaseSerializable objects, @see JBaseSerializable. Application classes implementing JBaseSerializable use JBaseObjectReader's methods readObject, readInt, readString, readBytes, etc., in their readFrom method. Application classes must not use readRootObject in readFrom method. Interface of this class is simillar to the one of java.io.ObjectInputStream. It does not extend java.io.ObjectInputStream because that would require handling of the original Java'a serialization protocol on the jsqld server. Concrete classes extending AbstractJBaseObjectReader should implement method createObject,
and JRemoteObjectReader.
Field Summary | |
---|---|
protected static Logger |
log
|
Constructor Summary | |
---|---|
AbstractJBaseObjectReader()
|
Method Summary | |
---|---|
protected int |
bufferedRead()
|
protected ByteBuffer |
checkBuffer(ByteBuffer bBuf,
int newDataLength)
|
abstract void |
close()
|
protected abstract byte |
getByte()
|
protected abstract int |
getBytes(byte[] buf)
|
protected abstract int |
getBytes(ByteBuffer bBuf)
|
protected abstract int |
getInt()
|
protected abstract ObjectFactory |
getObjectFactory()
This method must be implemented by concrete ObjectReaders. |
protected abstract int |
inBytes(int numberOfBytesToRead)
|
protected IByteObject |
readByteObject(char code,
IByteObject o)
|
byte[] |
readBytes()
|
int |
readInt()
Reads a 32 bits integer from the underlying InputStream. |
protected JBaseSerializable |
readJBaseSerializableObject(char code,
JBaseSerializable o)
|
Object |
readObject()
Deserializes next object from the underlying InputStream. |
IByteObject |
readObject(IByteObject o)
Reads/deserializes next byte object, a new ByteObject will be created and returned if a null argument is passed in. |
JBaseSerializable |
readObject(JBaseSerializable o)
Reads/deserializes next object, the ObjectFactory will be used to create a JBaseSerializable object if a null argument is passed in. |
JBaseSerializable |
readRootObject()
Deserializes a root object. |
String |
readString()
Reads a java.lang.String. |
protected abstract String |
readUTF()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger log
Constructor Detail |
---|
public AbstractJBaseObjectReader()
Method Detail |
---|
protected abstract int inBytes(int numberOfBytesToRead) throws IOException
IOException
protected abstract byte getByte() throws IOException
IOException
protected abstract int getInt() throws IOException
IOException
protected abstract int getBytes(byte[] buf) throws IOException
IOException
protected abstract int getBytes(ByteBuffer bBuf) throws IOException
IOException
protected abstract String readUTF() throws IOException
IOException
public abstract void close() throws IOException
close
in interface JBaseObjectReader
IOException
public Object readObject() throws IOException, ClassNotFoundException
readObject
in interface JBaseObjectReader
IOException
ClassNotFoundException
public JBaseSerializable readObject(JBaseSerializable o) throws IOException, ClassNotFoundException
readObject
in interface JBaseObjectReader
IOException
ClassNotFoundException
public IByteObject readObject(IByteObject o) throws IOException
readObject
in interface JBaseObjectReader
IOException
protected IByteObject readByteObject(char code, IByteObject o) throws IOException
IOException
protected ByteBuffer checkBuffer(ByteBuffer bBuf, int newDataLength)
protected JBaseSerializable readJBaseSerializableObject(char code, JBaseSerializable o) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
protected abstract ObjectFactory getObjectFactory() throws UnknownTypeException
objectType
- type identifier, @see JBaseSerializable.TYPE
UnknownTypeException
public int readInt() throws IOException
readInt
in interface JBaseObjectReader
IOException
public byte[] readBytes() throws IOException
readBytes
in interface JBaseObjectReader
IOException
public String readString() throws IOException
readString
in interface JBaseObjectReader
IOException
public JBaseSerializable readRootObject() throws IOException, ClassNotFoundException
JBaseObjectReader
readRootObject
in interface JBaseObjectReader
IOException
ClassNotFoundException
protected int bufferedRead() throws IOException
IOException
|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |