public interface ApplicationShutdownListener extends EventListener
Definition of an interface for listeners that want to be notified when the application terminates.
Objects implementing this interface can register itself at the global
Application
object. They will then receive a notification before this
application terminates. So it is possible to perform some clean up before the
final shutdown.
A shutdown listeners has also the opportunity of canceling the shutdown process. An example would be an application that shows a message box asking whether the user really wants to exit. If the user here enters "No", the shutdown must be aborted.
Modifier and Type | Method and Description |
---|---|
boolean |
canShutdown(Application app)
Checks if a shutdown is possible.
|
void |
shutdown(Application app)
Notifies this listener that the associated application terminates now.
|
boolean canShutdown(Application app)
app
- the associated applicationvoid shutdown(Application app)
canShutdown()
was successful, i.e. none of the listeners
canceled the process. An implementation could e.g. ensure that all
changes have been saved or perform clean up.app
- the associated applicationCopyright © 2016 The JGUIraffe Team. All rights reserved.