org.fusesource.stompjms.client
Class StompProtocolCodec

java.lang.Object
  extended by org.fusesource.stompjms.client.StompProtocolCodec
All Implemented Interfaces:
ProtocolCodec

public class StompProtocolCodec
extends java.lang.Object
implements ProtocolCodec

Author:
Hiram Chirino

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.fusesource.stompjms.client.transport.ProtocolCodec
ProtocolCodec.BufferState
 
Constructor Summary
StompProtocolCodec()
           
 
Method Summary
 ProtocolCodec.BufferState flush()
          Attempts to complete the previous write which did not complete.
 boolean full()
          Is the codec's buffer full?
 int getLastReadSize()
           
 int getLastWriteSize()
           
 int getReadBufferSize()
           
 long getReadCounter()
           
 int getWriteBufferSize()
           
 long getWriteCounter()
           
 boolean is_empty()
           
 java.lang.Object read()
          Non-blocking channel based decoding.
 void setReadableByteChannel(java.nio.channels.ReadableByteChannel channel)
           
 void setWritableByteChannel(java.nio.channels.WritableByteChannel channel)
           
 void unread(org.fusesource.hawtbuf.Buffer buffer)
          Pushes back a buffer as being unread.
 ProtocolCodec.BufferState write(java.lang.Object value)
          Non-blocking channel based encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StompProtocolCodec

public StompProtocolCodec()
Method Detail

setWritableByteChannel

public void setWritableByteChannel(java.nio.channels.WritableByteChannel channel)
                            throws java.net.SocketException
Specified by:
setWritableByteChannel in interface ProtocolCodec
Throws:
java.net.SocketException

getReadBufferSize

public int getReadBufferSize()
Specified by:
getReadBufferSize in interface ProtocolCodec

getWriteBufferSize

public int getWriteBufferSize()
Specified by:
getWriteBufferSize in interface ProtocolCodec

full

public boolean full()
Description copied from interface: ProtocolCodec
Is the codec's buffer full?

Specified by:
full in interface ProtocolCodec
Returns:

is_empty

public boolean is_empty()

getWriteCounter

public long getWriteCounter()
Specified by:
getWriteCounter in interface ProtocolCodec
Returns:
The number of bytes written.

getLastWriteSize

public int getLastWriteSize()
Specified by:
getLastWriteSize in interface ProtocolCodec
Returns:
The number of bytes read in the last write io performed.

write

public ProtocolCodec.BufferState write(java.lang.Object value)
                                throws java.io.IOException
Description copied from interface: ProtocolCodec
Non-blocking channel based encoding.

Specified by:
write in interface ProtocolCodec
Returns:
true if the write completed.
Throws:
java.io.IOException

flush

public ProtocolCodec.BufferState flush()
                                throws java.io.IOException
Description copied from interface: ProtocolCodec
Attempts to complete the previous write which did not complete.

Specified by:
flush in interface ProtocolCodec
Returns:
Throws:
java.io.IOException

setReadableByteChannel

public void setReadableByteChannel(java.nio.channels.ReadableByteChannel channel)
                            throws java.net.SocketException
Specified by:
setReadableByteChannel in interface ProtocolCodec
Throws:
java.net.SocketException

unread

public void unread(org.fusesource.hawtbuf.Buffer buffer)
Description copied from interface: ProtocolCodec
Pushes back a buffer as being unread.

Specified by:
unread in interface ProtocolCodec

getReadCounter

public long getReadCounter()
Specified by:
getReadCounter in interface ProtocolCodec
Returns:
The number of bytes received.

getLastReadSize

public int getLastReadSize()
Specified by:
getLastReadSize in interface ProtocolCodec
Returns:
The number of bytes read in the last read io performed.

read

public java.lang.Object read()
                      throws java.io.IOException
Description copied from interface: ProtocolCodec
Non-blocking channel based decoding.

Specified by:
read in interface ProtocolCodec
Returns:
Throws:
java.io.IOException


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.