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 TypeMethodDescriptionvoid
Abort long polling thread.void
Abort long polling thread with error.void
Deprecated.void
boolean
If 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.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
Writes some chunk content into the connection so that the connection is not timed out.boolean
waitForEvent
(javax.servlet.http.HttpServletResponse response) void
wakeup
(boolean continuePolling) When an event is triggered then the wakeup method is to be called.void
Calling 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:
getId
in 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:
getContinuePolling
in 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:
getURL
in interfaceILongPolling
-
waitForEvent
public boolean waitForEvent(javax.servlet.http.HttpServletResponse response) -
wakeup
public void wakeup(boolean continuePolling) Description copied from interface:ILongPolling
When 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:
wakeup
in interfaceILongPolling
-
wakeupForReconnect
public void wakeupForReconnect()Description copied from interface:ILongPolling
Calling 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:
wakeupForReconnect
in interfaceILongPolling
-
abortThreadWithouContinuingPolling
Deprecated.Please use the method with correct spelling:abortThreadWithoutContinuingPolling()
.- 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()Description copied from interface:ILongPolling
Writes some chunk content into the connection so that the connection is not timed out.- 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
-