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


Java OnWebSocketError类代码示例

本文整理汇总了Java中org.eclipse.jetty.websocket.api.annotations.OnWebSocketError的典型用法代码示例。如果您正苦于以下问题:Java OnWebSocketError类的具体用法?Java OnWebSocketError怎么用?Java OnWebSocketError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(@CheckForNull Session session, Throwable error) throws Exception {
	if (logger.isTraceEnabled()) {
		logger.entry(session, error);
	}
	
	if (session == null || !session.isOpen()) {
		this.session = null;
		if (!stopRequested && websocketUri != null) {
			connect(websocketUri);
		}
	}
	
	if (logger.isTraceEnabled()) {
		logger.exit();
	}
}
 
开发者ID:kmbulebu,项目名称:NickNack,代码行数:18,代码来源:XbmcClient.java

示例2: handleError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
  public void handleError(Throwable error) {
String uri = session.getUpgradeRequest().getRequestURI().getPath();
LOG.debug("websocket message: " + uri);

//find hanlder
WebSocketHandler handler = getHandler(uri);
if (handler == null) {
	session.getUpgradeResponse().setStatusCode(404);
	return;
}

//get file
String file = handler.getError();
if (StringUtils.isEmpty(file)) {
	return;
}

bindAndRun(handler, file, null, error);
  }
 
开发者ID:lane-cn,项目名称:getty,代码行数:21,代码来源:WebSocketInstance.java

示例3: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
  logger.log(Level.WARNING, "マッチング状況WebSocketセッションでエラーが起こりました。 remoteAddress="
      + session.getRemoteAddress().toString(), cause);

  Game game;
  try {
    game = gameManager.getSession(gameSessionId);
  } catch (GameNotFoundException e) {
    logger.log(Level.WARNING, "ゲームセッションが見つかりませんでした gameSessionId=" + gameSessionId, e);
    session.close();
    return;
  }

  game.getReadyForGameMessageSender().bye(session);
  this.session = null;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:18,代码来源:ReadyForGameWebSocketServlet.java

示例4: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
  logger.log(Level.WARNING, "マッチング状況WebSocketセッションでエラーが起こりました。 remoteAddress="
      + session.getRemoteAddress().toString(), cause);

  Game game;
  try {
    game = gameManager.getSession(gameSessionId);
  } catch (GameNotFoundException e) {
    logger.log(Level.WARNING, "ゲームセッションが見つかりませんでした gameSessionId=" + gameSessionId, e);
    session.close();
    return;
  }

  game.getMatchingStatusMessageSender().bye(session);
  this.session = null;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:18,代码来源:MatchingStatusWebSocketServlet.java

示例5: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
  logger.log(Level.WARNING, "マッチング状況WebSocketセッションでエラーが起こりました。 remoteAddress="
      + session.getRemoteAddress().toString(), cause);

  Game game;
  try {
    game = gameManager.getSession(gameSessionId);
  } catch (GameNotFoundException e) {
    logger.log(Level.WARNING, "ゲームセッションが見つかりませんでした gameSessionId=" + gameSessionId, e);
    session.close();
    return;
  }

  game.getGameStatusMessageSender().bye(session);
  this.session = null;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:18,代码来源:GameStatusWebSocketServlet.java

示例6: onWebSocketError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
	try {
		this.webSocketHandler.handleTransportError(this.wsSession, cause);
	}
	catch (Throwable ex) {
		ExceptionWebSocketHandlerDecorator.tryCloseWithError(this.wsSession, ex, logger);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:JettyWebSocketHandlerAdapter.java

示例7: onWebSocketError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onWebSocketError(Throwable cause) {
  LOG.warn("WebSocket Error", cause);
  try {
    connectToWebSocket();
  } catch (Exception e) {
    LOG.error(Errors.WEB_SOCKET_01.getMessage(), e.toString(), e);
  }
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:10,代码来源:WebSocketClientSource.java

示例8: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable error)
{
    Log.error("Error detected; session: " + wsSession, error);
    closeStream(new StreamError(StreamError.Condition.internal_server_error));
    try {
        if (wsSession != null) {
            wsSession.disconnect();
        }
    } catch ( Exception e ) {
        Log.error("Error disconnecting websocket", e);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:14,代码来源:XmppWebSocket.java

示例9: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
  logger.log(Level.WARNING, "チャットメッセージWebSocketセッションでエラーが起こりました。 remoteAddress="
      + session.getRemoteAddress().toString(), cause);
  chatManager.getChatMessagesMessageSender().bye(session);
  this.session = null;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:8,代码来源:ChatMessagesWebSocketServlet.java

示例10: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
  logger.log(Level.WARNING, "チャットメッセージWebSocketセッションでエラーが起こりました。 remoteAddress="
      + session.getRemoteAddress().toString(), cause);
  serverStatusManager.getServerStatusMessageSender().bye(session);
  this.session = null;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:8,代码来源:ServerStatusWebSocketServlet.java

示例11: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable error) {
    LOGGER.error("{} closing session because an error was thrown", sessionName(), error);
    try {
        close(StatusCode.SERVER_ERROR, error.getMessage());
    } finally {
        socketHealthService.deregister(this);
    }
}
 
开发者ID:gocd,项目名称:gocd,代码行数:10,代码来源:ConsoleLogSocket.java

示例12: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable t) {
	log.error("Broker Client WebSocket error: " + t.getMessage(), t);
}
 
开发者ID:BuaBook,项目名称:buabook-api-interface,代码行数:5,代码来源:ClientWebSocket.java

示例13: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
	log.warn(cause);
}
 
开发者ID:BuaBook,项目名称:buabook-api-interface,代码行数:5,代码来源:BuaBookApiWebSocket.java

示例14: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable t) {
	System.out.println(t);
}
 
开发者ID:BadPlayer555,项目名称:MeMezBots-Dev,代码行数:5,代码来源:ToUpperClientSocket.java

示例15: onError

import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable t)
{
	log.error("WebSocket error", t);
	this.teardown();
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:7,代码来源:WebcamWebSocketHandler.java


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