Package ome.services.util
Class SleepTimer
- java.lang.Object
-
- ome.services.util.SleepTimer
-
public class SleepTimer extends java.lang.Object
Provides a timer for having a thread sleep that prematurely awakens when the server is to shut down, so the sleeping does not keep the server running.- Since:
- 5.0.3
-
-
Constructor Summary
Constructors Constructor Description SleepTimer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
This method is called by Spring during server shut-down.static boolean
sleepFor(long milliseconds)
Sleep for the given number of milliseconds.
-
-
-
Method Detail
-
sleepFor
public static boolean sleepFor(long milliseconds)
Sleep for the given number of milliseconds. Returns early if the server is shutting down. Do not use in methods that block bean destruction.- Parameters:
milliseconds
- for how long to sleep if the server remains running- Returns:
- if the sleep was terminated prematurely
-
destroy
public void destroy()
This method is called by Spring during server shut-down.
-
-