public class TyrusWebSocketEngine extends 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 String |
INCOMING_BUFFER_SIZE
Maximum size of incoming buffer in bytes.
|
static String |
MAX_SESSIONS_PER_APP
Maximum number of open sessions per server application.
|
static String |
MAX_SESSIONS_PER_REMOTE_ADDR
Maximum number of open sessions per unique remote address.
|
static String |
PARALLEL_BROADCAST_ENABLED
Parallel broadcast support.
|
static String |
TRACING_THRESHOLD
Property used for configuring tracing threshold.
|
static String |
TRACING_TYPE
Property used for configuring the type of tracing supported by the server.
|
static String |
WSADL_SUPPORT
Wsadl support.
|
Modifier and Type | Method and Description |
---|---|
static TyrusWebSocketEngine.TyrusWebSocketEngineBuilder |
builder(javax.websocket.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(Class<?> endpointClass,
String contextPath)
Register endpoint class.
|
void |
register(javax.websocket.server.ServerEndpointConfig serverConfig,
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 String INCOMING_BUFFER_SIZE
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 String MAX_SESSIONS_PER_APP
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 String MAX_SESSIONS_PER_REMOTE_ADDR
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 String TRACING_TYPE
DebugContext.TracingType
.
The default value is DebugContext.TracingType.OFF
.public static final String TRACING_THRESHOLD
DebugContext.TracingThreshold
.
The default value is DebugContext.TracingThreshold.SUMMARY
.@Beta public static final String WSADL_SUPPORT
"true"
means that the feature is enable, "false"
that the feature
is disabled.
Default value is "false";public static final 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(javax.websocket.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(Class<?> endpointClass, String contextPath) throws javax.websocket.DeploymentException
WebSocketEngine
register
in interface WebSocketEngine
endpointClass
- endpoint class to be registered.contextPath
- context path of the registered endpoint.javax.websocket.DeploymentException
- when the endpoint is invalid.public void register(javax.websocket.server.ServerEndpointConfig serverConfig, String contextPath) throws javax.websocket.DeploymentException
WebSocketEngine
ServerEndpointConfig
.register
in interface WebSocketEngine
serverConfig
- server endpoint to be registered.contextPath
- context path of the registered endpoint.javax.websocket.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-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.