/**
  * runs the tasks needed to start, wrapped by setting {@link Attributes#SERVICE_STATE_EXPECTED}
  * appropriately
  */
 public void start(Collection<? extends Location> locations) {
   ServiceStateLogic.setExpectedState(entity(), Lifecycle.STARTING);
   try {
     startInLocations(locations);
     DynamicTasks.waitForLast();
     ServiceStateLogic.setExpectedState(entity(), Lifecycle.RUNNING);
   } catch (Throwable t) {
     ServiceStateLogic.setExpectedState(entity(), Lifecycle.ON_FIRE);
     throw Exceptions.propagate(t);
   }
 }