Class WarrantShutdownTask

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.lang.Runnable, java.util.concurrent.Callable<java.lang.Boolean>, java.util.EventListener, ShutDownTask

    public class WarrantShutdownTask
    extends AbstractShutDownTask
    Allows user to decide if (and which) SpeedProfiles to write to the Roster at the end of a session. Locos running warrants have had their speeds measured and this new data may or may not be merged into any existing SpeedProfiles in the Roster.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Map<java.lang.String,​java.util.Map<java.lang.Integer,​java.lang.Boolean>> _anomalies  
      (package private) java.util.HashMap<java.lang.String,​java.lang.Boolean> _mergeCandidates  
      (package private) java.util.HashMap<java.lang.String,​RosterSpeedProfile> _mergeProfiles  
    • Constructor Summary

      Constructors 
      Constructor Description
      WarrantShutdownTask​(java.lang.String name)
      Constructor specifies the warning message and action to take
    • Constructor Detail

      • WarrantShutdownTask

        public WarrantShutdownTask​(java.lang.String name)
        Constructor specifies the warning message and action to take
        Parameters:
        name - the name of the task (used in logs)
    • Method Detail

      • call

        public java.lang.Boolean call()
        Ask if shut down is allowed.

        The shut down manager calls this method first on all the tasks before starting to execute the method ShutDownTask.run() on the tasks.

        If this method returns false on any task, the shut down process must be aborted. This implementation merely sets the "doRun" property to true, and should be overridden for any real checking. Note that overriding implementations should call AbstractShutDownTask.setDoRun(boolean) correctly.

        Specified by:
        call in interface java.util.concurrent.Callable<java.lang.Boolean>
        Specified by:
        call in interface ShutDownTask
        Overrides:
        call in class AbstractShutDownTask
        Returns:
        true if it is OK to shut down, false to abort shut down.
      • run

        public void run()
        Take the necessary action. This method cannot abort the shutdown, and must not require user interaction to complete successfully. This method will be run in parallel to other ShutDownTasks.