Class DefaultLongPollingWebSocket
java.lang.Object
org.eclnt.jsfserver.polling.websocket.DefaultLongPollingWebSocket
- All Implemented Interfaces:
ILongPolling
- Direct Known Subclasses:
BlockerInfo.BlockerInfoWebSocketPolling,UNIFIEDPOLLINGBinding.MyLongPollingWebSocket
Server side web socket processing for WEBSOCKETPOLLING component.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort long polling thread.voidAbort long polling thread with error.voidDeprecated.voidbooleangetId()longPoint 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.voidSame aswakeupForReconnect().voidnotifyActionForWakeup(long longPollingWakeupStamp) Notification that an action was executed which was caused by this instance.protected voidvoidregisterEndPoint(WebSocketPollingEndPoint endPoint) Function is called when client opens up a websocket connection.voidSend a wake-up signal to the client if there is a wake-up call which is not yet mirrored by corresponding action processing.protected voidsendMessageToClient(String textMessage) General purpose function to send some text content to the client.voidunregisterEndPoint(WebSocketPollingEndPoint endPoint) voidwakeup(boolean continuePolling) Send a trigger to the client side so that the WEBSOCKETPOLLING component activates its actionListener processing.voidIn 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:
getIdin interfaceILongPolling
-
getContinuePolling
public boolean getContinuePolling()- Specified by:
getContinuePollingin 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:
getURLin 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:
wakeupin 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:
wakeupForReconnectin interfaceILongPolling
-
sendMessageToClient
General purpose function to send some text content to the client. -
abortThreadWithouContinuingPolling
Deprecated.Description copied from interface:ILongPollingAbort long polling thread - and tell the client that it should not continue to create new poll requests.- Specified by:
abortThreadWithouContinuingPollingin interfaceILongPolling
-
abortThreadWithoutContinuingPolling
public void abortThreadWithoutContinuingPolling() -
abortThread
public void abortThread()Description copied from interface:ILongPollingAbort long polling thread.- Specified by:
abortThreadin interfaceILongPolling
-
abortThreadWithErrorIfWaiting
public void abortThreadWithErrorIfWaiting()Description copied from interface:ILongPollingAbort long polling thread with error.- Specified by:
abortThreadWithErrorIfWaitingin interfaceILongPolling
-
getLongPollingResponse
-
keepAlive
public void keepAlive()Same aswakeupForReconnect().- Specified by:
keepAlivein interfaceILongPolling
-
getLastResponseTime
public long getLastResponseTime()Description copied from interface:ILongPollingPoint of time when a response activity (e.g. wakeup, wakeupForReconnect, ...) was executed.- Specified by:
getLastResponseTimein 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.
-