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 theAutoRestartingServiceshould 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 voidnotifyRestart()Policy might want to keep track of when the latest restarts have happened.longrestartDelay()When the service should restart, in nanoseconds from the point when the service failed.
-
-
-
Method Detail
-
notifyRestart
public void notifyRestart()
Description copied from interface:ServiceRestartPolicyPolicy might want to keep track of when the latest restarts have happened.- Specified by:
notifyRestartin interfaceServiceRestartPolicy
-
restartDelay
public long restartDelay()
Description copied from interface:ServiceRestartPolicyWhen 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:
restartDelayin interfaceServiceRestartPolicy
-
-