Package io.goobi.viewer.managedbeans
Class SocketBean
java.lang.Object
io.goobi.viewer.managedbeans.SocketBean
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 Summary
ConstructorsConstructorDescriptionDefault constructor.SocketBean(long minIdleSeconds) SocketBean(long minIdleSeconds, org.omnifaces.cdi.PushContext backgroundTasksState) Creates a new tests with custom PushContext instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidSends an "update" message to the socket channel.static voidShuts down the scheduler.
-
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 ticksbackgroundTasksState- push context used to send messages to connected clients
-
-
Method Details
-
send
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
-