public WebSocketUpgradeFilter(WebSocketServerFactory factory) { this(new NativeWebSocketConfiguration(factory)); }
public static NativeWebSocketConfiguration getDefaultFrom(ServletContext context) { final String KEY = NativeWebSocketConfiguration.class.getName(); NativeWebSocketConfiguration configuration = (NativeWebSocketConfiguration) context.getAttribute(KEY); if (configuration == null) { // Not provided to us, create a new default one. configuration = new NativeWebSocketConfiguration(context); context.setAttribute(KEY, configuration); // Attach default configuration to context lifecycle if (context instanceof ContextHandler.Context) { ContextHandler handler = ((ContextHandler.Context)context).getContextHandler(); // Let ContextHandler handle configuration lifecycle handler.addManaged(configuration); } } return configuration; }
public WebSocketUpgradeHandlerWrapper(ServletContextHandler context, ByteBufferPool bufferPool) { this.configuration = new NativeWebSocketConfiguration(new WebSocketServerFactory(context.getServletContext(), bufferPool)); }