本文整理匯總了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);
}