|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrabbit.httpio.BaseSocketHandler
public abstract class BaseSocketHandler
A base class for socket handlers.
Constructor Summary | |
---|---|
BaseSocketHandler(java.nio.channels.SocketChannel channel,
BufferHandle bh,
NioHandler nioHandler)
Create a new BaseSocketHandler that will handle the traffic on the given channel |
Method Summary | |
---|---|
void |
closed()
Does nothing by default |
protected void |
closeDown()
|
protected java.nio.ByteBuffer |
getBuffer()
|
BufferHandle |
getBufferHandle()
Get the BufferHandle this BaseSocketHandler is using |
java.nio.channels.SocketChannel |
getChannel()
Get the channel this BaseSocketHandler is using |
java.lang.String |
getDescription()
|
protected java.nio.ByteBuffer |
getLargeBuffer()
|
protected java.util.logging.Logger |
getLogger()
|
java.lang.Long |
getTimeout()
|
protected boolean |
isUsingSmallBuffer(java.nio.ByteBuffer buffer)
|
protected void |
releaseBuffer()
|
void |
timeout()
Does nothing by default |
boolean |
useSeparateThread()
Runs on the selector thread by default |
void |
waitForRead(ReadHandler rh)
Wait for more data to be readable on the channel |
void |
waitForWrite(WriteHandler rh)
Wait for more data to be writable on the channel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseSocketHandler(java.nio.channels.SocketChannel channel, BufferHandle bh, NioHandler nioHandler)
channel
- the SocketChannel to read to and write frombh
- the BufferHandle to use for the io operationnioHandler
- the NioHandler to use to wait for operations onMethod Detail |
---|
protected java.nio.ByteBuffer getBuffer()
protected java.nio.ByteBuffer getLargeBuffer()
protected boolean isUsingSmallBuffer(java.nio.ByteBuffer buffer)
protected void releaseBuffer()
public void closed()
closed
in interface SocketChannelHandler
public void timeout()
timeout
in interface SocketChannelHandler
public boolean useSeparateThread()
useSeparateThread
in interface SocketChannelHandler
public java.lang.String getDescription()
getDescription
in interface SocketChannelHandler
public java.lang.Long getTimeout()
getTimeout
in interface SocketChannelHandler
protected java.util.logging.Logger getLogger()
protected void closeDown()
public java.nio.channels.SocketChannel getChannel()
public BufferHandle getBufferHandle()
public void waitForRead(ReadHandler rh)
rh
- the handler that will be notified when more data is
ready to be readpublic void waitForWrite(WriteHandler rh)
rh
- the handler that will be notified when more data is
ready to be written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |