Package org.eclnt.jsfserver.polling
Class DefaultLongPolling
java.lang.Object
org.eclnt.jsfserver.polling.DefaultLongPolling
- All Implemented Interfaces:
Serializable,ILongPolling
- Direct Known Subclasses:
UNIFIEDPOLLINGBinding.MyLongPolling
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort long polling thread.voidAbort long polling thread with error.voidDeprecated.voidbooleanIf true then after this response a new request from the client will be created immediately - i.e. the next polling is started immediately.getId()Returns the id under which the buffered content is registered.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.voidWrites some chunk content into the connection so that the connection is not timed out.booleanwaitForEvent(jakarta.servlet.http.HttpServletResponse response) voidwakeup(boolean continuePolling) When an event is triggered then the wakeup method is to be called.voidCalling this method will trigger the long polling to pass back a reconnect-signal to the client side.
-
Constructor Details
-
DefaultLongPolling
public DefaultLongPolling()
-
-
Method Details
-
getId
Returns the id under which the buffered content is registered.- Specified by:
getIdin interfaceILongPolling
-
getContinuePolling
public boolean getContinuePolling()If true then after this response a new request from the client will be created immediately - i.e. the next polling is started immediately.- Specified by:
getContinuePollingin interfaceILongPolling
-
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
-
waitForEvent
public boolean waitForEvent(jakarta.servlet.http.HttpServletResponse response) -
wakeup
public void wakeup(boolean continuePolling) Description copied from interface:ILongPollingWhen an event is triggered then the wakeup method is to be called. This will send the response to the client side. This is the method to be called by your application in order to trigger the response.- Specified by:
wakeupin interfaceILongPolling
-
wakeupForReconnect
public void wakeupForReconnect()Description copied from interface:ILongPollingCalling this method will trigger the long polling to pass back a reconnect-signal to the client side. On client side the long polling will rebuild a new connection to the server side and continue the long polling.- Specified by:
wakeupForReconnectin interfaceILongPolling
-
abortThreadWithouContinuingPolling
Deprecated.Please use the method with correct spelling:abortThreadWithoutContinuingPolling().- 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()Description copied from interface:ILongPollingWrites some chunk content into the connection so that the connection is not timed out.- 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
-