Home | History | Annotate | Download | only in service

Lines Matching defs:state

43    * Represents the state of this composite service. Will equal FAILED even if only one component
47 private volatile Service.State compositeState;
82 public Future<State> start() {
83 final List<Future<State>> tasks = Lists.newArrayList();
88 return futureGet(tasks, State.STARTED);
92 public Future<State> stop() {
93 final List<Future<State>> tasks = Lists.newArrayList();
98 return futureGet(tasks, State.STOPPED);
102 public State state() {
108 private FutureTask<Service.State> futureGet(
109 final List<Future<Service.State>> tasks, final Service.State state) {
110 return new FutureTask<Service.State>(
111 new Callable<Service.State>() {
113 public Service.State call() {
115 for (Future<Service.State> task : tasks) {
117 ok = state == task.get();
119 return compositeState = Service.State.FAILED;
121 return compositeState = Service.State.FAILED;
125 return compositeState = ok ? state : Service.State.FAILED;