// must stop it first
stopService(value);
// then try to shutdown
if (value instanceof ShutdownableService) {
ShutdownableService service = (ShutdownableService)value;
try {
if (LOG.isTraceEnabled()) {
LOG.trace("Shutting down service: " + service);
}
service.shutdown();
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Caught exception shutting down service: " + service, e);
}
if (firstException == null) {