protected Integer getPort(WebSocketSettings webSocketSettings) { return webSocketSettings.getPort(); }
protected Integer getSecurePort(WebSocketSettings webSocketSettings) { return webSocketSettings.getSecurePort(); }
/** * Broadcasts/pushes a message to all active web socket connections * * @param application * The application where the web socket connection is registered * @param message * The message to broadcast/push */ public void broadcastAll(Application application, IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry()); broadcaster.broadcastAll(application, message); }
/** * Broadcasts/pushes a message to specific web socket connection * * @param application * The application where the web socket connection is registered * @param sessionId * The id of the http session with which the web socket connection is registered * @param key * The key with which the web socket connection is registered * @param message * The message to broadcast/push */ public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry()); ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key); broadcaster.broadcast(wsMessage, message); }
private void process(final Application application, final Collection<IWebSocketConnection> wsConnections, final IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); Executor executor = webSocketSettings.getWebSocketPushMessageExecutor(); for (final IWebSocketConnection wsConnection : wsConnections) { executor.run(new Runnable() { @Override public void run() { wsConnection.sendMessage(message); } }); } } }
@Override public void init(final boolean isServlet, final FilterConfig filterConfig) throws ServletException { super.init(isServlet, new JavaxWebSocketFilterConfig(filterConfig)); }
public static WebSocketSettings get(Application application) { WebSocketSettings settings = application.getMetaData(KEY); if (settings == null) { synchronized (application) { if (settings == null) { settings = new WebSocketSettings(); set(application, settings); } } } return settings; }
protected CharSequence getContextPath(final WebSocketSettings webSocketSettings) { return webSocketSettings.getContextPath(); }
protected CharSequence getFilterPrefix(final WebSocketSettings webSocketSettings) { return webSocketSettings.getFilterPrefix(); }
protected CharSequence getBaseUrl(final WebSocketSettings webSocketSettings) { return webSocketSettings.getBaseUrl(); }
/** * Broadcasts/pushes a message to specific web socket connection * * @param application * The application where the web socket connection is registered * @param sessionId * The id of the http session with which the web socket connection is registered * @param key * The key with which the web socket connection is registered * @param message * The message to broadcast/push */ public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry()); ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key); broadcaster.broadcast(wsMessage, message); }
/** * Broadcasts/pushes a message to all active web socket connections * * @param application * The application where the web socket connection is registered * @param message * The message to broadcast/push */ public void broadcastAll(Application application, IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry()); broadcaster.broadcastAll(application, message); }
private void process(final Application application, final Collection<IWebSocketConnection> wsConnections, final IWebSocketPushMessage message) { WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application); Executor executor = webSocketSettings.getWebSocketPushMessageExecutor(); for (final IWebSocketConnection wsConnection : wsConnections) { executor.run(new Runnable() { @Override public void run() { wsConnection.sendMessage(message); } }); } } }
@Override public void init(final boolean isServlet, final FilterConfig filterConfig) throws ServletException { super.init(isServlet, new JavaxWebSocketFilterConfig(filterConfig)); }
public static WebSocketSettings get(Application application) { WebSocketSettings settings = application.getMetaData(KEY); if (settings == null) { synchronized (application) { if (settings == null) { settings = new WebSocketSettings(); set(application, settings); } } } return settings; }
protected Integer getPort(WebSocketSettings webSocketSettings) { return webSocketSettings.getPort(); }
protected Integer getSecurePort(WebSocketSettings webSocketSettings) { return webSocketSettings.getSecurePort(); }
protected CharSequence getContextPath(final WebSocketSettings webSocketSettings) { return webSocketSettings.getContextPath(); }
protected CharSequence getFilterPrefix(final WebSocketSettings webSocketSettings) { return webSocketSettings.getFilterPrefix(); }
protected CharSequence getBaseUrl(final WebSocketSettings webSocketSettings) { return webSocketSettings.getBaseUrl(); }