if (service != null) { Throwable failure = service.getFailureCause(); if (failure != null) {
protected void logService(Service s) { log.info(s.toString()); Throwable failureCause = s.getFailureCause(); if (failureCause != null) { log.info("Failed in state {} with {}", s.getFailureState(), failureCause); } }
protected void logService(Service s) { log.info(s.toString()); Throwable failureCause = s.getFailureCause(); if (failureCause != null) { log.info("Failed in state {} with {}", s.getFailureState(), failureCause); } }
@Override public void stateChanged(Service dependency) { if(LOG.isDebugEnabled()) { LOG.debug("Service dependency: " + dependency.getName() + " notify" + " for service: " + service.getName()); } Throwable dependencyError = dependency.getFailureCause(); if (dependencyError != null) { synchronized(this) { dependenciesFailed = true; if(LOG.isDebugEnabled()) { LOG.debug("Service: " + service.getName() + " will fail to start" + " as dependent service " + dependency.getName() + " failed to start: " + dependencyError); } this.notifyAll(); } } else if (dependency.isInState(Service.STATE.STARTED)) { if(dependenciesStarted.incrementAndGet() == dependencies.size()) { synchronized(this) { if(LOG.isDebugEnabled()) { LOG.debug("Service: " + service.getName() + " notified to start"); } canStart = true; this.notifyAll(); } } } }
/** * When this service is started, any service stopping with a failure * exception is converted immediately into a failure of this service, * storing the failure and stopping ourselves. * @param child the service that has changed. */ @Override public void stateChanged(Service child) { //if that child stopped while we are running: if (isInState(STATE.STARTED) && child.isInState(STATE.STOPPED)) { // a child service has stopped //did the child fail? if so: propagate Throwable failureCause = child.getFailureCause(); if (failureCause != null) { LOG.info("Child service " + child + " failed", failureCause); //failure. Convert to an exception Exception e = (failureCause instanceof Exception) ? (Exception) failureCause : new Exception(failureCause); //flip ourselves into the failed state noteFailure(e); stop(); } else { LOG.info("Child service completed {}", child); if (areAllChildrenStopped()) { LOG.info("All children are halted: stopping"); stop(); } } } }
/** * When this service is started, any service stopping with a failure * exception is converted immediately into a failure of this service, * storing the failure and stopping ourselves. * @param child the service that has changed. */ @Override public void stateChanged(Service child) { //if that child stopped while we are running: if (isInState(STATE.STARTED) && child.isInState(STATE.STOPPED)) { // a child service has stopped //did the child fail? if so: propagate Throwable failureCause = child.getFailureCause(); if (failureCause != null) { LOG.info("Child service " + child + " failed", failureCause); //failure. Convert to an exception Exception e = (failureCause instanceof Exception) ? (Exception) failureCause : new Exception(failureCause); //flip ourselves into the failed state noteFailure(e); stop(); } else { LOG.info("Child service completed {}", child); if (areAllChildrenStopped()) { LOG.info("All children are halted: stopping"); stop(); } } } }
int exitCode = launchService(conf, processedArgs, true); if (service != null) { Throwable failure = service.getFailureCause(); if (failure != null) {
int exitCode = launchService(conf, processedArgs, true); if (service != null) { Throwable failure = service.getFailureCause(); if (failure != null) {
if (activeService != null && activeService.getFailureCause() != null) {
Throwable failureCause = service.getFailureCause(); if (failureCause != null) { Exception e = (failureCause instanceof Exception) ?
Throwable failureCause = service.getFailureCause(); if (failureCause != null) { Exception e = (failureCause instanceof Exception) ?
if (activeService != null && activeService.getFailureCause() != null) {