Class SocketBean

java.lang.Object
io.goobi.viewer.managedbeans.SocketBean

@Named @ApplicationScoped public class SocketBean extends Object
Application scoped bean which handles socket updates for indexer and background tasks status. Only notifies the socket chanell at most every 2 seconds to avoid concurrent subsequent ajax request
  • Constructor Details

    • SocketBean

      public SocketBean()
      Default constructor. Instantiates a fixed schedule thread
    • SocketBean

      public SocketBean(long minIdleSeconds)
    • SocketBean

      public SocketBean(long minIdleSeconds, org.omnifaces.cdi.PushContext backgroundTasksState)
      Creates a new tests with custom PushContext instance.
      Parameters:
      minIdleSeconds - minimum idle interval in seconds between scheduler ticks
      backgroundTasksState - push context used to send messages to connected clients
  • Method Details

    • send

      public void send(String message)
      Sends an "update" message to the socket channel.
      Parameters:
      message - message text to send (currently unused; triggers an "update" push)
    • shutdownExecutor

      public static void shutdownExecutor()
      Shuts down the scheduler. Should be called from the servlet context listener on undeploy to ensure the thread terminates before Tomcat checks for lingering threads.
    • close

      @PreDestroy public void close()