當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。