@Override public void onClose(int closeCode, String message) { IKey key = getRegistryKey(); broadcastMessage(new ClosedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); }
@Override public void onClose(int closeCode, String message) { IKey key = getRegistryKey(); broadcastMessage(new ClosedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); }
@Override public void onClose(int closeCode, String message) { IKey key = getRegistryKey(); broadcastMessage(new ClosedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); }
/** * A helper that registers the opened connection in the application-level registry. * * @param connection * the web socket connection to use to communicate with the client * @see #onOpen(Object) */ protected final void onConnect(final IWebSocketConnection connection) { IKey key = getRegistryKey(); connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection); if (connectionFilter != null) { ConnectionRejected connectionRejected = connectionFilter.doFilter(servletRequest); if (connectionRejected != null) { broadcastMessage(new AbortedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); connection.close(connectionRejected.getCode(), connectionRejected.getReason()); return; } } broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key)); }
/** * A helper that registers the opened connection in the application-level registry. * * @param connection * the web socket connection to use to communicate with the client * @see #onOpen(Object) */ protected final void onConnect(final IWebSocketConnection connection) { IKey key = getRegistryKey(); connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection); if (connectionFilter != null) { ConnectionRejected connectionRejected = connectionFilter.doFilter(servletRequest); if (connectionRejected != null) { broadcastMessage(new AbortedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); connection.close(connectionRejected.getCode(), connectionRejected.getReason()); return; } } broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key)); }
/** * A helper that registers the opened connection in the application-level registry. * * @param connection * the web socket connection to use to communicate with the client * @see #onOpen(Object) */ protected final void onConnect(final IWebSocketConnection connection) { IKey key = getRegistryKey(); connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection); if (connectionFilter != null) { ConnectionRejected connectionRejected = connectionFilter.doFilter(servletRequest); if (connectionRejected != null) { broadcastMessage(new AbortedMessage(getApplication(), getSessionId(), key)); connectionRegistry.removeConnection(getApplication(), getSessionId(), key); connection.close(connectionRejected.getCode(), connectionRejected.getReason()); return; } } broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key)); }