TyrusWebSocketEngine engine = (TyrusWebSocketEngine) serverContainer.getWebSocketEngine(); Object tyrusEndpoint = null; boolean success;
/** * 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(); }
/** * Stop the server. * * @param server to be stopped. */ protected void stopServer(Server server) { if (server != null) { server.stop(); } }
public WebSocketServer(int port) { log.info("Starting Changes Plugin"); server = new Server("localhost", port, "/ws", null, WebSocketEndpoint.class); }
@Override public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointClass, cec, path); }
public void end() { this.localWebSocketServer.stop(); this.localWebSocketServer = null; }
/** * 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(); }
@Override public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointInstance, cec, path); }
/** * Stop the server. * * @param server to be stopped. */ protected void stopServer(Server server) { if (server != null) { server.stop(); } }
@Override public void close() throws IOException { tyrusServerContainer.shutdown(); } };
@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(); } };
@Override public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(endpointInstance, cec, path); }
@Override public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(annotatedEndpointClass, path); }
@Override public Session connectToServer(Object annotatedEndpointInstance, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(annotatedEndpointInstance, path); }
/** * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Class, java.net.URI)}. * <p> * Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. * * @param annotatedEndpointClass the annotated websocket client endpoint. * @param path the complete path to the server endpoint. * @return Future for the Session created if the connection is successful. * @throws DeploymentException if the class is not a valid annotated endpoint class. */ public Future<Session> asyncConnectToServer(Class<?> annotatedEndpointClass, URI path) throws DeploymentException { return getClientManager().asyncConnectToServer(annotatedEndpointClass, path); }
@Override public Session connectToServer(Object annotatedEndpointInstance, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(annotatedEndpointInstance, path); }
@Override public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException { return getClientManager().connectToServer(annotatedEndpointClass, path); }
/** * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Class, java.net.URI)}. * <p> * Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. * * @param annotatedEndpointClass the annotated websocket client endpoint. * @param path the complete path to the server endpoint. * @return Future for the Session created if the connection is successful. * @throws DeploymentException if the class is not a valid annotated endpoint class. */ public Future<Session> asyncConnectToServer(Class<?> annotatedEndpointClass, URI path) throws DeploymentException { return getClientManager().asyncConnectToServer(annotatedEndpointClass, path); }
/** * Non-blocking version of {@link javax.websocket.WebSocketContainer#connectToServer(Object, java.net.URI)}. * <p> * Only simple checks are performed in the main thread; client container is created in different thread, same * applies to connecting etc. * * @param obj the annotated websocket client endpoint instance. * @param path the complete path to the server endpoint. * @return the Session created if the connection is successful. * @throws DeploymentException if the annotated endpoint instance is not valid. * @see javax.websocket.WebSocketContainer#connectToServer(Object, java.net.URI) */ public Future<Session> asyncConnectToServer(Object obj, URI path) throws DeploymentException { return getClientManager().asyncConnectToServer(obj, path); }