Top Inners Fields Constructors Methods
org.glassfish.tyrus.servlet

pack-priv Class TyrusServletUpgrade

extends Object
Class Inheritance
Imports
jakarta.servlet.ServletContext, .ServletException, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, .HttpSession, .WebConnection, jakarta.websocket.server.HandshakeRequest, .ServerContainer, jakarta.xml.bind.JAXBContext, .JAXBException, org.glassfish.tyrus.core.RequestContext, .TyrusUpgradeResponse, .TyrusWebSocketEngine, .Utils, org.glassfish.tyrus.core.wsadl.model.Application, org.glassfish.tyrus.spi.UpgradeResponse, .WebSocketEngine, .Writer, java.io.IOException, java.net.URI, java.util.Enumeration, .HashMap, .List, .Map, java.util.concurrent.ConcurrentHashMap, java.util.logging.Logger

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private TyrusWebSocketEngine
private static final Logger
private TyrusServerContainer
private final Map<HttpSession, TyrusHttpUpgradeHandler>
private final boolean
private JAXBContext

Constructor Summary

AccessConstructor and Description
pack-priv
TyrusServletUpgrade(TyrusWebSocketEngine engine, boolean wsadlEnabled)

Method Summary

Modifier and TypeMethod and Description
private static void
appendAllHeaders(HttpServletResponse httpServletResponse, TyrusUpgradeResponse tyrusUpgradeResponse)

private static void
appendTraceHeaders(HttpServletResponse httpServletResponse, TyrusUpgradeResponse tyrusUpgradeResponse)

public void
pack-priv TyrusHttpUpgradeHandler
private Map<String, Object>
private synchronized JAXBContext
pack-priv void
init(ServletContext servletContext)

pack-priv boolean

Returns:

Return true if response is set, i.e. in filter chain the next filter should not be invoked.
upgrade
(HttpServletRequest
servlet request
httpServletRequest
,
HttpServletResponse
servlet response
httpServletResponse
)

provide the HTTP upgrade

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

engineback to summary
private TyrusWebSocketEngine engine
LOGGERback to summary
private static final Logger LOGGER
serverContainerback to summary
private TyrusServerContainer serverContainer
sessionToHandlerback to summary
private final Map<HttpSession, TyrusHttpUpgradeHandler> sessionToHandler
wsadlEnabledback to summary
private final boolean wsadlEnabled
wsadlJaxbContextback to summary
private JAXBContext wsadlJaxbContext

Constructor Detail

TyrusServletUpgradeback to summary
pack-priv TyrusServletUpgrade(TyrusWebSocketEngine engine, boolean wsadlEnabled)

Method Detail

