public abstract class AbstractTyrusRequestUpgradeStrategy extends AbstractStandardUpgradeStrategy
RequestUpgradeStrategy
implementations on top of
JSR-356 based servers which include Tyrus as their WebSocket engine.
Works with Tyrus 1.3.5 (WebLogic 12.1.3) and Tyrus 1.7+ (GlassFish 4.1.x).
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTyrusRequestUpgradeStrategy.Tyrus135EndpointHelper |
protected static class |
AbstractTyrusRequestUpgradeStrategy.Tyrus17EndpointHelper |
protected static interface |
AbstractTyrusRequestUpgradeStrategy.TyrusEndpointHelper
Helps with the creation, registration, and un-registration of endpoints.
|
Modifier and Type | Field and Description |
---|---|
private ComponentProviderService |
componentProvider |
private static java.util.Random |
random |
logger
Constructor and Description |
---|
AbstractTyrusRequestUpgradeStrategy() |
Modifier and Type | Method and Description |
---|---|
private RequestContext |
createRequestContext(HttpServletRequest request,
java.lang.String endpointPath,
HttpHeaders headers) |
private java.lang.Object |
createTyrusEndpoint(Endpoint endpoint,
java.lang.String endpointPath,
java.lang.String protocol,
java.util.List<Extension> extensions,
WebSocketContainer container,
TyrusWebSocketEngine engine) |
protected abstract AbstractTyrusRequestUpgradeStrategy.TyrusEndpointHelper |
getEndpointHelper() |
protected java.util.List<WebSocketExtension> |
getInstalledExtensions(WebSocketContainer container) |
java.lang.String[] |
getSupportedVersions()
Return the supported WebSocket protocol versions.
|
protected abstract void |
handleSuccess(HttpServletRequest request,
HttpServletResponse response,
UpgradeInfo upgradeInfo,
TyrusUpgradeResponse upgradeResponse) |
void |
upgradeInternal(ServerHttpRequest request,
ServerHttpResponse response,
java.lang.String selectedProtocol,
java.util.List<Extension> extensions,
Endpoint endpoint) |
getContainer, getHttpServletRequest, getHttpServletResponse, getSupportedExtensions, upgrade
private static final java.util.Random random
private final ComponentProviderService componentProvider
public java.lang.String[] getSupportedVersions()
RequestUpgradeStrategy
protected java.util.List<WebSocketExtension> getInstalledExtensions(WebSocketContainer container)
getInstalledExtensions
in class AbstractStandardUpgradeStrategy
public void upgradeInternal(ServerHttpRequest request, ServerHttpResponse response, java.lang.String selectedProtocol, java.util.List<Extension> extensions, Endpoint endpoint) throws HandshakeFailureException
upgradeInternal
in class AbstractStandardUpgradeStrategy
HandshakeFailureException
private java.lang.Object createTyrusEndpoint(Endpoint endpoint, java.lang.String endpointPath, java.lang.String protocol, java.util.List<Extension> extensions, WebSocketContainer container, TyrusWebSocketEngine engine) throws DeploymentException
DeploymentException
private RequestContext createRequestContext(HttpServletRequest request, java.lang.String endpointPath, HttpHeaders headers)
protected abstract AbstractTyrusRequestUpgradeStrategy.TyrusEndpointHelper getEndpointHelper()
protected abstract void handleSuccess(HttpServletRequest request, HttpServletResponse response, UpgradeInfo upgradeInfo, TyrusUpgradeResponse upgradeResponse) throws java.io.IOException, ServletException
java.io.IOException
ServletException