jremote jbase5.2.1

com.jbase.jremote.io
Class NIOJBaseObjectReader

java.lang.Object
  extended by com.jbase.jremote.io.AbstractJBaseObjectReader
      extended by com.jbase.jremote.io.NIOJBaseObjectReader
All Implemented Interfaces:
JBaseObjectReader

public class NIOJBaseObjectReader
extends AbstractJBaseObjectReader

jBase object reader based on the new Java IO.

Author:
aphethean

Field Summary
static long READ_TIMEOUT
          The temporary selectors read timeout.
 
Fields inherited from class com.jbase.jremote.io.AbstractJBaseObjectReader
log
 
Constructor Summary
NIOJBaseObjectReader(ObjectFactory factory, java.nio.channels.SocketChannel channel)
           
 
Method Summary
protected  void checkBuffer(int newDataLength)
           
 void close()
           
protected  int doRead(int numberOfBytes)
          Read bytes using the read a temporary Selector
protected  byte getByte()
           
protected  int getBytes(byte[] buf)
           
protected  int getBytes(java.nio.ByteBuffer bBuf)
           
protected  int getInt()
           
 ObjectFactory getObjectFactory()
          This method must be implemented by concrete ObjectReaders.
protected  int inBytes(int numberOfBytesToRead)
           
 boolean isClosed()
           
protected  java.lang.String readUTF()
           
 void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
           
 
Methods inherited from class com.jbase.jremote.io.AbstractJBaseObjectReader
bufferedRead, checkBuffer, readByteObject, readBytes, readInt, readJBaseSerializableObject, readObject, readObject, readObject, readRootObject, readString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_TIMEOUT

public static final long READ_TIMEOUT
The temporary selectors read timeout. 30 seconds.

See Also:
Constant Field Values
Constructor Detail

NIOJBaseObjectReader

public NIOJBaseObjectReader(ObjectFactory factory,
                            java.nio.channels.SocketChannel channel)
Method Detail

getObjectFactory

public ObjectFactory getObjectFactory()
Description copied from class: AbstractJBaseObjectReader
This method must be implemented by concrete ObjectReaders.

Specified by:
getObjectFactory in class AbstractJBaseObjectReader
Returns:
an instance of a class implementing JBaseSerializable

close

public void close()
           throws java.io.IOException
Specified by:
close in interface JBaseObjectReader
Specified by:
close in class AbstractJBaseObjectReader
Throws:
java.io.IOException

getByte

protected byte getByte()
                throws java.io.IOException
Specified by:
getByte in class AbstractJBaseObjectReader
Throws:
java.io.IOException

getInt

protected int getInt()
              throws java.io.IOException
Specified by:
getInt in class AbstractJBaseObjectReader
Throws:
java.io.IOException

getBytes

protected int getBytes(byte[] buf)
                throws java.io.IOException
Specified by:
getBytes in class AbstractJBaseObjectReader
Throws:
java.io.IOException

getBytes

protected int getBytes(java.nio.ByteBuffer bBuf)
                throws java.io.IOException
Specified by:
getBytes in class AbstractJBaseObjectReader
Throws:
java.io.IOException

inBytes

protected int inBytes(int numberOfBytesToRead)
               throws java.io.IOException
Specified by:
inBytes in class AbstractJBaseObjectReader
Throws:
java.io.IOException

readUTF

protected java.lang.String readUTF()
                            throws java.io.IOException
Specified by:
readUTF in class AbstractJBaseObjectReader
Throws:
java.io.IOException

doRead

protected int doRead(int numberOfBytes)
              throws java.io.IOException
Read bytes using the read a temporary Selector

Throws:
java.io.IOException

checkBuffer

protected void checkBuffer(int newDataLength)

isClosed

public boolean isClosed()

setSocketChannel

public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)

jremote jbase5.2.1

Copyright © 2010 TEMENOS. All Rights Reserved.