Class DefaultLongPolling

java.lang.Object
org.eclnt.jsfserver.polling.DefaultLongPolling
All Implemented Interfaces:
Serializable, ILongPolling

public class DefaultLongPolling extends Object implements ILongPolling, Serializable
See Also:
  • Constructor Details

    • DefaultLongPolling

      public DefaultLongPolling()
  • Method Details

    • getId

      public String getId()
      Returns the id under which the buffered content is registered.
      Specified by:
      getId in interface ILongPolling
    • 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 interface ILongPolling
    • getURL

      public String 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 interface ILongPolling
    • 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 interface ILongPolling
    • 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 interface ILongPolling
    • abortThreadWithouContinuingPolling

      public void abortThreadWithouContinuingPolling()
      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 interface ILongPolling
    • abortThread

      public void abortThread()
      Description copied from interface: ILongPolling
      Abort long polling thread.
      Specified by:
      abortThread in interface ILongPolling
    • abortThreadWithErrorIfWaiting

      public void abortThreadWithErrorIfWaiting()
      Description copied from interface: ILongPolling
      Abort long polling thread with error.
      Specified by:
      abortThreadWithErrorIfWaiting in interface ILongPolling
    • getLongPollingResponse

      public String 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 interface ILongPolling
    • 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 interface ILongPolling