for (ServiceWithDependency sd : services.values()) {
serviceList.add(sd.service);
}
Exception firstException = null;
for (int i = services.size() - 1; i >= 0; i--) {
Service service = serviceList.get(i);
if (LOG.isDebugEnabled()) {
LOG.debug("Stopping service : " + service);
}
Exception ex = ServiceOperations.stopQuietly(LOG, service);
if (ex != null && firstException == null) {