container.addEndpoint( ServerEndpointConfig.Builder .create(
@Override public String getPath() { return config.getPath(); }
@Override public boolean supports(Object websocket) { return origImpl.supports(websocket); } }
org.eclipse.jetty.websocket.jsr356.server.ServerContainer configureContext = WebSocketServerContainerInitializer.configureContext(context); configureContext.getWebSocketServerFactory().getExtensionFactory().unregister("permessage-deflate"); configureContext.addEndpoint(Jsr356Impl.class); } catch (ServletException e) { e.printStackTrace();
/** * * @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); }
public EndpointInstance newClientEndpointInstance(Object endpoint, ServerEndpointConfig config, String path) { EndpointMetadata metadata = getClientEndpointMetadata(endpoint.getClass(),config); ServerEndpointConfig cec = config; if (config == null) { if (metadata instanceof AnnotatedServerEndpointMetadata) { cec = ((AnnotatedServerEndpointMetadata)metadata).getConfig(); } else { cec = new BasicServerEndpointConfig(this,endpoint.getClass(),path); } } return new EndpointInstance(endpoint,cec,metadata); }
@Override public void onSessionOpened(WebSocketSession session) { getWebSocketServerFactory().onSessionOpened(session); }
public InstJsrServerExtendsEndpointImpl(MetricRegistry metrics) { this.metrics = metrics; this.origImpl = new JsrServerExtendsEndpointImpl(); }
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); }
@Override public boolean supports(Object websocket) { return origImpl.supports(websocket); } }
@Override public String describeRule() { return origImpl.describeRule(); }
@Override public String describeRule() { return origImpl.describeRule(); }
/** * Add a Web socket endpoint. */ public void addEndpoint(ServerEndpointConfig endpointConfig) throws DeploymentException { if (serverContainer == null) { webSocketEndpoints.add(endpointConfig); } else { serverContainer.addEndpoint(endpointConfig); } }
@Override public void onSessionClosed(WebSocketSession session) { getWebSocketServerFactory().onSessionClosed(session); }
public InstJsrServerExtendsEndpointImpl(MetricRegistry metrics) { this.metrics = metrics; this.origImpl = new JsrServerExtendsEndpointImpl(); }
@Override public boolean supports(Object websocket) { return origImpl.supports(websocket); } }
@Override public boolean supports(Object websocket) { return origImpl.supports(websocket); } }
@Override public String describeRule() { return origImpl.describeRule(); }
@Override public String describeRule() { return origImpl.describeRule(); }
@Override public Set<Session> getOpenSessions() { return new HashSet<>(getWebSocketServerFactory().getBeans(Session.class)); } }