public abstract class InterruptingScheduledService
extends com.google.common.util.concurrent.AbstractIdleService
runOneIteration() on a ScheduledExecutorService (see schedule(java.lang.Runnable, java.util.concurrent.ScheduledExecutorService))
to do periodic operations.
This class is similar to AbstractScheduledService
except that this class's shutDown() method will interrupt the thread running the
periodic operation.
| Constructor and Description |
|---|
InterruptingScheduledService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beforeIteration()
A hook for subclasses to insert extra steps before
runOneIteration(). |
protected abstract void |
runOneIteration() |
protected abstract ScheduledFuture<?> |
schedule(Runnable runnable,
ScheduledExecutorService executorService) |
protected void |
shutDown() |
protected void |
startUp() |
protected void beforeIteration()
throws InterruptedException
runOneIteration().InterruptedExceptionprotected abstract void runOneIteration()
throws InterruptedException
InterruptedExceptionprotected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionprotected abstract ScheduledFuture<?> schedule(Runnable runnable, ScheduledExecutorService executorService)
Copyright © 2017. All rights reserved.