Package jmri.jmrit.operations
Class OperationsManager
- java.lang.Object
-
- jmri.jmrit.operations.OperationsManager
-
- All Implemented Interfaces:
InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public final class OperationsManager extends java.lang.Object implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
A manager for Operations. This manager controls the Operations ShutDownTask.
-
-
Constructor Summary
Constructors Constructor Description OperationsManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShutDownTaskgetDefaultShutDownTask()Get a copy of the default operationsShutDownTask.java.io.FilegetFile(java.lang.String name)Get aFilerooted in the Operations path.java.lang.StringgetPath()Get the path to the Operations folder, rooted in the User's file path, as a String.java.lang.StringgetPath(java.lang.String name)Get the path to a file rooted in the Operations path.voidinitialize()Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidsetShutDownTask(ShutDownTask shutDownTask)Register the non-defaultShutDownTask.
-
-
-
Constructor Detail
-
OperationsManager
public OperationsManager()
-
-
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 aFilerooted 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-defaultShutDownTask.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 operationsShutDownTask. The default ShutDownTask saves the operations state at shutdown without prompting.- Returns:
- A new ShutDownTask
-
initialize
public void initialize()
Description copied from interface:InstanceManagerAutoInitializePerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.- Specified by:
initializein interfaceInstanceManagerAutoInitialize
-
-