HttpServletRequest servletRequest = getHttpServletRequest(request);
HttpServletResponse servletResponse = getHttpServletResponse(response);
TyrusServerContainer serverContainer = (TyrusServerContainer) getContainer(servletRequest);
TyrusWebSocketEngine engine = (TyrusWebSocketEngine) serverContainer.getWebSocketEngine();
Object tyrusEndpoint = null;
try {
// Shouldn't matter for processing but must be unique
String path = "/" + random.nextLong();
tyrusEndpoint = createTyrusEndpoint(endpoint, path, selectedProtocol, extensions, serverContainer, engine);
getEndpointHelper().register(engine, tyrusEndpoint);
HttpHeaders headers = request.getHeaders();
RequestContext requestContext = createRequestContext(servletRequest, path, headers);
TyrusUpgradeResponse upgradeResponse = new TyrusUpgradeResponse();
UpgradeInfo upgradeInfo = engine.upgrade(requestContext, upgradeResponse);
switch (upgradeInfo.getStatus()) {
case SUCCESS:
if (logger.isTraceEnabled()) {
logger.trace("Successful upgrade: " + upgradeResponse.getHeaders());