Exception firstException = null;
for (Object value : services) {
if (value instanceof Service) {
Service service = (Service)value;
try {
service.stop();
} catch (Exception e) {
LOG.debug("Caught exception shutting down: " + e, e);
if (firstException == null) {
firstException = e;
}