@Override
  public synchronized void stopScheduler() throws AmbariException {
    if (scheduler == null) {
      throw new AmbariException("Scheduler not instantiated !");
    }
    try {
      scheduler.shutdown();
    } catch (SchedulerException e) {
      LOG.error("Failed to stop scheduler", e);
      throw new AmbariException(e.getMessage());
    }
  }
Constructor used for unit testing
@param configuration
ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java