本文整理汇总了Java中org.jboss.netty.channel.Channels.fireExceptionCaught方法的典型用法代码示例。如果您正苦于以下问题:Java Channels.fireExceptionCaught方法的具体用法?Java Channels.fireExceptionCaught怎么用?Java Channels.fireExceptionCaught使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.netty.channel.Channels
的用法示例。
在下文中一共展示了Channels.fireExceptionCaught方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: messageReceived
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void messageReceived(ChannelHandlerContext ctx,
MessageEvent e) throws Exception {
Object message = e.getMessage();
if (message instanceof SyncMessage) {
handleSyncMessage((SyncMessage)message, ctx.getChannel());
} else if (message instanceof List) {
for (Object i : (List<?>)message) {
if (i instanceof SyncMessage) {
try {
handleSyncMessage((SyncMessage)i,
ctx.getChannel());
} catch (Exception ex) {
Channels.fireExceptionCaught(ctx, ex);
}
}
}
} else {
handleUnknownMessage(ctx, message);
}
}
示例2: messageReceived
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
throws Exception {
if (e.getMessage() instanceof List) {
@SuppressWarnings("unchecked")
List<OFMessage> msglist = (List<OFMessage>)e.getMessage();
for (OFMessage ofm : msglist) {
try {
// Do the actual packet processing
state.processOFMessage(ofm);
}
catch (Exception ex) {
// We are the last handler in the stream, so run the
// exception through the channel again by passing in
// ctx.getChannel().
Channels.fireExceptionCaught(ctx.getChannel(), ex);
}
}
}
else {
Channels.fireExceptionCaught(ctx.getChannel(),
new AssertionError("Message received from channel is not a list"));
}
}
示例3: run
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void run(Timeout t) throws Exception {
if (t.isCancelled()) {
return;
}
if (!ctx.getChannel().isOpen()) {
return;
}
if (!channelHandler.isHandshakeComplete()) {
Channels.fireExceptionCaught(ctx, EXCEPTION);
}
}
示例4: run
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.getChannel().isOpen()) {
return;
}
if (!handler.isClientConnection &&
((handler.remoteNode == null ||
!handler.rpcService.isConnected(handler.remoteNode.
getNodeId()))))
Channels.fireExceptionCaught(ctx, EXCEPTION);
}
示例5: run
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.getChannel().isOpen()) {
return;
}
if (!handshakeHandler.isSwitchHandshakeComplete())
Channels.fireExceptionCaught(ctx, EXCEPTION);
}
示例6: run
import org.jboss.netty.channel.Channels; //导入方法依赖的package包/类
@Override
public void run(Timeout timeout) throws Exception {
if (timeout.isCancelled()) {
return;
}
if (!ctx.getChannel().isOpen()) {
return;
}
if (!channelHandler.isHandshakeComplete())
Channels.fireExceptionCaught(ctx, EXCEPTION);
}