Lines Matching refs:State

22 import com.google.common.util.concurrent.Service.State; // javadoc needs this
51 private State state = State.NEW;
85 public final ListenableFuture<State> start() {
88 if (state == State.NEW) {
89 state = State.STARTING;
103 public final ListenableFuture<State> stop() {
106 if (state == State.NEW) {
107 state = State.TERMINATED;
108 startup.set(State.TERMINATED);
109 shutdown.set(State.TERMINATED);
110 } else if (state == State.STARTING) {
112 startup.set(State.STOPPING);
113 } else if (state == State.RUNNING) {
114 state = State.STOPPING;
128 public State startAndWait() {
133 public State stopAndWait() {
140 * State#STARTING} to {@link State#RUNNING}.
143 * {@link State#STARTING}.
148 if (state != State.STARTING) {
155 state = State.RUNNING;
159 startup.set(State.RUNNING);
169 * State#STOPPING} to {@link State#TERMINATED}.
172 * State#STOPPING} nor {@link State#RUNNING}.
177 if (state != State.STOPPING && state != State.RUNNING) {
184 state = State.TERMINATED;
185 shutdown.set(State.TERMINATED);
193 * {@link State#FAILED}. The service will <b>not be stopped</b> if it
202 if (state == State.STARTING) {
206 } else if (state == State.STOPPING) {
208 } else if (state == State.RUNNING) {
210 } else if (state == State.NEW || state == State.TERMINATED) {
213 state = State.FAILED;
221 return state() == State.RUNNING;
225 public final State state() {
228 if (shutdownWhenStartupFinishes && state == State.STARTING) {
229 return State.STOPPING;
245 private class Transition extends AbstractFuture<State> {
247 public State get(long timeout, TimeUnit unit)