|
Infinispan Server - Core Components 5.1.4.FINAL-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.channel.SimpleChannelUpstreamHandler
org.infinispan.server.core.transport.CustomReplayingDecoder<T>
public abstract class CustomReplayingDecoder<T extends Enum<T>>
A fork version of ReplayingDecoder
whose cumulation buffer can be
cleared when the request is completed. This helps keep memory consumption
low particularly when big objects are stored in Infinispan.
To be more precise, the differences between the ReplayingDecoder
version in Netty 3.2.4 (code here)
and this one are:
slimDownBuffer()
method that slims down the buffers if they go above the maximum capacity
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
org.jboss.netty.channel.ChannelHandler.Sharable |
Constructor Summary | |
---|---|
protected |
CustomReplayingDecoder(T initialState,
boolean unfold,
int maxCapacity)
|
Method Summary | |
---|---|
protected int |
actualReadableBytes()
Returns the actual number of readable bytes in the internal cumulative buffer of this decoder. |
void |
channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
|
void |
channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
|
protected void |
checkpoint()
Stores the internal cumulative buffer's reader position. |
protected void |
checkpoint(T state)
Stores the internal cumulative buffer's reader position and updates the current decoder state. |
protected abstract Object |
decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.Channel channel,
org.jboss.netty.buffer.ChannelBuffer buffer,
T state)
Decodes the received packets so far into a frame. |
protected Object |
decodeLast(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.Channel channel,
org.jboss.netty.buffer.ChannelBuffer buffer,
T state)
Decodes the received data so far into a frame when the channel is disconnected. |
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
|
protected T |
getState()
Returns the current state of this decoder. |
protected org.jboss.netty.buffer.ChannelBuffer |
internalBuffer()
Returns the internal cumulative buffer of this decoder. |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e)
|
protected T |
setState(T newState)
Sets the current state of this decoder. |
protected void |
slimDownBuffer()
Slim down internal buffer if it exceeds the limit established on creation |
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler |
---|
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CustomReplayingDecoder(T initialState, boolean unfold, int maxCapacity)
Method Detail |
---|
protected void checkpoint()
protected void checkpoint(T state)
protected T getState()
protected T setState(T newState)
protected int actualReadableBytes()
internalBuffer().readableBytes()
.
protected org.jboss.netty.buffer.ChannelBuffer internalBuffer()
protected abstract Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, org.jboss.netty.buffer.ChannelBuffer buffer, T state) throws Exception
ctx
- the context of this handlerchannel
- the current channelbuffer
- the cumulative buffer of received packets so far.
Note that the buffer might be empty, which means you
should not make an assumption that the buffer contains
at least one byte in your decoder implementation.state
- the current decoder state (null
if unused)
Exception
protected Object decodeLast(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, org.jboss.netty.buffer.ChannelBuffer buffer, T state) throws Exception
ctx
- the context of this handlerchannel
- the current channelbuffer
- the cumulative buffer of received packets so far.
Note that the buffer might be empty, which means you
should not make an assumption that the buffer contains
at least one byte in your decoder implementation.state
- the current decoder state (null
if unused)
Exception
protected void slimDownBuffer()
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws Exception
channelDisconnected
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws Exception
channelClosed
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e) throws Exception
exceptionCaught
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
|
Infinispan Server - Core Components 5.1.4.FINAL-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |