MCPcopy Index your code
hub / github.com/apache/tomcat / WsSession

Method WsSession

java/org/apache/tomcat/websocket/WsSession.java:143–177  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 /**

Callers

nothing calls this directly

Calls 15

getInstanceManagerMethod · 0.95
isDefaultConfiguratorMethod · 0.95
getEndpointInstanceMethod · 0.95
newInstanceMethod · 0.95
setEncodersMethod · 0.80
toHexStringMethod · 0.80
setSendTimeoutMethod · 0.65
getUserPropertiesMethod · 0.65

Tested by

no test coverage detected