Package javax.websocket.server

Examples of javax.websocket.server.ServerEndpointConfig$Configurator


            ServerContainer sc =
                    (ServerContainer) sce.getServletContext().getAttribute(
                            org.apache.tomcat.websocket.server.Constants.
                            SERVER_CONTAINER_SERVLET_CONTEXT_ATTRIBUTE);
            try {
                sc.addEndpoint(new ServerEndpointConfig() {
                    @Override
                    public Map<String, Object> getUserProperties() {
                        return Collections.emptyMap();
                    }
                    @Override
View Full Code Here


                    configurator = configuratorClass.newInstance();
                } else {
                    configurator = new ServerInstanceFactoryConfigurator(factory);
                }

                ServerEndpointConfig config = ServerEndpointConfig.Builder.create(endpoint, serverEndpoint.value())
                        .decoders(Arrays.asList(serverEndpoint.decoders()))
                        .encoders(Arrays.asList(serverEndpoint.encoders()))
                        .subprotocols(Arrays.asList(serverEndpoint.subprotocols()))
                        .configurator(configurator)
                        .build();
View Full Code Here

                    configurator = configuratorClass.newInstance();
                } else {
                    configurator = new ServerInstanceFactoryConfigurator(factory);
                }

                ServerEndpointConfig config = ServerEndpointConfig.Builder.create(endpoint, serverEndpoint.value())
                        .decoders(Arrays.asList(serverEndpoint.decoders()))
                        .encoders(Arrays.asList(serverEndpoint.encoders()))
                        .subprotocols(Arrays.asList(serverEndpoint.subprotocols()))
                        .configurator(configurator)
                        .build();
View Full Code Here

     * @param clazz          the websocket endpoint
     * @param path           the path
     * @param userProperties out user properties.
     */
    public void registerEndpoint(Class<? extends Endpoint> clazz, String path, Map<String, Object> userProperties) {
        ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder.create(clazz, path).build();
        serverEndpointConfig.getUserProperties().putAll(userProperties);
        registerEndpoint(serverEndpointConfig);
    }
View Full Code Here

                    configurator = configuratorClass.newInstance();
                } else {
                    configurator = new ServerInstanceFactoryConfigurator(factory);
                }

                ServerEndpointConfig config = ServerEndpointConfig.Builder.create(endpoint, serverEndpoint.value())
                        .decoders(Arrays.asList(serverEndpoint.decoders()))
                        .encoders(Arrays.asList(serverEndpoint.encoders()))
                        .subprotocols(Arrays.asList(serverEndpoint.subprotocols()))
                        .configurator(configurator)
                        .build();
View Full Code Here

        String protocol = getProtocol();
        List<String> protocols = protocol == null ? null : Collections.singletonList(protocol);

        for (String mapping : normalizeURLMapping(cometdURLMapping))
        {
            ServerEndpointConfig config = ServerEndpointConfig.Builder.create(WebSocketScheduler.class, mapping)
                    .subprotocols(protocols)
                    .configurator(new Configurator(context))
                    .build();
            try
            {
View Full Code Here

        .getServletContext().getAttribute(
            "javax.websocket.server.ServerContainer");
    try {
      final URI myUrl = URI.create(sce.getServletContext()
          .getInitParameter("servletUrl"));
      final ServerEndpointConfig config = ServerEndpointConfig.Builder
          .create(WebsocketEndpoint.class, myUrl.getPath()).build();
      config.getUserProperties().put("servletUrl", myUrl);
      serverContainer.addEndpoint(config);
    } catch (final DeploymentException e) {
      LOG.log(Level.WARNING,
          "Couldn't initialize websocket server endpoint.", e);
    }
View Full Code Here

                              .getName());
                }
                final ServletLauncher launcher = (ServletLauncher) launcherClass
                    .newInstance();
               
                final ServerEndpointConfig sec = ServerEndpointConfig.Builder
                    .create(WebsocketEndpoint.class,
                        serverUri.getPath())
                    .build();
                sec.getUserProperties().put("address",
                    serverUri);
               
                launcher.add(sec, config);
               
              } catch (final Exception e1) {
View Full Code Here

        final EndpointConfig configuration = this.endpoint.getEndpointConfig();

        if (configuration instanceof ServerEndpointConfig) {

            // http://java.net/jira/browse/TYRUS-62
            final ServerEndpointConfig serverEndpointConfig = (ServerEndpointConfig) configuration;
            serverEndpointConfig.getConfigurator().modifyHandshake(serverEndpointConfig, createHandshakeRequest(request),
                    response);
        }
    }
View Full Code Here

                    configurator = configuratorClass.newInstance();
                } else {
                    configurator = new ServerInstanceFactoryConfigurator(factory);
                }

                ServerEndpointConfig config = ServerEndpointConfig.Builder.create(endpoint, serverEndpoint.value())
                        .decoders(Arrays.asList(serverEndpoint.decoders()))
                        .encoders(Arrays.asList(serverEndpoint.encoders()))
                        .subprotocols(Arrays.asList(serverEndpoint.subprotocols()))
                        .configurator(configurator)
                        .build();
View Full Code Here

TOP

Related Classes of javax.websocket.server.ServerEndpointConfig$Configurator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.