Esempio n. 1
0
 public UndertowSession(
     WebSocketChannel webSocketChannel,
     URI requestUri,
     Map<String, String> pathParameters,
     Map<String, List<String>> requestParameterMap,
     EndpointSessionHandler handler,
     Principal user,
     InstanceHandle<Endpoint> endpoint,
     EndpointConfig config,
     final String queryString,
     final Encoding encoding,
     final Set<Session> openSessions) {
   this.webSocketChannel = webSocketChannel;
   this.queryString = queryString;
   this.encoding = encoding;
   this.openSessions = openSessions;
   container = handler.getContainer();
   this.user = user;
   this.requestUri = requestUri;
   this.requestParameterMap = Collections.unmodifiableMap(requestParameterMap);
   this.pathParameters = Collections.unmodifiableMap(pathParameters);
   remote = new WebSocketSessionRemoteEndpoint(webSocketChannel, config, encoding);
   this.endpoint = endpoint;
   webSocketChannel
       .getCloseSetter()
       .set(
           new ChannelListener<Channel>() {
             @Override
             public void handleEvent(final Channel channel) {
               close0();
             }
           });
   this.frameHandler = new FrameHandler(this, this.endpoint.getInstance());
   webSocketChannel.getReceiveSetter().set(frameHandler);
   this.sessionId = new SecureRandomSessionIdGenerator().createSessionId();
   this.attrs =
       Collections.synchronizedMap(new HashMap<String, Object>(config.getUserProperties()));
 }