final static void onException(Throwable t, AtmosphereResource r) { logger.trace("onException()", t); r.notifyListeners(new AtmosphereResourceEventImpl((AtmosphereResourceImpl) r, true, false)); AtmosphereResourceImpl.class.cast(r)._destroy(); }
@Override public void onDisconnect(DisconnectReason reason) { logger.trace("Session[" + sessionId + "]: onDisconnect: " + reason); clearTimeoutTimer(); clearHeartbeatTimer(); if (atmosphereHandler != null) { state = ConnectionState.CLOSED; try { synchronized (atmosphereHandler) { if (SocketIOAtmosphereHandler.class.isAssignableFrom(atmosphereHandler.getClass())) { SocketIOAtmosphereHandler.class.cast(atmosphereHandler).onDisconnect(resource, handler, reason); } else { atmosphereHandler.onStateChange(new AtmosphereResourceEventImpl(resource, true, false)); } } } catch (Throwable e) { logger.error("Session[" + sessionId + "]: Exception thrown by SocketIOInbound.onDisconnect()", e); } atmosphereHandler = null; } }
@Override public void onDisconnect(DisconnectReason reason) { logger.trace("Session[" + sessionId + "]: onDisconnect: " + reason); clearTimeoutTimer(); clearHeartbeatTimer(); if (atmosphereHandler != null) { state = ConnectionState.CLOSED; try { synchronized (atmosphereHandler) { if (SocketIOAtmosphereHandler.class.isAssignableFrom(atmosphereHandler.getClass())) { SocketIOAtmosphereHandler.class.cast(atmosphereHandler).onDisconnect(resource, handler, reason); } else { atmosphereHandler.onStateChange(new AtmosphereResourceEventImpl(resource, true, false)); } } } catch (Throwable e) { logger.error("Session[" + sessionId + "]: Exception thrown by SocketIOInbound.onDisconnect()", e); } atmosphereHandler = null; } }