Class CmsThreadStore

java.lang.Object
java.lang.Thread
org.opencms.main.CmsThreadStore
All Implemented Interfaces:
Runnable

public final class CmsThreadStore extends Thread
The OpenCms "Grim Reaper" thread store were all system Threads are maintained.

This thread executes all 60 seconds and checks if report threads are still active. A report thread usually waits for a user to get the contents written to the report. However, if the user does not request the reports content (e.g. because the browser was closed), then the report thread becomes abandoned. This Grim Reaper will collect all such abandoned report threads and remove them after further 60 seconds.

Moreover, the Grim Reaper checks for all invalid user sessions that have times out for 5 or more minutes, and removes them as well.

Since:
6.0.0
  • Constructor Details

    • CmsThreadStore

      protected CmsThreadStore(CmsSecurityManager securityManager)
      Hides the public constructor.

      Parameters:
      securityManager - needed for scheduling "undercover-jobs" that increase stability and fault tolerance
  • Method Details

    • addThread

      public void addThread(A_CmsReportThread thread)
      Adds a Thread to this Thread store.

      Parameters:
      thread - the Thread to add
    • retrieveThread

      Retrieves a Thread from this Thread store.

      Parameters:
      key - the key of the Thread to retrieve
      Returns:
      the Thread form this Thread store that matches the given key
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
      See Also:
    • checkPublishQueue

      protected void checkPublishQueue()
      Checks the publish queue for abandoned publish jobs.

    • handleDoomedThreads

      protected void handleDoomedThreads()
      Handles doomed threads.

    • persistData

      protected void persistData()
      Takes care of the persistence of data normally held in memory.

    • shutDown

      protected void shutDown()
      Shut down this thread store.

    • validateSessions

      protected void validateSessions()
      Checks for invalid sessions.