try {
Service relatedService = new Service(relatedServiceName);
int relatedServiceStatus = relatedService.getStatus();
if (!(relatedServiceStatus == Service.SERVICE_STOPPED || relatedServiceStatus == Service.SERVICE_STOP_PENDING)) {
log.debug("Stopping Service [" + relatedServiceName + "]");
relatedService.stop(this.timeout);
log.debug("Service stopped [" + relatedServiceName + "]");
relatedService.close();
}
} catch (Exception e) {
log.warn("Unable to stop [" + relatedServiceName + "] from the list [" + services