Package org.sosy_lab.common
Interface ShutdownNotifier.ShutdownRequestListener
-
- Enclosing class:
- ShutdownNotifier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface ShutdownNotifier.ShutdownRequestListener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
shutdownRequested(String reason)
This method is called on registered listeners the first timeShutdownManager.requestShutdown(String)
on the associatedShutdownManager
instance is called.
-
-
-
Method Detail
-
shutdownRequested
void shutdownRequested(String reason)
This method is called on registered listeners the first timeShutdownManager.requestShutdown(String)
on the associatedShutdownManager
instance is called.Implementations of this method should be reasonably quick and never throw an exception.
Note that it is usually not necessary to use a listener when all you want to do in this method is to set some boolean flag. Instead, just call
ShutdownNotifier.shouldShutdown()
whenever you would check the flag (this is similarly cheap and thread-safe).- Parameters:
reason
- A non-null human-readable string that tells the user why a shutdown was requested.
-
-