Package org.springframework.web.socket.server.support

Examples of org.springframework.web.socket.server.support.DefaultHandshakeHandler


    result.add(new JsonpPollingTransportHandler());
    result.add(new JsonpReceivingTransportHandler());
    result.add(new EventSourceTransportHandler());
    result.add(new HtmlFileTransportHandler());
    try {
      result.add(new WebSocketTransportHandler(new DefaultHandshakeHandler()));
    }
    catch (Exception ex) {
      Log logger = LogFactory.getLog(DefaultSockJsService.class);
      if (logger.isWarnEnabled()) {
        logger.warn("Failed to create a default WebSocketTransportHandler", ex);
View Full Code Here



  @Before
  public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);
    this.handshakeHandler = new DefaultHandshakeHandler(this.upgradeStrategy);
  }
View Full Code Here

  static abstract class AbstractRequestUpgradeStrategyConfig {

    @Bean
    public DefaultHandshakeHandler handshakeHandler() {
      return new DefaultHandshakeHandler(requestUpgradeStrategy());
    }
View Full Code Here

    @Autowired
    private RequestUpgradeStrategy upgradeStrategy;

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
      HandshakeHandler handshakeHandler = new DefaultHandshakeHandler(this.upgradeStrategy);
      registry.addHandler(new EchoHandler(), "/echo").setHandshakeHandler(handshakeHandler).withSockJS();
      registry.addHandler(testServerHandler(), "/test").setHandshakeHandler(handshakeHandler).withSockJS();
    }
View Full Code Here

  }

  @Test
  public void handshakeHandler() {
    WebSocketHandler handler = new TextWebSocketHandler();
    HandshakeHandler handshakeHandler = new DefaultHandshakeHandler();

    this.registration.addHandler(handler, "/foo").setHandshakeHandler(handshakeHandler);

    List<Mapping> mappings = this.registration.getMappings();
    assertEquals(1, mappings.size());
View Full Code Here

  }

  @Test
  public void handshakeHandlerPassedToSockJsRegistration() {
    WebSocketHandler handler = new TextWebSocketHandler();
    HandshakeHandler handshakeHandler = new DefaultHandshakeHandler();

    this.registration.addHandler(handler, "/foo").setHandshakeHandler(handshakeHandler).withSockJS();

    List<Mapping> mappings = this.registration.getMappings();
    assertEquals(1, mappings.size());
View Full Code Here

  @Test
  public void handshakeHandlerAndInterceptor() {
    WebMvcStompWebSocketEndpointRegistration registration =
        new WebMvcStompWebSocketEndpointRegistration(new String[] {"/foo"}, this.handler, this.scheduler);

    DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler();
    HttpSessionHandshakeInterceptor interceptor = new HttpSessionHandshakeInterceptor();

    registration.setHandshakeHandler(handshakeHandler).addInterceptors(interceptor);

    MultiValueMap<HttpRequestHandler, String> mappings = registration.getMappings();
View Full Code Here

  @Test
  public void handshakeHandlerAndInterceptorWithAllowedOrigins() {
    WebMvcStompWebSocketEndpointRegistration registration =
        new WebMvcStompWebSocketEndpointRegistration(new String[] {"/foo"}, this.handler, this.scheduler);

    DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler();
    HttpSessionHandshakeInterceptor interceptor = new HttpSessionHandshakeInterceptor();
    String origin = "http://mydomain.com";
    registration.setHandshakeHandler(handshakeHandler).addInterceptors(interceptor).setAllowedOrigins(origin);

    MultiValueMap<HttpRequestHandler, String> mappings = registration.getMappings();
View Full Code Here

  @Test
  public void handshakeHandlerInterceptorWithSockJsService() {
    WebMvcStompWebSocketEndpointRegistration registration =
        new WebMvcStompWebSocketEndpointRegistration(new String[] {"/foo"}, this.handler, this.scheduler);

    DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler();
    HttpSessionHandshakeInterceptor interceptor = new HttpSessionHandshakeInterceptor();

    registration.setHandshakeHandler(handshakeHandler).addInterceptors(interceptor).withSockJS();

    MultiValueMap<HttpRequestHandler, String> mappings = registration.getMappings();
View Full Code Here

  @Test
  public void handshakeHandlerInterceptorWithSockJsServiceAndAllowedOrigins() {
    WebMvcStompWebSocketEndpointRegistration registration =
        new WebMvcStompWebSocketEndpointRegistration(new String[] {"/foo"}, this.handler, this.scheduler);

    DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler();
    HttpSessionHandshakeInterceptor interceptor = new HttpSessionHandshakeInterceptor();
    String origin = "http://mydomain.com";

    registration.setHandshakeHandler(handshakeHandler).addInterceptors(interceptor).setAllowedOrigins(origin).withSockJS();
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.server.support.DefaultHandshakeHandler

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.