TyrusWebSocketEngine engine = (TyrusWebSocketEngine) serverContainer.getWebSocketEngine(); Object tyrusEndpoint = null; boolean success;
@Override public void close() throws IOException { tyrusServerContainer.shutdown(); } };
tyrusServerContainer.doneDeployment(); tyrusServerContainer.start("/inmemory", 0); tyrusServerContainer.getWebSocketEngine().upgrade(requestContext, upgradeResponse); switch (upgradeInfo.getStatus()) { case HANDSHAKE_FAILED: tyrusServerContainer.shutdown(); throw new DeploymentException(""); case NOT_APPLICABLE: tyrusServerContainer.shutdown(); throw new DeploymentException(""); case SUCCESS:
@Override public void init(FilterConfig filterConfig) throws ServletException { ServletContext servletContext = filterConfig.getServletContext(); this.serverContainer = (org.glassfish.tyrus.server.TyrusServerContainer) servletContext .getAttribute(ServerContainer.class.getName()); try { // TODO? - port/contextPath .. is it really relevant here? serverContainer.start(servletContext.getContextPath(), 0); } catch (Exception e) { throw new ServletException("Web socket server initialization failed.", e); } finally { serverContainer.doneDeployment(); } }
@Override public void destroy() { serverContainer.stop(); engine.getApplicationEventListener().onApplicationDestroyed(); } }
@Override public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointClass, cec, path); }
super.start(rootPath, port);
@Override public void stop() { super.stop(); server.shutdownNow(); if (applicationEventListener != null) { applicationEventListener.onApplicationDestroyed(); } } };
@Override public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointInstance, cec, path); }
TyrusWebSocketEngine engine = (TyrusWebSocketEngine) serverContainer.getWebSocketEngine(); Object tyrusEndpoint = null; boolean success;
@Override public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointClass, cec, path); }
@Override public void close() throws IOException { tyrusServerContainer.shutdown(); } };
new TyrusServletFilter((TyrusWebSocketEngine) serverContainer.getWebSocketEngine(), wsadlEnabled);
@Override public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointInstance, cec, path); }
/** * Undeploy all endpoints and stop underlying {@link org.glassfish.tyrus.spi.ServerContainer}. * <p> * Release all created threadpools / executor services. */ @Override public void stop() { // release executor services managed by {@link BaseContainer}. shutdown(); }
TyrusWebSocketEngine engine = (TyrusWebSocketEngine) serverContainer.getWebSocketEngine(); Object tyrusEndpoint = null; boolean success;
@Override public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(annotatedEndpointClass, path); }
/** * Undeploy all endpoints and stop underlying {@link org.glassfish.tyrus.spi.ServerContainer}. * <p> * Release all created threadpools / executor services. */ @Override public void stop() { // release executor services managed by {@link BaseContainer}. shutdown(); }