Creates a new WebSocket session for communication between the provided client and remote end points. The result of Thread#getContextClassLoader() at the time this constructor is called will be used when calling Endpoint#onClose(Session, CloseReason). @param clientEndpointHolder The
(ClientEndpointHolder clientEndpointHolder, WsRemoteEndpointImplBase wsRemoteEndpoint,
WsWebSocketContainer wsWebSocketContainer, List<Extension> negotiatedExtensions, String subProtocol,
Map<String,String> pathParameters, boolean secure, ClientEndpointConfig clientEndpointConfig)
| 141 | * @throws DeploymentException if an invalid encode is specified |
| 142 | */ |
| 143 | public WsSession(ClientEndpointHolder clientEndpointHolder, WsRemoteEndpointImplBase wsRemoteEndpoint, |
| 144 | WsWebSocketContainer wsWebSocketContainer, List<Extension> negotiatedExtensions, String subProtocol, |
| 145 | Map<String,String> pathParameters, boolean secure, ClientEndpointConfig clientEndpointConfig) |
| 146 | throws DeploymentException { |
| 147 | this.wsRemoteEndpoint = wsRemoteEndpoint; |
| 148 | this.wsRemoteEndpoint.setSession(this); |
| 149 | this.remoteEndpointAsync = new WsRemoteEndpointAsync(wsRemoteEndpoint); |
| 150 | this.remoteEndpointBasic = new WsRemoteEndpointBasic(wsRemoteEndpoint); |
| 151 | this.webSocketContainer = wsWebSocketContainer; |
| 152 | applicationClassLoader = Thread.currentThread().getContextClassLoader(); |
| 153 | wsRemoteEndpoint.setSendTimeout(wsWebSocketContainer.getDefaultAsyncSendTimeout()); |
| 154 | this.maxBinaryMessageBufferSize = webSocketContainer.getDefaultMaxBinaryMessageBufferSize(); |
| 155 | this.maxTextMessageBufferSize = webSocketContainer.getDefaultMaxTextMessageBufferSize(); |
| 156 | this.maxIdleTimeout = webSocketContainer.getDefaultMaxSessionIdleTimeout(); |
| 157 | this.requestUri = null; |
| 158 | this.requestParameterMap = Collections.emptyMap(); |
| 159 | this.queryString = null; |
| 160 | this.userPrincipal = null; |
| 161 | this.httpSessionId = null; |
| 162 | this.negotiatedExtensions = negotiatedExtensions; |
| 163 | this.subProtocol = Objects.requireNonNullElse(subProtocol, ""); |
| 164 | this.pathParameters = pathParameters; |
| 165 | this.secure = secure; |
| 166 | this.wsRemoteEndpoint.setEncoders(clientEndpointConfig); |
| 167 | this.endpointConfig = clientEndpointConfig; |
| 168 | |
| 169 | this.userProperties.putAll(endpointConfig.getUserProperties()); |
| 170 | this.id = Long.toHexString(ids.getAndIncrement()); |
| 171 | |
| 172 | this.localEndpoint = clientEndpointHolder.getInstance(getInstanceManager()); |
| 173 | |
| 174 | if (log.isTraceEnabled()) { |
| 175 | log.trace(sm.getString("wsSession.created", id)); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | |
| 180 | /** |
nothing calls this directly
no test coverage detected