public WebSocketServletFactory getFactory() { return configuration.getFactory(); }
public WebSocketServerFactory getWebSocketServerFactory() { return this.configuration.getFactory(); }
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException if (configuration.getFactory().isUpgradeRequest(request,response)) if (configuration.getFactory().acceptWebSocket(creator,request,response))
/** * * @param configuration the {@link NativeWebSocketConfiguration} to use * @param httpClient the {@link HttpClient} instance to use */ public ServerContainer(NativeWebSocketConfiguration configuration, HttpClient httpClient) { super(configuration.getFactory(), httpClient); this.configuration = configuration; EventDriverFactory eventDriverFactory = this.configuration.getFactory().getEventDriverFactory(); eventDriverFactory.addImplementation(new JsrServerEndpointImpl()); eventDriverFactory.addImplementation(new JsrServerExtendsEndpointImpl()); this.configuration.getFactory().addSessionFactory(new JsrSessionFactory(this)); addBean(this.configuration); }
private void addEndpoint(ServerEndpointMetadata metadata) throws DeploymentException { JsrCreator creator = new JsrCreator(this,metadata,this.configuration.getFactory().getExtensionFactory()); this.configuration.addMapping("uri-template|" + metadata.getPath(), creator); }
WebSocketServletFactory factory = configuration.getFactory();
public static ServerContainer configureContext(final MutableServletContextHandler context, final MetricRegistry metrics) throws ServletException { WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); NativeWebSocketConfiguration wsConfig = filter.getConfiguration(); ServerContainer wsContainer = new ServerContainer(wsConfig, context.getServer().getThreadPool()); EventDriverFactory edf = wsConfig.getFactory().getEventDriverFactory(); edf.clearImplementations(); edf.addImplementation(new InstJsrServerEndpointImpl(metrics)); edf.addImplementation(new InstJsrServerExtendsEndpointImpl(metrics)); context.addBean(wsContainer); context.setAttribute(javax.websocket.server.ServerContainer.class.getName(), wsContainer); context.setAttribute(WebSocketUpgradeFilter.class.getName(), filter); return wsContainer; } }
public static ServerContainer configureContext(final MutableServletContextHandler context, final MetricRegistry metrics) throws ServletException { WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context); NativeWebSocketConfiguration wsConfig = filter.getConfiguration(); ServerContainer wsContainer = new ServerContainer(wsConfig, context.getServer().getThreadPool()); EventDriverFactory edf = wsConfig.getFactory().getEventDriverFactory(); edf.clearImplementations(); edf.addImplementation(new InstJsrServerEndpointImpl(metrics)); edf.addImplementation(new InstJsrServerExtendsEndpointImpl(metrics)); context.addBean(wsContainer); context.setAttribute(javax.websocket.server.ServerContainer.class.getName(), wsContainer); context.setAttribute(WebSocketUpgradeFilter.class.getName(), filter); return wsContainer; } }