Package edu.wpi.grip.core.util.service
Interface RestartableService
-
- All Superinterfaces:
com.google.common.util.concurrent.Service
- All Known Implementing Classes:
AutoRestartingService,CameraSource,PipelineRunner
public interface RestartableService extends com.google.common.util.concurrent.ServiceThis interface defines aServicethat breaks the guarantee that theService.State.FAILEDandService.State.TERMINATEDstates are terminal states. Instead, as long as the service is in a non running state the service can be started.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.ImmutableSet<com.google.common.util.concurrent.Service.State>VALID_START_STATES
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestartableServicestartAsync()If the service state isService.State.NEW,Service.State.FAILED,Service.State.TERMINATEDthis initiates service startup and returns immediately.voidstopAndAwait()voidstopAndAwait(long timeout, java.util.concurrent.TimeUnit unit)RestartableServicestopAsync()Stops the service.
-
-
-
Method Detail
-
startAsync
RestartableService startAsync()
If the service state isService.State.NEW,Service.State.FAILED,Service.State.TERMINATEDthis initiates service startup and returns immediately.- Specified by:
startAsyncin interfacecom.google.common.util.concurrent.Service- Returns:
- this
- Throws:
java.lang.IllegalStateException- if the service is not in one ofVALID_START_STATES
-
stopAsync
RestartableService stopAsync()
Stops the service.- Specified by:
stopAsyncin interfacecom.google.common.util.concurrent.Service- Returns:
- this
-
stopAndAwait
void stopAndAwait()
-
stopAndAwait
void stopAndAwait(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException- Throws:
java.util.concurrent.TimeoutException
-
-