Class AbstractIdleService.DelegateService
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- com.google.common.util.concurrent.AbstractIdleService.DelegateService
-
- All Implemented Interfaces:
Service
- Enclosing class:
- AbstractIdleService
private final class AbstractIdleService.DelegateService extends AbstractService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
Service.Listener, Service.State
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DelegateService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
This method is called byAbstractService.startAsync()
to initiate service startup.protected void
doStop()
This method should be used to initiate service shutdown.java.lang.String
toString()
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.util.concurrent.Service
awaitRunning, awaitTerminated
-
-
-
-
Method Detail
-
doStart
protected final void doStart()
Description copied from class:AbstractService
This method is called byAbstractService.startAsync()
to initiate service startup. The invocation of this method should cause a call toAbstractService.notifyStarted()
, either during this method's run, or after it has returned. If startup fails, the invocation should cause a call toAbstractService.notifyFailed(Throwable)
instead.This method should return promptly; prefer to do work on a different thread where it is convenient. It is invoked exactly once on service startup, even when
AbstractService.startAsync()
is called multiple times.- Specified by:
doStart
in classAbstractService
-
doStop
protected final void doStop()
Description copied from class:AbstractService
This method should be used to initiate service shutdown. The invocation of this method should cause a call toAbstractService.notifyStopped()
, either during this method's run, or after it has returned. If shutdown fails, the invocation should cause a call toAbstractService.notifyFailed(Throwable)
instead.This method should return promptly; prefer to do work on a different thread where it is convenient. It is invoked exactly once on service shutdown, even when
AbstractService.stopAsync()
is called multiple times.If
AbstractService.stopAsync()
is called on aService.State.STARTING
service, this method is not invoked immediately. Instead, it will be deferred until after the service isService.State.RUNNING
. Services that need to cancel startup work can override {#link #doCancelStart}.- Specified by:
doStop
in classAbstractService
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractService
-
-