Package org.springframework.web.socket.sockjs

Examples of org.springframework.web.socket.sockjs.SockJsService


    assertNotNull(handlerMapping);

    SockJsHttpRequestHandler testHandler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/test/**");
    assertNotNull(testHandler);
    unwrapAndCheckDecoratedHandlerType(testHandler.getWebSocketHandler(), TestWebSocketHandler.class);
    SockJsService testSockJsService = testHandler.getSockJsService();

    SockJsHttpRequestHandler fooHandler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/foo/**");
    assertNotNull(fooHandler);
    unwrapAndCheckDecoratedHandlerType(fooHandler.getWebSocketHandler(), FooWebSocketHandler.class);
    SockJsService sockJsService = fooHandler.getSockJsService();
    assertNotNull(sockJsService);

    assertSame(testSockJsService, sockJsService);

    assertThat(sockJsService, instanceOf(DefaultSockJsService.class));
View Full Code Here


    SockJsHttpRequestHandler handler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/test/**");
    assertNotNull(handler);
    unwrapAndCheckDecoratedHandlerType(handler.getWebSocketHandler(), TestWebSocketHandler.class);

    SockJsService sockJsService = handler.getSockJsService();
    assertNotNull(sockJsService);
    assertThat(sockJsService, instanceOf(TransportHandlingSockJsService.class));
    TransportHandlingSockJsService transportService = (TransportHandlingSockJsService) sockJsService;
    assertThat(transportService.getTaskScheduler(), instanceOf(TestTaskScheduler.class));
    assertThat(transportService.getTransportHandlers().values(),
View Full Code Here

  }

  protected final M getMappings() {
    M mappings = createMappings();
    if (this.sockJsServiceRegistration != null) {
      SockJsService sockJsService = this.sockJsServiceRegistration.getSockJsService();
      for (WebSocketHandler wsHandler : this.handlerMap.keySet()) {
        for (String path : this.handlerMap.get(wsHandler)) {
          String pathPattern = path.endsWith("/") ? path + "**" : path + "/**";
          addSockJsServiceMapping(mappings, sockJsService, wsHandler, pathPattern);
        }
View Full Code Here

  }

  public final MultiValueMap<HttpRequestHandler, String> getMappings() {
    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);
      }
View Full Code Here

    private GameHandler gameHandler;

    @Bean
    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();
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.sockjs.SockJsService

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.