Package edu.wpi.grip.core.util.service
Class CooldownRestartPolicy
- java.lang.Object
-
- edu.wpi.grip.core.util.service.CooldownRestartPolicy
-
- All Implemented Interfaces:
ServiceRestartPolicy
public class CooldownRestartPolicy extends java.lang.Object implements ServiceRestartPolicy
Allows you to define a cooldown between failures. Defines whether or not theAutoRestartingService
should restart or not.- See Also:
- Original version
-
-
Field Summary
-
Fields inherited from interface edu.wpi.grip.core.util.service.ServiceRestartPolicy
IMMEDIATE
-
-
Constructor Summary
Constructors Constructor Description CooldownRestartPolicy()
CooldownRestartPolicy(long interval, java.util.concurrent.TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
notifyRestart()
Policy might want to keep track of when the latest restarts have happened.long
restartDelay()
When the service should restart, in nanoseconds from the point when the service failed.
-
-
-
Method Detail
-
notifyRestart
public void notifyRestart()
Description copied from interface:ServiceRestartPolicy
Policy might want to keep track of when the latest restarts have happened.- Specified by:
notifyRestart
in interfaceServiceRestartPolicy
-
restartDelay
public long restartDelay()
Description copied from interface:ServiceRestartPolicy
When the service should restart, in nanoseconds from the point when the service failed. A value less than or equal to zero means an immediate restart.- Specified by:
restartDelay
in interfaceServiceRestartPolicy
-
-