Example usage for javax.websocket.server ServerEndpointConfig getPath

List of usage examples for javax.websocket.server ServerEndpointConfig getPath

Introduction

In this page you can find the example usage for javax.websocket.server ServerEndpointConfig getPath.

Prototype

String getPath();

Source Link

Document

Returns the path at which this WebSocket server endpoint has been registered.

Usage

From source file:com.almende.eve.transport.http.embed.JettyLauncher.java

@Override
public void add(final ServerEndpointConfig serverConfig, final ObjectNode config) throws ServletException {
    // TODO: config hierarchy...
    if (server == null) {
        if (config != null) {
            initServer((ObjectNode) config.get("jetty"));
        } else {/*  w  ww. j  a va 2  s .c o  m*/
            initServer(JOM.createObjectNode());
        }
    }
    LOG.info("Registering websocket server endpoint:" + serverConfig.getPath());
    try {
        wscontainer.addEndpoint(serverConfig);
    } catch (final DeploymentException e) {
        LOG.log(Level.WARNING, "Couldn't initialize websocket server endpoint.", e);
    }
}

From source file:org.springframework.web.socket.server.endpoint.EndpointExporter.java

@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof ServerEndpointConfig) {
        ServerEndpointConfig sec = (ServerEndpointConfig) bean;
        try {//w  ww  .  j a v  a2 s  .  c o m
            if (logger.isInfoEnabled()) {
                logger.info("Registering bean '" + beanName + "' as javax.websocket.Endpoint under path "
                        + sec.getPath());
            }
            getServerContainer().addEndpoint(sec);
        } catch (DeploymentException e) {
            throw new IllegalStateException("Failed to deploy Endpoint bean " + bean, e);
        }
    }
    return bean;
}