Example usage for Java com.google.common.util.concurrent Service fields, constructors, methods, implement or subclass
The text is from its open source code.
void | addListener(Listener listener, Executor executor) Registers a Listener to be Executor#execute executed on the given executor. |
void | awaitRunning() Waits for the Service to reach the State#RUNNING running state . |
void | awaitRunning(long timeout, TimeUnit unit) Waits for the Service to reach the State#RUNNING running state for no more than the given time. |
void | awaitTerminated() Waits for the Service to reach the State#TERMINATED terminated state . |
void | awaitTerminated(long timeout, TimeUnit unit) Waits for the Service to reach a terminal state (either Service.State#TERMINATED terminated or Service.State#FAILED failed ) for no more than the given time. |
Throwable | failureCause() Returns the Throwable that caused this service to fail. |
Class> | getClass() Returns the runtime class of this Object . |
boolean | isRunning() Returns true if this service is State#RUNNING running . |
Service | startAsync() If the service state is State#NEW , this initiates service startup and returns immediately. |
State | state() Returns the lifecycle state of the service. |
Service | stopAsync() If the service is State#STARTING starting or State#RUNNING running , this initiates service shutdown and returns immediately. |
String | toString() Returns a string representation of the object. |