本文整理汇总了Java中org.jboss.netty.channel.ChannelState.INTEREST_OPS属性的典型用法代码示例。如果您正苦于以下问题:Java ChannelState.INTEREST_OPS属性的具体用法?Java ChannelState.INTEREST_OPS怎么用?Java ChannelState.INTEREST_OPS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jboss.netty.channel.ChannelState
的用法示例。
在下文中一共展示了ChannelState.INTEREST_OPS属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleUpstream
/**
* <p>
* {@inheritDoc}
* </p>
* <p>
* Overriden to log ChannelStateEvents if they have a state other than
* {@link ChannelState#INTEREST_OPS}, i. e. OPEN, BOUND, CONNECTED.
* </p>
*
* @param ctx
* the context object for this handler
* @param e
* the upstream event to process or intercept
*/
@Override
public void handleUpstream(final ChannelHandlerContext ctx, final ChannelEvent e) throws Exception {
if (e instanceof ChannelStateEvent) {
ChannelStateEvent stateEvent = (ChannelStateEvent) e;
if (stateEvent.getState() != ChannelState.INTEREST_OPS) {
log.info(e.toString());
if (stateEvent.getState() == ChannelState.CONNECTED && stateEvent.getValue() == null) {
// Remove channel from container when client disconnects
channelContainer.removeChannel(e.getChannel());
}
}
}
super.handleUpstream(ctx, e);
}
示例2: handleUpstream
@Override
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
if(e instanceof ChannelStateEvent && ((ChannelStateEvent) e).getState() != ChannelState.INTEREST_OPS) {
LOG.debug(e.toString());
}
super.handleUpstream(ctx, e);
}
示例3: handleUpstream
/**
* <p>
* {@inheritDoc}
* </p>
* <p>
* Overriden to log ChannelStateEvents if they have a state other than
* {@link ChannelState#INTEREST_OPS}, i. e. OPEN, BOUND, CONNECTED.
* </p>
*
* @param ctx
* the context object for this handler
* @param e
* the upstream event to process or intercept
*/
@Override
public void handleUpstream(final ChannelHandlerContext ctx, final ChannelEvent e) throws Exception {
if (e instanceof ChannelStateEvent && ((ChannelStateEvent) e).getState() != ChannelState.INTEREST_OPS) {
log.info(e.toString());
}
super.handleUpstream(ctx, e);
}