public class TyrusWebSocketEngine extends java.lang.Object implements WebSocketEngine
WebSocketEngine
implementation, which handles server-side handshake, validation and data processing.TyrusWebSocket
,
TyrusEndpointWrapper
Modifier and Type | Class and Description |
---|---|
static class |
TyrusWebSocketEngine.TyrusWebSocketEngineBuilder
TyrusWebSocketEngine builder. |
WebSocketEngine.UpgradeInfo, WebSocketEngine.UpgradeStatus
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INCOMING_BUFFER_SIZE
Maximum size of incoming buffer in bytes.
|
static java.lang.String |
MAX_SESSIONS_PER_APP
Maximum number of open sessions per server application.
|
static java.lang.String |
MAX_SESSIONS_PER_REMOTE_ADDR
Maximum number of open sessions per unique remote address.
|
static java.lang.String |
PARALLEL_BROADCAST_ENABLED
Parallel broadcast support.
|
static java.lang.String |
TRACING_THRESHOLD
Property used for configuring tracing threshold.
|
static java.lang.String |
TRACING_TYPE
Property used for configuring the type of tracing supported by the server.
|
static java.lang.String |
WSADL_SUPPORT
Wsadl support.
|
Modifier and Type | Method and Description |
---|---|
static TyrusWebSocketEngine.TyrusWebSocketEngineBuilder |
builder(WebSocketContainer webSocketContainer)
Create
TyrusWebSocketEngine.TyrusWebSocketEngineBuilder
instance based on passed WebSocketContainer . |
ApplicationEventListener |
getApplicationEventListener()
Get
ApplicationEventListener related to current TyrusWebSocketEngine instance. |
Application |
getWsadlApplication()
Get
Application representing current set of deployed endpoints. |
void |
register(java.lang.Class<?> endpointClass,
java.lang.String contextPath)
Register endpoint class.
|
void |
register(ServerEndpointConfig serverConfig,
java.lang.String contextPath)
Register
ServerEndpointConfig . |
void |
setIncomingBufferSize(int incomingBufferSize)
Deprecated.
Please use
.TyrusWebSocketEngineBuilder#incomingBufferSize(Integer)
instead. |
void |
unregister(TyrusEndpointWrapper endpointWrapper)
Un-registers the specified
TyrusEndpointWrapper with the WebSocketEngine . |
WebSocketEngine.UpgradeInfo |
upgrade(UpgradeRequest request,
UpgradeResponse response)
A transport calls this method to upgrade a HTTP request.
|
public static final java.lang.String INCOMING_BUFFER_SIZE
The value must be Integer
or its primitive alternative.
Default value is 4194315, which means that TyrusWebSocketEngine is by default capable of processing messages up to 4 MB.
public static final java.lang.String MAX_SESSIONS_PER_APP
The value must be positive Integer
or its primitive alternative. Negative values
and zero are ignored.
The number of open sessions per application is not limited by default.
public static final java.lang.String MAX_SESSIONS_PER_REMOTE_ADDR
The value must be positive Integer
or its primitive alternative. Negative values
and zero are ignored.
The number of open sessions per remote address is not limited by default.
public static final java.lang.String TRACING_TYPE
The value is expected to be string value of DebugContext.TracingType
.
The default value is DebugContext.TracingType.OFF
.
public static final java.lang.String TRACING_THRESHOLD
The value is expected to be string value of DebugContext.TracingThreshold
.
The default value is DebugContext.TracingThreshold.SUMMARY
.
@Beta public static final java.lang.String WSADL_SUPPORT
Wsadl is experimental feature which exposes endpoint configuration in form of XML file, similarly as Wadl for REST services. Currently generated Wsadl contains only set of endpoints and their endpoint paths. Wsadl is exposed on URI ending by "application.wsadl".
The value must be string, "true"
means that the feature is enable, "false"
that the feature
is disabled.
Default value is "false";
public static final java.lang.String PARALLEL_BROADCAST_ENABLED
TyrusSession.broadcast(String)
and .TyrusSession#broadcast(java.nio.ByteBuffer)
operations are by default executed in parallel. The parallel
execution of broadcast can be disabled by setting this server property to false
.
Expected value is true
or false
and the default value is false
.
public static TyrusWebSocketEngine.TyrusWebSocketEngineBuilder builder(WebSocketContainer webSocketContainer)
TyrusWebSocketEngine.TyrusWebSocketEngineBuilder
instance based on passed WebSocketContainer
.webSocketContainer
- WebSocketContainer
instance. Cannot be null
.public WebSocketEngine.UpgradeInfo upgrade(UpgradeRequest request, UpgradeResponse response)
WebSocketEngine
upgrade
in interface WebSocketEngine
request
- request to be upgraded.response
- response to the upgrade request.public void setIncomingBufferSize(int incomingBufferSize)
.TyrusWebSocketEngineBuilder#incomingBufferSize(Integer)
instead.incomingBufferSize
- buffer size in bytes.public void register(java.lang.Class<?> endpointClass, java.lang.String contextPath) throws DeploymentException
WebSocketEngine
register
in interface WebSocketEngine
endpointClass
- endpoint class to be registered.contextPath
- context path of the registered endpoint.DeploymentException
- when the endpoint is invalid.public void register(ServerEndpointConfig serverConfig, java.lang.String contextPath) throws DeploymentException
WebSocketEngine
ServerEndpointConfig
.register
in interface WebSocketEngine
serverConfig
- server endpoint to be registered.contextPath
- context path of the registered endpoint.DeploymentException
- when the endpoint is invalid.public void unregister(TyrusEndpointWrapper endpointWrapper)
TyrusEndpointWrapper
with the WebSocketEngine
.endpointWrapper
- the TyrusEndpointWrapper
to un-register.public ApplicationEventListener getApplicationEventListener()
ApplicationEventListener
related to current TyrusWebSocketEngine
instance.@Beta public Application getWsadlApplication()
Application
representing current set of deployed endpoints.Copyright © 2012–2020 Oracle Corporation. All rights reserved.