Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.core

public Class TyrusWebSocketEngine

extends Object
implements WebSocketEngine
Class Inheritance
All Implemented Interfaces
org.glassfish.tyrus.spi.WebSocketEngine
Imports
java.nio.Buffer, .ByteBuffer, java.util.Arrays, .Collections, .HashMap, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, java.util.concurrent.atomic.AtomicInteger, java.util.logging.Level, .Logger, jakarta.websocket.CloseReason, .DeploymentException, .Endpoint, .EndpointConfig, .Extension, .WebSocketContainer, jakarta.websocket.server.ServerEndpointConfig, org.glassfish.tyrus.core.cluster.ClusterContext, org.glassfish.tyrus.core.extension.ExtendedExtension, org.glassfish.tyrus.core.frame.CloseFrame, .Frame, org.glassfish.tyrus.core.l10n.LocalizationMessages, org.glassfish.tyrus.core.monitoring.ApplicationEventListener, .EndpointEventListener, .MessageEventListener, org.glassfish.tyrus.core.uri.Match, org.glassfish.tyrus.core.wsadl.model.Application, org.glassfish.tyrus.spi.Connection, .ReadHandler, .UpgradeRequest, .UpgradeResponse, .WebSocketEngine, .Writer

WebSocketEngine implementation, which handles server-side handshake, validation and data processing.
Authors
Alexey Stashok, Pavel Bucek
See Also
org.glassfish.tyrus.core.TyrusWebSocket, org.glassfish.tyrus.core.TyrusEndpointWrapper

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
TyrusWebSocketEngine.EndpointEventListenerWrapper

Endpoint event listener wrapper that allows setting the wrapped endpoint event listener later.

private static class
private static class
pack-priv static class
private static class
public static class

Field Summary

Modifier and TypeField and Description
private final ApplicationEventListener
private static final int
private final ClusterContext
private final ComponentProviderService
private final Set<TyrusEndpointWrapper>
private static final WebSocketEngine.UpgradeInfo
public static final String
INCOMING_BUFFER_SIZE

Maximum size of incoming buffer in bytes.

private int
private static final Logger
public static final String
MAX_SESSIONS_PER_APP

Maximum number of open sessions per server application.

public static final String
MAX_SESSIONS_PER_REMOTE_ADDR

Maximum number of open sessions per unique remote address.

private static final TyrusEndpointWrapper.SessionListener
private static final WebSocketEngine.UpgradeInfo
public static final String
PARALLEL_BROADCAST_ENABLED

Parallel broadcast support.

private final Boolean
private final TyrusEndpointWrapper.SessionListener
public static final String
TRACING_THRESHOLD

Property used for configuring tracing threshold.

public static final String
TRACING_TYPE

Property used for configuring the type of tracing supported by the server.

private final DebugContext.TracingThreshold
private final DebugContext.TracingType
private final WebSocketContainer
public static final String
WSADL_SUPPORT

Wsadl support.

Constructor Summary

AccessConstructor and Description
private
TyrusWebSocketEngine(WebSocketContainer
used WebSocketContainer instance.
webSocketContainer
,
Integer
maximal incoming buffer size (this engine won't be able to process messages bigger than this number. If null, default value will be used).
incomingBufferSize
,
ClusterContext
cluster context instance. null indicates standalone mode.
clusterContext
,
ApplicationEventListener
listener used to collect monitored events.
applicationEventListener
,
final Integer
maximal number of open sessions per application. If null, no limit is applied.
maxSessionsPerApp
,
final Integer
maximal number of open sessions per remote address. If null, no limit is applied.
maxSessionsPerRemoteAddr
,
DebugContext.TracingType
type of tracing.
tracingType
,
DebugContext.TracingThreshold
tracing threshold.
tracingThreshold
,
Boolean
true if parallel broadcast should be enabled, true is default.
parallelBroadcastEnabled
)

Create WebSocketEngine instance based on passed WebSocketContainer and with configured maximal incoming buffer size.

Method Summary

Modifier and TypeMethod and Description
public static TyrusWebSocketEngine.TyrusWebSocketEngineBuilder

Returns:

new builder.
builder
(WebSocketContainer
WebSocketContainer instance. Cannot be null.
webSocketContainer
)

Create org.glassfish.tyrus.core.TyrusWebSocketEngine.TyrusWebSocketEngineBuilder instance based on passed WebSocketContainer.

private void
private DebugContext
public ApplicationEventListener
pack-priv TyrusEndpointWrapper
public Application

Returns:

application representing current set of deployed endpoints.
getWsadlApplication
()

Get org.glassfish.tyrus.core.wsadl.model.Application representing current set of deployed endpoints.

private WebSocketEngine.UpgradeInfo
private static void
private static ProtocolHandler
private void
private void
register(TyrusEndpointWrapper
the TyrusEndpointWrapper to register.
endpointWrapper
)

Registers the specified TyrusEndpointWrapper with the WebSocketEngine.

public void
register(Class<?>
endpoint class to be registered.
endpointClass
,
String
context path of the registered endpoint.
contextPath
)

Implements org.glassfish.tyrus.spi.WebSocketEngine.register.

Register endpoint class.

public void
register(ServerEndpointConfig
server endpoint to be registered.
serverConfig
,
String
context path of the registered endpoint.
contextPath
)

Implements org.glassfish.tyrus.spi.WebSocketEngine.register.

Register jakarta.websocket.server.ServerEndpointConfig.

public void
setIncomingBufferSize(int
buffer size in bytes.
incomingBufferSize
)

Set incoming buffer size.

public void
unregister(TyrusEndpointWrapper
the TyrusEndpointWrapper to un-register.
endpointWrapper
)

Un-registers the specified TyrusEndpointWrapper with the WebSocketEngine.

public WebSocketEngine.UpgradeInfo
upgrade(final UpgradeRequest
request to be upgraded.
request
,
final UpgradeResponse
response to the upgrade request.
response
)

Implements org.glassfish.tyrus.spi.WebSocketEngine.upgrade.

A transport calls this method to upgrade a HTTP request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait