public class WebSocketSettings extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WebSocketSettings.Holder
Holds this WebSocketSettings in the Application's metadata.
|
static class |
WebSocketSettings.SameThreadExecutor
Simple executor that runs the tasks in the caller thread.
|
static class |
WebSocketSettings.ThreadFactory |
static class |
WebSocketSettings.WebSocketPushMessageExecutor |
Constructor and Description |
---|
WebSocketSettings() |
Modifier and Type | Method and Description |
---|---|
CharSequence |
getBaseUrl() |
IWebSocketConnectionFilter |
getConnectionFilter() |
IWebSocketConnectionRegistry |
getConnectionRegistry() |
CharSequence |
getContextPath() |
CharSequence |
getFilterPrefix() |
Integer |
getPort() |
Integer |
getSecurePort() |
Executor |
getSendPayloadExecutor()
The executor that broadcasts the
WebSocketPayload
via Wicket's event bus. |
Executor |
getWebSocketPushMessageExecutor() |
WebRequest |
newWebSocketRequest(javax.servlet.http.HttpServletRequest request,
String filterPath)
A factory method for the
WebRequest
that should be used in the WebSocket processing request cycle |
WebSocketRequestHandler |
newWebSocketRequestHandler(Page page,
IWebSocketConnection connection)
A factory method for creating instances of
WebSocketRequestHandler
for processing a web socket request |
WebResponse |
newWebSocketResponse(IWebSocketConnection connection)
A factory method for the
WebResponse
that should be used to write the response back to the client/browser |
void |
setBaseUrl(CharSequence baseUrl) |
void |
setConnectionFilter(IWebSocketConnectionFilter connectionFilter)
Sets the filter for checking the incoming connections
|
WebSocketSettings |
setConnectionRegistry(IWebSocketConnectionRegistry connectionRegistry)
Sets the connection registry
|
void |
setContextPath(CharSequence contextPath) |
void |
setFilterPrefix(CharSequence filterPrefix) |
void |
setPort(int wsPort)
Sets the port that should be used for
ws: connections. |
void |
setSecurePort(int wssPort)
Sets the port that should be used for
wss: connections. |
WebSocketSettings |
setSendPayloadExecutor(Executor sendPayloadExecutor)
The executor that broadcasts the
WebSocketPayload
via Wicket's event bus. |
WebSocketSettings |
setWebSocketPushMessageExecutor(Executor executor)
Set the executor for processing websocket push messages broadcasted to all sessions.
|
public WebSocketSettings setWebSocketPushMessageExecutor(Executor executor)
executor
- The executor used for processing push messages.public Executor getWebSocketPushMessageExecutor()
public IWebSocketConnectionRegistry getConnectionRegistry()
public WebSocketSettings setConnectionRegistry(IWebSocketConnectionRegistry connectionRegistry)
connectionRegistry
- The registry that tracks all currently connected WebSocket clientsthis
, for method chainingpublic WebSocketSettings setSendPayloadExecutor(Executor sendPayloadExecutor)
WebSocketPayload
via Wicket's event bus.
Default executor does all the processing in the caller thread.sendPayloadExecutor
- The executor used for broadcasting the events with web socket payloads to
WebSocketBehavior
s and
WebSocketResource
s.public Executor getSendPayloadExecutor()
WebSocketPayload
via Wicket's event bus.WebSocketBehavior
s and
WebSocketResource
s.public void setConnectionFilter(IWebSocketConnectionFilter connectionFilter)
connectionFilter
- the filter for checking the incoming connectionsWebSocketConnectionFilterCollection
public IWebSocketConnectionFilter getConnectionFilter()
WebSocketConnectionFilterCollection
public WebResponse newWebSocketResponse(IWebSocketConnection connection)
WebResponse
that should be used to write the response back to the client/browserconnection
- The active web socket connectionpublic WebSocketRequestHandler newWebSocketRequestHandler(Page page, IWebSocketConnection connection)
WebSocketRequestHandler
for processing a web socket requestpage
- The page with the web socket client. A dummy page in case of usage of
WebSocketResource
connection
- The active web socket connectionpublic WebRequest newWebSocketRequest(javax.servlet.http.HttpServletRequest request, String filterPath)
WebRequest
that should be used in the WebSocket processing request cyclerequest
- The upgraded http requestfilterPath
- The configured filter path of WicketFilter in web.xmlpublic void setFilterPrefix(CharSequence filterPrefix)
public CharSequence getFilterPrefix()
public void setContextPath(CharSequence contextPath)
public CharSequence getContextPath()
public void setBaseUrl(CharSequence baseUrl)
public CharSequence getBaseUrl()
public void setPort(int wsPort)
ws:
connections.
If unset then the current HTTP port will be used.wsPort
- The custom port for WS connectionspublic Integer getPort()
public void setSecurePort(int wssPort)
wss:
connections.
If unset then the current HTTPS port will be used.wssPort
- The custom port for WSS connectionspublic Integer getSecurePort()
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.