Search in sources :

Example 16 with DeploymentException

use of jakarta.websocket.DeploymentException in project tomcat by apache.

the class TesterEndpointConfig method contextInitialized.

@Override
public void contextInitialized(ServletContextEvent sce) {
    super.contextInitialized(sce);
    ServerContainer sc = (ServerContainer) sce.getServletContext().getAttribute(Constants.SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE);
    try {
        ServerEndpointConfig sec = getServerEndpointConfig();
        if (sec == null) {
            sc.addEndpoint(getEndpointClass());
        } else {
            sc.addEndpoint(sec);
        }
    } catch (DeploymentException e) {
        throw new RuntimeException(e);
    }
}
Also used : ServerEndpointConfig(jakarta.websocket.server.ServerEndpointConfig) DeploymentException(jakarta.websocket.DeploymentException) ServerContainer(jakarta.websocket.server.ServerContainer)

Example 17 with DeploymentException

use of jakarta.websocket.DeploymentException in project spring-framework by spring-projects.

the class ServerEndpointExporter method registerEndpoint.

private void registerEndpoint(ServerEndpointConfig endpointConfig) {
    ServerContainer serverContainer = getServerContainer();
    Assert.state(serverContainer != null, "No ServerContainer set");
    try {
        if (logger.isDebugEnabled()) {
            logger.debug("Registering ServerEndpointConfig: " + endpointConfig);
        }
        serverContainer.addEndpoint(endpointConfig);
    } catch (DeploymentException ex) {
        throw new IllegalStateException("Failed to register ServerEndpointConfig: " + endpointConfig, ex);
    }
}
Also used : DeploymentException(jakarta.websocket.DeploymentException) ServerContainer(jakarta.websocket.server.ServerContainer)

Aggregations

DeploymentException (jakarta.websocket.DeploymentException)17 ServerEndpointConfig (jakarta.websocket.server.ServerEndpointConfig)4 ServletException (jakarta.servlet.ServletException)3 ServerContainer (jakarta.websocket.server.ServerContainer)3 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 NamingException (javax.naming.NamingException)3 ClientEndpoint (jakarta.websocket.ClientEndpoint)2 Encoder (jakarta.websocket.Encoder)2 Endpoint (jakarta.websocket.Endpoint)2 Extension (jakarta.websocket.Extension)2 ServerEndpoint (jakarta.websocket.server.ServerEndpoint)2 EOFException (java.io.EOFException)2 URISyntaxException (java.net.URISyntaxException)2 List (java.util.List)2 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 SSLEngine (javax.net.ssl.SSLEngine)2 SSLException (javax.net.ssl.SSLException)2 PojoMethodMapping (org.apache.tomcat.websocket.pojo.PojoMethodMapping)2