Package org.springframework.web.socket.handler

Examples of org.springframework.web.socket.handler.WebSocketHandlerDecorator


    expectedHeaders.setSecWebSocketProtocol(subprotocols);

    assertEquals(expectedHeaders, client.headers);
    assertEquals(new URI("/path/123"), client.uri);

    WebSocketHandlerDecorator loggingHandler = (WebSocketHandlerDecorator) client.webSocketHandler;
    assertEquals(LoggingWebSocketHandlerDecorator.class, loggingHandler.getClass());

    assertSame(handler, loggingHandler.getDelegate());
  }
View Full Code Here


class TestWebSocketHandlerDecoratorFactory implements WebSocketHandlerDecoratorFactory {

  @Override
  public WebSocketHandler decorate(WebSocketHandler handler) {
    return new WebSocketHandlerDecorator(handler) {
      @Override
      public void afterConnectionEstablished(WebSocketSession session) throws Exception {
        session.getAttributes().put("decorated", true);
        super.afterConnectionEstablished(session);
      }
View Full Code Here

    @Override
    protected void configureWebSocketTransport(WebSocketTransportRegistration registry) {
      registry.addDecoratorFactory(new WebSocketHandlerDecoratorFactory() {
        @Override
        public WebSocketHandlerDecorator decorate(WebSocketHandler handler) {
          return new WebSocketHandlerDecorator(handler) {
            @Override
            public void afterConnectionEstablished(WebSocketSession session) throws Exception {
              session.getAttributes().put("decorated", true);
              super.afterConnectionEstablished(session);
            }
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.handler.WebSocketHandlerDecorator

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.