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.11 (WebLogic 12.2.1) and Tyrus 1.12 (GlassFish 4.1.1).
Modifier and Type | Field and Description |
---|---|
private ComponentProviderService |
componentProvider |
private static java.lang.reflect.Constructor<?> |
constructor |
private static boolean |
constructorWithBooleanArgument |
private static java.util.Random |
random |
private static java.lang.reflect.Method |
registerMethod |
private static java.lang.reflect.Method |
unRegisterMethod |
logger
Constructor and Description |
---|
AbstractTyrusRequestUpgradeStrategy() |
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
createEndpoint(ServerEndpointRegistration registration,
ComponentProviderService provider,
WebSocketContainer container,
TyrusWebSocketEngine engine) |
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) |
private static java.lang.reflect.Constructor<?> |
getEndpointConstructor() |
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) |
private void |
register(TyrusWebSocketEngine engine,
java.lang.Object endpoint) |
private void |
unregister(TyrusWebSocketEngine engine,
java.lang.Object endpoint) |
private void |
unregisterTyrusEndpoint(TyrusWebSocketEngine engine,
java.lang.Object tyrusEndpoint) |
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 static final java.lang.reflect.Constructor<?> constructor
private static boolean constructorWithBooleanArgument
private static final java.lang.reflect.Method registerMethod
private static final java.lang.reflect.Method unRegisterMethod
private final ComponentProviderService componentProvider
private static java.lang.reflect.Constructor<?> getEndpointConstructor()
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)
private void unregisterTyrusEndpoint(TyrusWebSocketEngine engine, java.lang.Object tyrusEndpoint)
private java.lang.Object createEndpoint(ServerEndpointRegistration registration, ComponentProviderService provider, WebSocketContainer container, TyrusWebSocketEngine engine) throws DeploymentException
DeploymentException
private void register(TyrusWebSocketEngine engine, java.lang.Object endpoint)
private void unregister(TyrusWebSocketEngine engine, java.lang.Object endpoint)
protected abstract void handleSuccess(HttpServletRequest request, HttpServletResponse response, UpgradeInfo upgradeInfo, TyrusUpgradeResponse upgradeResponse) throws java.io.IOException, ServletException
java.io.IOException
ServletException