当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionEvent.getChannel方法代码示例

本文整理汇总了Java中org.jboss.netty.channel.ExceptionEvent.getChannel方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionEvent.getChannel方法的具体用法?Java ExceptionEvent.getChannel怎么用?Java ExceptionEvent.getChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.netty.channel.ExceptionEvent的用法示例。


在下文中一共展示了ExceptionEvent.getChannel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
    throws Exception {
  Channel ch = e.getChannel();
  Throwable cause = e.getCause();
  if (cause instanceof TooLongFrameException) {
    sendError(ctx, BAD_REQUEST);
    return;
  } else if (cause instanceof IOException) {
    if (cause instanceof ClosedChannelException) {
      LOG.debug("Ignoring closed channel error", cause);
      return;
    }
    String message = String.valueOf(cause.getMessage());
    if (IGNORABLE_ERROR_MESSAGE.matcher(message).matches()) {
      LOG.debug("Ignoring client socket close", cause);
      return;
    }
  }

  LOG.error("Shuffle error: ", cause);
  if (ch.isConnected()) {
    LOG.error("Shuffle error " + e);
    sendError(ctx, INTERNAL_SERVER_ERROR);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:ShuffleHandler.java

示例2: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
		throws Exception {
	Throwable te = e.getCause();
	if (te instanceof java.io.IOException) {// 网络异常,也有可能是soLinger参数引起
		return;
	}
	logger.error("Unexpected exception from downstream.{}", e.getCause());
	Channel c = e.getChannel();
	try {
		if (c.isWritable()) {
			RpcResponse res = new RpcResponse();
			res.setReturnFlag(RpcConst.ERR_CODE_SERVER_CHANNEL_EXCEPTION);
			res.setReturnMsg(logger.getStackTraceInfo(e.getCause()));
			c.write(res);
		}
	} finally {
		c.close();
	}
	// super.exceptionCaught(ctx, e);
}
 
开发者ID:jbeetle,项目名称:BJAF3.x,代码行数:22,代码来源:RpcServerHandler.java

示例3: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
    throws Exception {
  Channel ch = e.getChannel();
  Throwable cause = e.getCause();
  if (cause instanceof TooLongFrameException) {
    sendError(ctx, BAD_REQUEST);
    return;
  }

  LOG.error("Shuffle error: ", cause);
  shuffleMetrics.failedOutput();
  if (ch.isConnected()) {
    LOG.error("Shuffle error " + e);
    sendError(ctx, INTERNAL_SERVER_ERROR);
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:18,代码来源:ShuffleHandler.java

示例4: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught( ChannelHandlerContext ctx, ExceptionEvent e ) throws Exception
{
    Channel ch = e.getChannel( ) ;
    Throwable cause = e.getCause( ) ;
    if( cause instanceof TooLongFrameException )
    {
        sendError( ctx, BAD_REQUEST ) ;
        return ;
    }
    
    cause.printStackTrace( ) ;
    if( ch.isConnected( ) )
    {
        sendError( ctx, INTERNAL_SERVER_ERROR ) ;
    }
}
 
开发者ID:wsyssantos,项目名称:BettaServer,代码行数:18,代码来源:BettaUdpFileServerHandler.java

示例5: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
    throws Exception {
  Channel ch = e.getChannel();
  Throwable cause = e.getCause();

  if (LOG.isDebugEnabled())
    LOG.debug(cause.getMessage());
  ch.close().addListener(ChannelFutureListener.CLOSE);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:TestDelegationTokenRemoteFetcher.java

示例6: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
    e.getCause().printStackTrace();

    final Channel ch = e.getChannel();
    ch.close();
}
 
开发者ID:Graylog2,项目名称:graylog-plugin-beats,代码行数:8,代码来源:ConsolePrinter.java

示例7: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
	// removeFailureCounter(e.getChannel());
	if (e.getChannel() != null) {
		LOG.info("Channel occur exception {}", e.getChannel().getRemoteAddress());
	}
	
	server.closeChannel(e.getChannel());
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:StormServerHandler.java

示例8: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
    // removeFailureCounter(e.getChannel());
    if (e.getChannel() != null) {
        LOG.info("Channel occur exception {}", e.getChannel().getRemoteAddress());
    }

    server.closeChannel(e.getChannel());
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:10,代码来源:StormServerHandler.java

示例9: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
		throws Exception {

	Channel ch = e.getChannel();
	SocketForwardingWebsocketClient socketClient = (SocketForwardingWebsocketClient) ch.getAttachment();
	
	if (log.isDebugEnabled()) {
		log.debug("Received exception from " + ch.getRemoteAddress(),
				e.getCause());
	}
	
	socketClient.close();
}
 
开发者ID:ludup,项目名称:hypersocket-framework,代码行数:15,代码来源:SocketForwardingWebsocketClientHandler.java

示例10: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
        throws Exception {
    Channel ch = e.getChannel();
    Throwable cause = e.getCause();
    if (cause instanceof TooLongFrameException) {
        sendError(ctx, HttpResponseStatus.BAD_REQUEST);
        return;
    }

    cause.printStackTrace();
    if (ch.isConnected()) {
        sendError(ctx, HttpResponseStatus.INTERNAL_SERVER_ERROR);
    }
}
 
开发者ID:laizhihuan,项目名称:java-test-demo,代码行数:16,代码来源:HttpServerHandler.java

示例11: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
{
	logger.error("Error processing trade", e);

	Channel ch = e.getChannel();
	ch.close();
}
 
开发者ID:mikfreeman,项目名称:netty-server,代码行数:9,代码来源:TradeHandler.java

示例12: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
    // removeFailureCounter(e.getChannel());
    if (e.getChannel() != null) {
        LOG.info("Channel occur exception {}, cause={}", e.getChannel().getRemoteAddress(), e.getCause());
    }

    server.closeChannel(e.getChannel());
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:10,代码来源:StormServerHandler.java

示例13: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
    Channel ch = e.getChannel();
    ch.close();
}
 
开发者ID:MitchZinck,项目名称:BlockJump-HighscoreServer,代码行数:6,代码来源:ServerHandler.java

示例14: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
    logger.error("Unexpected Exception happened. event:{}", e, e.getCause());
    Channel channel = e.getChannel();
    channel.close();
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:7,代码来源:PinpointServerSocket.java

示例15: exceptionCaught

import org.jboss.netty.channel.ExceptionEvent; //导入方法依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
	e.getCause().printStackTrace();
	Channel ch = e.getChannel();
	ch.close();
}
 
开发者ID:JamesLampton,项目名称:piggybank-squeal,代码行数:7,代码来源:NettyMetricsTransport.java


注:本文中的org.jboss.netty.channel.ExceptionEvent.getChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。