Class DefaultLongPollingWebSocket

java.lang.Object
org.eclnt.jsfserver.polling.websocket.DefaultLongPollingWebSocket
All Implemented Interfaces:
ILongPolling
Direct Known Subclasses:
BlockerInfo.BlockerInfoWebSocketPolling

public class DefaultLongPollingWebSocket extends Object implements ILongPolling
Server side web socket processing for WEBSOCKETPOLLING component.
  • Constructor Details

    • DefaultLongPollingWebSocket

      public DefaultLongPollingWebSocket()
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface ILongPolling
    • getContinuePolling

      public boolean getContinuePolling()
      Specified by:
      getContinuePolling in interface ILongPolling
    • registerEndPoint

      public void registerEndPoint(WebSocketPollingEndPoint endPoint)
      Function is called when client opens up a websocket connection.
    • unregisterEndPoint

      public void unregisterEndPoint(WebSocketPollingEndPoint endPoint)
    • 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
    • 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 interface ILongPolling
      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 interface ILongPolling
    • sendMessageToClient

      protected void sendMessageToClient(String textMessage)
      General purpose function to send some text content to the client.
    • abortThreadWithouContinuingPolling

      @Deprecated public void 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 interface ILongPolling
    • abortThreadWithoutContinuingPolling

      public void abortThreadWithoutContinuingPolling()
    • 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()
      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
    • 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.