public class LogHandler extends Object implements ProtocolHandler
Constructor and Description |
---|
LogHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
doContinueResponse()
Continues writing the response to the channel.
|
boolean |
doProcessRequest(ByteBuffer buffer,
int count)
Analyzes the buffer and return read active status.
|
boolean |
doProcessResponse()
Creates and writes the response to the channel.
|
boolean |
requestPending()
Tests the handler whether it needs to further process this request.
|
void |
setConfig(LogConfig config)
Sets the config object.
|
void |
setKey(SelectionKey key)
Sets the selection key for subsequent invocations.
|
public void setConfig(LogConfig config)
setConfig
in interface ProtocolHandler
config
- The singleton config objectpublic void setKey(SelectionKey key)
setKey
in interface ProtocolHandler
key
- The nio selection keypublic boolean doProcessRequest(ByteBuffer buffer, int count)
doProcessRequest
in interface ProtocolHandler
buffer
- The buffer to look atcount
- The number of new bytes in the bufferpublic boolean doProcessResponse() throws IOException
doProcessResponse
in interface ProtocolHandler
IOException
- Cannot write response to channelpublic boolean doContinueResponse() throws IOException
doContinueResponse
in interface ProtocolHandler
IOException
- Cannot write response to channelpublic boolean requestPending()
requestPending
in interface ProtocolHandler