Class CmsProgressThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class CmsProgressThread
    extends org.opencms.workplace.threads.A_CmsProgressThread
    This class is used to build a list (A_CmsListDialog) in the background and to show the progress of building to the user.

    To work correctly the operations while building the list have to update the actual progress.

    Since:
    7.0.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsProgressThread​(A_CmsListDialog list, java.lang.String key, java.util.Locale locale)
      Constructs a new progress thread with the given name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      Returns the description to show for the progress.
      java.lang.Throwable getError()
      Returns the error exception in case there was an error during the execution of this thread, null otherwise.
      long getFinishTime()
      Returns the time the thread was finished.
      java.lang.String getKey()
      Returns the key of this thread.
      A_CmsListDialog getList()
      Returns the list of the progress bar.
      java.util.Locale getLocale()
      Returns the locale to use for this thread.
      int getProgress()
      Returns the progress.
      java.lang.String getResult()
      Returns the finished result as HTML of the list.
      long getRuntime()
      Returns the time this report has been running.
      long getStartTime()
      Returns the time the thread has started.
      void run()  
      void setDescription​(java.lang.String description)
      Sets the description to show for the progress.
      void setLocale​(java.util.Locale locale)
      Sets the locale to use for this thread.
      void setProgress​(int progress)
      Sets the progress.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CmsProgressThread

        public CmsProgressThread​(A_CmsListDialog list,
                                 java.lang.String key,
                                 java.util.Locale locale)
        Constructs a new progress thread with the given name.

        Parameters:
        list - the list to use for the progress to display
        key - the key of the thread
        locale - the locale to use for this thread
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Returns the description to show for the progress.

        Returns:
        the description to show for the progress
      • getError

        public java.lang.Throwable getError()
        Returns the error exception in case there was an error during the execution of this thread, null otherwise.

        Returns:
        the error exception in case there was an error, null otherwise
      • getFinishTime

        public long getFinishTime()
        Returns the time the thread was finished.

        Returns:
        the time the thread was finished
      • getKey

        public java.lang.String getKey()
        Returns the key of this thread.

        Returns:
        the key of this thread
      • getList

        public A_CmsListDialog getList()
        Returns the list of the progress bar.

        Returns:
        the list of the progress bar
      • getLocale

        public java.util.Locale getLocale()
        Returns the locale to use for this thread.

        Returns:
        the locale to use for this thread
      • getProgress

        public int getProgress()
        Returns the progress.

        Returns:
        the progress
      • getResult

        public java.lang.String getResult()
        Returns the finished result as HTML of the list.

        Returns:
        the finished result as HTML of the list
      • getRuntime

        public long getRuntime()
        Returns the time this report has been running.

        Returns:
        the time this report has been running
      • getStartTime

        public long getStartTime()
        Returns the time the thread has started.

        Returns:
        the time the thread has started
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
        See Also:
        Thread.run()
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description to show for the progress.

        Specified by:
        setDescription in class org.opencms.workplace.threads.A_CmsProgressThread
        Parameters:
        description - the description to show for the progress to set
      • setLocale

        public void setLocale​(java.util.Locale locale)
        Sets the locale to use for this thread.

        Parameters:
        locale - the locale to use for this thread to set
      • setProgress

        public void setProgress​(int progress)
        Sets the progress.

        Specified by:
        setProgress in class org.opencms.workplace.threads.A_CmsProgressThread
        Parameters:
        progress - the progress to set