Package jetbrains.buildServer.util
Class Alarm
- java.lang.Object
-
- jetbrains.buildServer.util.Alarm
-
- All Implemented Interfaces:
Disposable
public class Alarm extends Object implements Disposable
Utility class used to execute periodical tasks
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable
Disposable.Parent
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRepeatableRequest(Runnable toRun, long delay, long repeatDelay)
Adds repeatable request to the alarmvoid
addRequest(Runnable toRun, long delay, boolean repeatable)
Adds request to the alarmvoid
cancelAllRequests()
Cancels all requests added to this alarmvoid
cancelRequest(Runnable request)
Cancels specific request added to the alarmvoid
dispose()
Disposes this alarmboolean
hasRequests()
Returns true if there are requests added to the alarm
-
-
-
Constructor Detail
-
Alarm
public Alarm(@NotNull String name)
-
-
Method Detail
-
dispose
public void dispose()
Disposes this alarm- Specified by:
dispose
in interfaceDisposable
-
addRepeatableRequest
public void addRepeatableRequest(Runnable toRun, long delay, long repeatDelay)
Adds repeatable request to the alarm- Parameters:
toRun
- runnable to executedelay
- delay before the first start of the runnable (millis)repeatDelay
- repeat delay (millis)
-
addRequest
public void addRequest(Runnable toRun, long delay, boolean repeatable)
Adds request to the alarm- Parameters:
toRun
- runnable to executedelay
- delay before the first start of the runnable (millis)repeatable
- if true then request will be repeatable, same as: addRepeatableRequest(toRun, delay, delay)
-
cancelAllRequests
public void cancelAllRequests()
Cancels all requests added to this alarm
-
cancelRequest
public void cancelRequest(Runnable request)
Cancels specific request added to the alarm- Parameters:
request
- runnable
-
hasRequests
public boolean hasRequests()
Returns true if there are requests added to the alarm- Returns:
- see above
-
-