本文整理汇总了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();
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例13: onError
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable cause) {
log.warn(cause);
}
示例14: onError
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable t) {
System.out.println(t);
}
示例15: onError
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; //导入依赖的package包/类
@OnWebSocketError
public void onError(Throwable t)
{
log.error("WebSocket error", t);
this.teardown();
}