public class StaleConnectionTrackingHandler
extends org.jboss.netty.channel.SimpleChannelHandler
| 限定符和类型 | 字段和说明 |
|---|---|
private Executor |
executor |
private Map<org.jboss.netty.channel.Channel,Long> |
stamps |
private long |
timeout |
| 构造器和说明 |
|---|
StaleConnectionTrackingHandler(long timeout,
Executor executor) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
closeStaleConnections() |
private boolean |
isStale(Long timeStamp) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
private void |
stamp(org.jboss.netty.channel.Channel channel) |
void |
stopTracking(org.jboss.netty.channel.Channel channel)
Stops tracking this channel for staleness.
|
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, exceptionCaught, handleDownstream, handleUpstream, setInterestOpsRequested, unbindRequested, writeComplete, writeRequestedprivate final long timeout
private final Executor executor
public StaleConnectionTrackingHandler(long timeout,
Executor executor)
public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws Exception
channelOpen 在类中 org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e)
throws Exception
messageReceived 在类中 org.jboss.netty.channel.SimpleChannelHandlerExceptionprivate void stamp(org.jboss.netty.channel.Channel channel)
public void closeStaleConnections()
public void stopTracking(org.jboss.netty.channel.Channel channel)
channel - private boolean isStale(Long timeStamp)
Copyright © 2014. All rights reserved.