appendAllHeadersback to summary
private static void appendAllHeaders(HttpServletResponse httpServletResponse, TyrusUpgradeResponse tyrusUpgradeResponse)
appendTraceHeadersback to summary
private static void appendTraceHeaders(HttpServletResponse httpServletResponse, TyrusUpgradeResponse tyrusUpgradeResponse)
destroyback to summary
public void destroy()
destroySessionback to summary
pack-priv TyrusHttpUpgradeHandler destroySession(HttpSession session)
getInitParamsback to summary
private Map<String, Object> getInitParams(ServletContext ctx)
getWsadlJaxbContextback to summary
private synchronized JAXBContext getWsadlJaxbContext() throws JAXBException
initback to summary
pack-priv void init(ServletContext servletContext) throws ServletException
upgradeback to summary
pack-priv boolean upgrade(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException

provide the HTTP upgrade

Parameters
httpServletRequest:HttpServletRequest

servlet request

httpServletResponse:HttpServletResponse

servlet response

Returns:boolean

Return true if response is set, i.e. in filter chain the next filter should not be invoked.

org.glassfish.tyrus.servlet back to summary

private Class TyrusServletUpgrade.TyrusHttpUpgradeHandlerProxy

extends TyrusHttpUpgradeHandler
Class Inheritance

Field Summary

Modifier and TypeField and Description
private TyrusHttpUpgradeHandler
Inherited from org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler:
FRAME_BUFFER_SIZE

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv WebConnection
public void
init(WebConnection
the WebConnection object associated to this upgrade request
wc
)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init.

Implements jakarta.servlet.http.HttpUpgradeHandler.init.

It is called once the HTTP Upgrade process has been completed and the upgraded connection is ready to start using the new protocol.

public void
onAllDataRead()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onAllDataRead.

Implements jakarta.servlet.ReadListener.onAllDataRead.

Invoked when all data for the current request has been read.

public void
onDataAvailable()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable.

Implements jakarta.servlet.ReadListener.onDataAvailable.

When an instance of the ReadListener is registered with a ServletInputStream, this method will be invoked by the container the first time when it is possible to read data.

public void
onError(Throwable
the throwable to indicate why the read operation failed
t
)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onError.

Implements jakarta.servlet.ReadListener.onError.

Invoked when an error occurs processing the request.

public void
preInit(WebSocketEngine.UpgradeInfo
The WebSocket UpgradeInfo.
upgradeInfo
,
Writer
The Tyrus SPI Writer.
writer
,
boolean
Whether the authentication has been used.
authenticated
)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.preInit.

Sets the required information before init(WebConnection) is invoked.

public void
pack-priv void
public void
setIncomingBufferSize(int
The new incoming frame buffer size value.
incomingBufferSize
)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.setIncomingBufferSize.

Override the default FRAME_BUFFER_SIZE.

Inherited from org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler:
toString

Field Detail

handlerback to summary
private TyrusHttpUpgradeHandler handler

Constructor Detail

TyrusHttpUpgradeHandlerProxyback to summary
private TyrusHttpUpgradeHandlerProxy()

Method Detail

destroyback to summary
public void destroy()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.destroy.

Implements jakarta.servlet.http.HttpUpgradeHandler.destroy.

Doc from jakarta.servlet.http.HttpUpgradeHandler.destroy.

It is called when the client is disconnected.

Annotations
@Override
getWebConnectionback to summary
pack-priv WebConnection getWebConnection()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.getWebConnection.

Annotations
@Override
initback to summary
public void init(WebConnection wc)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init.

Implements jakarta.servlet.http.HttpUpgradeHandler.init.

Doc from jakarta.servlet.http.HttpUpgradeHandler.init.

It is called once the HTTP Upgrade process has been completed and the upgraded connection is ready to start using the new protocol.

Parameters
wc:WebConnection

the WebConnection object associated to this upgrade request

Annotations
@Override
onAllDataReadback to summary
public void onAllDataRead()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onAllDataRead.

Implements jakarta.servlet.ReadListener.onAllDataRead.

Doc from jakarta.servlet.ReadListener.onAllDataRead.

Invoked when all data for the current request has been read.

Annotations
@Override
onDataAvailableback to summary
public void onDataAvailable()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable.

Implements jakarta.servlet.ReadListener.onDataAvailable.

Doc from jakarta.servlet.ReadListener.onDataAvailable.

When an instance of the ReadListener is registered with a ServletInputStream, this method will be invoked by the container the first time when it is possible to read data. Subsequently the container will invoke this method if and only if the jakarta.servlet.ServletInputStream#isReady() method has been called and has returned a value of false and data has subsequently become available to read.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onError.

Implements jakarta.servlet.ReadListener.onError.

Doc from jakarta.servlet.ReadListener.onError.

Invoked when an error occurs processing the request.

Parameters
t:Throwable

the throwable to indicate why the read operation failed

Annotations
@Override
preInitback to summary
public void preInit(WebSocketEngine.UpgradeInfo upgradeInfo, Writer writer, boolean authenticated)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.preInit.

Doc from org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.preInit.

Sets the required information before init(WebConnection) is invoked.

Parameters
upgradeInfo:WebSocketEngine.UpgradeInfo

The WebSocket UpgradeInfo.

writer:Writer

The Tyrus SPI Writer.

authenticated:boolean

Whether the authentication has been used.

Annotations
@Override
sessionDestroyedback to summary
public void sessionDestroyed()

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.sessionDestroyed.

Doc from org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.sessionDestroyed.

Called when related jakarta.servlet.http.HttpSession is destroyed or invalidated.

Implementation is required to call onClose() on server-side with corresponding close code (1008, see WebSocket spec 7.2) - only when there is an authorized user for this session.

Annotations
@Override
setHandlerback to summary
pack-priv void setHandler(TyrusHttpUpgradeHandler handler)
setIncomingBufferSizeback to summary
public void setIncomingBufferSize(int incomingBufferSize)

Overrides org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.setIncomingBufferSize.

Doc from org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.setIncomingBufferSize.

Override the default FRAME_BUFFER_SIZE.

Parameters
incomingBufferSize:int

The new incoming frame buffer size value.

Annotations
@Override