Package jmri
Interface ShutDownTask
- All Superinterfaces:
Callable<Boolean>,EventListener,PropertyChangeListener,Runnable
- All Known Implementing Classes:
AbstractShutDownTask,CbusEventTableShutdownTask,DispatcherShutDownTask,SwingShutDownTask,WarrantShutdownTask
Execute a specific task before the program terminates.
Tasks should leave the system in a state that can continue, in case a later task aborts the shutdown.
A ShutDownTask can listen to the "shuttingDown" property of the
ShutDownManager to determine if any other ShutDownTask aborted the
shutdown; the property will change from false to true in that case.
-
Method Summary
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
-
Method Details
-
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
run()on the tasks.If this method returns false on any task, the shut down process must be aborted.
-
runEarly
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, but will be executed before any of therun()methods are executed. -
run
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. -
getName
Name to be provided to the user when information about this task is presented.- Returns:
- the name
-