Class OperationsManager

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ShutDownTask getDefaultShutDownTask()
      Get a copy of the default operations ShutDownTask.
      java.io.File getFile​(java.lang.String name)
      Get a File rooted in the Operations path.
      java.lang.String getPath()
      Get the path to the Operations folder, rooted in the User's file path, as a String.
      java.lang.String getPath​(java.lang.String name)
      Get the path to a file rooted in the Operations path.
      void initialize()
      Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.
      void setShutDownTask​(ShutDownTask shutDownTask)
      Register the non-default ShutDownTask.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Get the path to the Operations folder, rooted in the User's file path, as a String.
        Returns:
        A path
      • getPath

        public java.lang.String getPath​(java.lang.String name)
        Get the path to a file rooted in the Operations path.
        Parameters:
        name - The name of the file
        Returns:
        A path
        See Also:
        getPath()
      • getFile

        public java.io.File getFile​(java.lang.String name)
        Get a File rooted in the Operations path.
        Parameters:
        name - The name of the file
        Returns:
        A file
        See Also:
        getPath()
      • setShutDownTask

        public void setShutDownTask​(ShutDownTask shutDownTask)
        Register the non-default ShutDownTask.

        Replaces the existing operations ShutDownTask with the new task. Use a null value to prevent an operations ShutDownTask from being run when JMRI shuts down. Use getDefaultShutDownTask() to use the default operations ShutDownTask.

        Parameters:
        shutDownTask - The new ShutDownTask or null
      • getDefaultShutDownTask

        public static ShutDownTask getDefaultShutDownTask()
        Get a copy of the default operations ShutDownTask. The default ShutDownTask saves the operations state at shutdown without prompting.
        Returns:
        A new ShutDownTask