Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » cluster » io » [javadoc | source]
org.apache.catalina.cluster.io
public class: ObjectReader [javadoc | source]
java.lang.Object
   org.apache.catalina.cluster.io.ObjectReader
The object reader object is an object used in conjunction with java.nio TCP messages. This object stores the message bytes in a XByteBuffer until a full package has been received. When a full package has been received, the append method will call messageDataReceived on the callback object associated with this object reader.
This object uses an XByteBuffer which is an extendable object buffer that also allows for message encoding and decoding.
Constructor:
 public ObjectReader(SocketChannel channel,
    Selector selector,
    ListenCallback callback) 
    Create XByteBuffer and store parameter
    Parameters:
    channel -
    selector -
    callback -
Method from org.apache.catalina.cluster.io.ObjectReader Summary:
append,   execute,   getCallback,   getChannel,   write
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.cluster.io.ObjectReader Detail:
 public int append(byte[] data,
    int off,
    int len) throws IOException 
    Append new bytes to buffer.
 public int execute() throws IOException 
    Send buffer to cluster listener (callback). Is message complete receiver send message to callback?
 public ListenCallback getCallback() 
    get the current SimpleTcpCluster
 public SocketChannel getChannel() 
    Get underlying NIO channel
 public int write(ByteBuffer buf) throws IOException 
    Write Ack to sender