Class Task

    • Constructor Detail

      • Task

        public Task​(String name)
    • Method Detail

      • getName

        public String getName()
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • interrupt

        public void interrupt()
      • isInterrupted

        public boolean isInterrupted()
      • getSize

        public long getSize()
        The the total size of the processing(number of units of work)
        Returns:
        total number of steps
      • setSize

        public void setSize​(long size)
      • getProgress

        public long getProgress()
        The current processing step
        Returns:
        the current step
      • getCompletionPercentage

        public int getCompletionPercentage()
        The percentage of completion(1-100)
        Returns:
        a percentage(1-100)
      • isRunning

        public boolean isRunning()
        Check if the task is currently running
        Returns:
        true if the task is running(STATUS_RUNNING)
      • saveWork

        public void saveWork()
        Concrete implementations must insert here the code needed to save the elaboration state in a persistent storage
      • getScheduling

        public TaskScheduling getScheduling()
        Scheduling policies
        Returns:
        the scheduling policies
      • addTaskListener

        public void addTaskListener​(TaskListener listener)
      • removeTaskListener

        public void removeTaskListener​(TaskListener listener)
      • notifyReport

        public void notifyReport()
      • isIndeterminate

        public abstract boolean isIndeterminate()
        Concrete implementations must override this method declaring if the task is indeterminate. An indeterminate task is not able to compute it's time length
        Returns:
        true if the task is indeterminate
      • isConcurrent

        public abstract boolean isConcurrent()
        Concrete implementations must override this method declaring if the task supports multiple instances running concurrently.
        Returns:
        true if the task is concurrent
      • getReportRecipients

        public String getReportRecipients()
      • setSender

        public void setSender​(EMailSender sender)
      • setUserDao

        public void setUserDao​(UserDAO userDao)
      • isSendActivityReport

        public boolean isSendActivityReport()
      • setSendActivityReport

        public void setSendActivityReport​(boolean sendActivityReport)
      • setReportRecipients

        public void setReportRecipients​(String reportRecipients)
      • setLockManager

        public void setLockManager​(LockManager lockManager)
      • setSystemLoadMonitor

        public void setSystemLoadMonitor​(SystemLoadMonitor systemLoadMonitor)
      • isInterruptRequested

        public boolean isInterruptRequested()