Examples of SockJsHttpRequestHandler


Examples of org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler

    MultiValueMap<HttpRequestHandler, String> mappings = new LinkedMultiValueMap<HttpRequestHandler, String>();
    if (this.registration != null) {
      SockJsService sockJsService = this.registration.getSockJsService();
      for (String path : this.paths) {
        String pattern = path.endsWith("/") ? path + "**" : path + "/**";
        SockJsHttpRequestHandler handler = new SockJsHttpRequestHandler(sockJsService, this.webSocketHandler);
        mappings.add(handler, pattern);
      }
    }
    else {
      for (String path : this.paths) {
        WebSocketHttpRequestHandler handler;
        if (this.handshakeHandler != null) {
          handler = new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler);
        }
        else {
          handler = new WebSocketHttpRequestHandler(this.webSocketHandler);
        }
        HandshakeInterceptor[] interceptors = getInterceptors();
        if (interceptors.length > 0) {
          handler.setHandshakeInterceptors(Arrays.asList(interceptors));
        }
        mappings.add(handler, path);
      }
    }
    return mappings;
View Full Code Here

Examples of org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler

    public SimpleUrlHandlerMapping handlerMapping() {

        SockJsService sockJsService = new DefaultSockJsService(taskScheduler());

        Map<String, Object> urlMap = new HashMap<String, Object>();
        urlMap.put("/game/websocket/**", new SockJsHttpRequestHandler(sockJsService, gameHandler));

        SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping();
        hm.setUrlMap(urlMap);
        return hm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.