Class DefaultLongPollingWebSocket
java.lang.Object
org.eclnt.jsfserver.polling.websocket.DefaultLongPollingWebSocket
- All Implemented Interfaces:
ILongPolling
- Direct Known Subclasses:
BlockerInfo.BlockerInfoWebSocketPolling
Server side web socket processing for WEBSOCKETPOLLING component.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Abort long polling thread.void
Abort long polling thread with error.void
Deprecated.void
boolean
getId()
long
Point of time when a response activity (e.g. wakeup, wakeupForReconnect, ...)getURL()
The URL that can be passed back to client side for accessing the buffered content.void
Same aswakeupForReconnect()
.void
notifyActionForWakeup
(long longPollingWakeupStamp) Notification that an action was executed which was caused by this instance.protected void
void
registerEndPoint
(WebSocketPollingEndPoint endPoint) Function is called when client opens up a websocket connection.void
Send a wake-up signal to the client if there is a wake-up call which is not yet mirrored by corresponding action processing.protected void
sendMessageToClient
(String textMessage) General purpose function to send some text content to the client.void
unregisterEndPoint
(WebSocketPollingEndPoint endPoint) void
wakeup
(boolean continuePolling) Send a trigger to the client side so that the WEBSOCKETPOLLING component activates its actionListener processing.void
In order to avoid time outs of connections you may send some "keep alive" trigger periodically.
-
Constructor Details
-
DefaultLongPollingWebSocket
public DefaultLongPollingWebSocket()
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceILongPolling
-
getContinuePolling
public boolean getContinuePolling()- Specified by:
getContinuePolling
in interfaceILongPolling
-
registerEndPoint
Function is called when client opens up a websocket connection. -
unregisterEndPoint
-
getURL
The URL that can be passed back to client side for accessing the buffered content. The URL contains the session id. The URL is a relative URL that can be passed to all Swing-based components (e.g. FILEDOWNLOADLINK) in any scenario.
When using CaptainCasa in embedded usage mode (UI is running with stand alone Tomcat within one virtual machine) and passing the URL to the BROWSER component then there will be problems. Use the function getURLForBrowserUsage() instead.- Specified by:
getURL
in interfaceILongPolling
-
wakeup
public void wakeup(boolean continuePolling) Send a trigger to the client side so that the WEBSOCKETPOLLING component activates its actionListener processing.- Specified by:
wakeup
in interfaceILongPolling
- Parameters:
continuePolling
- If "true" then the web socket connection is kept. If "false" then the connection is closed.
-
processMessage
protected void processMessage() -
wakeupForReconnect
public void wakeupForReconnect()In order to avoid time outs of connections you may send some "keep alive" trigger periodically.- Specified by:
wakeupForReconnect
in interfaceILongPolling
-
sendMessageToClient
General purpose function to send some text content to the client. -
abortThreadWithouContinuingPolling
Deprecated.Description copied from interface:ILongPolling
Abort long polling thread - and tell the client that it should not continue to create new poll requests.- Specified by:
abortThreadWithouContinuingPolling
in interfaceILongPolling
-
abortThreadWithoutContinuingPolling
public void abortThreadWithoutContinuingPolling() -
abortThread
public void abortThread()Description copied from interface:ILongPolling
Abort long polling thread.- Specified by:
abortThread
in interfaceILongPolling
-
abortThreadWithErrorIfWaiting
public void abortThreadWithErrorIfWaiting()Description copied from interface:ILongPolling
Abort long polling thread with error.- Specified by:
abortThreadWithErrorIfWaiting
in interfaceILongPolling
-
getLongPollingResponse
-
keepAlive
public void keepAlive()Same aswakeupForReconnect()
.- Specified by:
keepAlive
in interfaceILongPolling
-
getLastResponseTime
public long getLastResponseTime()Description copied from interface:ILongPolling
Point of time when a response activity (e.g. wakeup, wakeupForReconnect, ...) was executed.- Specified by:
getLastResponseTime
in interfaceILongPolling
-
notifyActionForWakeup
public void notifyActionForWakeup(long longPollingWakeupStamp) Notification that an action was executed which was caused by this instance. -
reprocessWakeupsWhichAreNotYetMirroredByAction
public void reprocessWakeupsWhichAreNotYetMirroredByAction()Send a wake-up signal to the client if there is a wake-up call which is not yet mirrored by corresponding action processing.
-