org.apache.wicket.protocol.ws
Class WebSocketSettings

java.lang.Object
  extended by org.apache.wicket.protocol.ws.WebSocketSettings
All Implemented Interfaces:
IWebSocketSettings

public class WebSocketSettings
extends Object
implements IWebSocketSettings


Nested Class Summary
static class WebSocketSettings.SameThreadExecutor
          Simple executor that runs the tasks in the caller thread.
 
Nested classes/interfaces inherited from interface org.apache.wicket.protocol.ws.IWebSocketSettings
IWebSocketSettings.Holder
 
Field Summary
 
Fields inherited from interface org.apache.wicket.protocol.ws.IWebSocketSettings
KEY
 
Constructor Summary
WebSocketSettings()
           
 
Method Summary
 IWebSocketConnectionRegistry getConnectionRegistry()
           
 Executor getSendPayloadExecutor()
          The executor that broadcasts the WebSocketPayload via Wicket's event bus.
 Executor getWebSocketPushMessageExecutor()
          The executor for processing websocket push messages broadcasted to all sessions.
 org.apache.wicket.request.http.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
 org.apache.wicket.request.http.WebResponse newWebSocketResponse(IWebSocketConnection connection)
          A factory method for the WebResponse that should be used to write the response back to the client/browser
 IWebSocketSettings setConnectionRegistry(IWebSocketConnectionRegistry connectionRegistry)
           
 WebSocketSettings setSendPayloadExecutor(Executor sendPayloadExecutor)
          The executor that broadcasts the WebSocketPayload via Wicket's event bus.
 IWebSocketSettings setWebSocketPushMessageExecutor(Executor executor)
          Set the executor for processing websocket push messages broadcasted to all sessions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketSettings

public WebSocketSettings()
Method Detail

setWebSocketPushMessageExecutor

public IWebSocketSettings setWebSocketPushMessageExecutor(Executor executor)
Description copied from interface: IWebSocketSettings
Set the executor for processing websocket push messages broadcasted to all sessions. Default executor does all the processing in the caller thread. Using a proper thread pool is adviced for applications that send push events from ajax calls to avoid page level deadlocks.

Specified by:
setWebSocketPushMessageExecutor in interface IWebSocketSettings
Parameters:
executor - The executor used for processing push messages.

getConnectionRegistry

public IWebSocketConnectionRegistry getConnectionRegistry()
Specified by:
getConnectionRegistry in interface IWebSocketSettings

setConnectionRegistry

public IWebSocketSettings setConnectionRegistry(IWebSocketConnectionRegistry connectionRegistry)
Specified by:
setConnectionRegistry in interface IWebSocketSettings

getWebSocketPushMessageExecutor

public Executor getWebSocketPushMessageExecutor()
Description copied from interface: IWebSocketSettings
The executor for processing websocket push messages broadcasted to all sessions.

Specified by:
getWebSocketPushMessageExecutor in interface IWebSocketSettings
Returns:
The executor used for processing push messages.

setSendPayloadExecutor

public WebSocketSettings setSendPayloadExecutor(Executor sendPayloadExecutor)
The executor that broadcasts the WebSocketPayload via Wicket's event bus. Default executor does all the processing in the caller thread.

Parameters:
sendPayloadExecutor - The executor used for broadcasting the events with web socket payloads to WebSocketBehaviors and WebSocketResources.

getSendPayloadExecutor

public Executor getSendPayloadExecutor()
The executor that broadcasts the WebSocketPayload via Wicket's event bus.

Returns:
The executor used for broadcasting the events with web socket payloads to WebSocketBehaviors and WebSocketResources.

newWebSocketResponse

public org.apache.wicket.request.http.WebResponse newWebSocketResponse(IWebSocketConnection connection)
A factory method for the WebResponse that should be used to write the response back to the client/browser

Parameters:
connection - The active web socket connection
Returns:
the response object that should be used to write the response back to the client

newWebSocketRequest

public org.apache.wicket.request.http.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

Parameters:
request - The upgraded http request
filterPath - The configured filter path of WicketFilter in web.xml
Returns:
the request object that should be used in the WebSocket processing request cycle


Copyright © 2006–2020 Apache Software Foundation. All rights reserved.