/**
* Stops a list of services
*/
public void stopServices(List<Service> services) throws Exception {
RunnableCountDownLatch latch = new RunnableCountDownLatch(services.size());
for (int i = 0; i < services.size(); i++) {
Service service = services.get(i);
try {
service.stop(latch);
} catch (Exception e) {
onException(service, e);
}
}
if( firstException==null ) {
latch.await();
}
}