Module com.gluonhq.attach.lifecycle
Class DesktopLifecycleService
java.lang.Object
com.gluonhq.attach.lifecycle.impl.DesktopLifecycleService
- All Implemented Interfaces:
LifecycleService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(LifecycleEvent lifecycleEvent, Runnable eventHandler) Adds a life cycle event listener to the native platform, to be notified ofLifecycleEvent
events.void
removeListener
(LifecycleEvent lifecycleEvent, Runnable eventHandler) Removes a previously installed event handler.void
shutdown()
Initiates the process of shutting down the application that called this method.
-
Constructor Details
-
DesktopLifecycleService
public DesktopLifecycleService()
-
-
Method Details
-
shutdown
public void shutdown()Description copied from interface:LifecycleService
Initiates the process of shutting down the application that called this method. This removes the need to perform any platform-specific shutdown routines.- Specified by:
shutdown
in interfaceLifecycleService
-
addListener
Description copied from interface:LifecycleService
Adds a life cycle event listener to the native platform, to be notified ofLifecycleEvent
events.- Specified by:
addListener
in interfaceLifecycleService
- Parameters:
lifecycleEvent
- The type of event to listen for.eventHandler
- The event handler that will be called when the event fires.
-
removeListener
Description copied from interface:LifecycleService
Removes a previously installed event handler. If no such event handler is found, this method is a no-op.- Specified by:
removeListener
in interfaceLifecycleService
- Parameters:
lifecycleEvent
- The type of event that was being listened to.eventHandler
- The event handler that should be removed.
-