|
||||||||||
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(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 ByteBuffer |
getBuffer()
|
BufferHandle |
getBufferHandle()
Get the BufferHandle this BaseSocketHandler is using |
SocketChannel |
getChannel()
Get the channel this BaseSocketHandler is using |
String |
getDescription()
|
protected ByteBuffer |
getLargeBuffer()
|
protected Logger |
getLogger()
|
Long |
getTimeout()
|
protected boolean |
isUsingSmallBuffer(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(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 ByteBuffer getBuffer()
protected ByteBuffer getLargeBuffer()
protected boolean isUsingSmallBuffer(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 String getDescription()
getDescription
in interface SocketChannelHandler
public Long getTimeout()
getTimeout
in interface SocketChannelHandler
protected Logger getLogger()
protected void closeDown()
public 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 |