|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor
public abstract class AbstractWebSocketProcessor
The base implementation of IWebSocketProcessor. Provides the common logic for registering a web socket connection and broadcasting its events.
| Constructor Summary | |
|---|---|
AbstractWebSocketProcessor(javax.servlet.http.HttpServletRequest request,
WebApplication application)
Constructor. |
|
| Method Summary | |
|---|---|
void |
broadcastMessage(IWebSocketMessage message)
Exports the Wicket thread locals and broadcasts the received message from the client to all interested components and behaviors in the page with id #pageId |
protected WebApplication |
getApplication()
|
protected String |
getSessionId()
|
void |
onClose(int closeCode,
String message)
A notification after the close of the web socket connection. |
protected void |
onConnect(IWebSocketConnection connection)
A helper that registers the opened connection in the application-level registry. |
void |
onMessage(byte[] data,
int offset,
int length)
Called when a binary message arrives from the client |
void |
onMessage(String message)
Called when a text message arrives from the client |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.wicket.protocol.ws.api.IWebSocketProcessor |
|---|
onOpen |
| Constructor Detail |
|---|
public AbstractWebSocketProcessor(javax.servlet.http.HttpServletRequest request,
WebApplication application)
request - the http request that was used to create the TomcatWebSocketProcessorapplication - the current Wicket Application| Method Detail |
|---|
public void onMessage(String message)
IWebSocketProcessor
onMessage in interface IWebSocketProcessormessage - the text message from the client
public void onMessage(byte[] data,
int offset,
int length)
IWebSocketProcessor
onMessage in interface IWebSocketProcessordata - the binary message from the clientoffset - the offset to read fromlength - how much data to readprotected final void onConnect(IWebSocketConnection connection)
connection - the web socket connection to use to communicate with the clientIWebSocketProcessor.onOpen(Object)
public void onClose(int closeCode,
String message)
IWebSocketProcessor
onClose in interface IWebSocketProcessorpublic final void broadcastMessage(IWebSocketMessage message)
#pageId
Note: ConnectedMessage and ClosedMessage messages are notification-only. I.e. whatever the components/behaviors write in the WebSocketRequestHandler will be ignored because the protocol doesn't expect response from the user.
message - the message to broadcastprotected final WebApplication getApplication()
protected final String getSessionId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||