@Override public void execute(ApplicationContext currentContext) throws CLIException { SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler(); try { boolean success = scheduler.stopScheduler(currentContext.getSessionId()); resultStack(currentContext).push(success); if (success) { writeLine(currentContext, "Scheduler successfully stopped."); } else { writeLine(currentContext, "Cannot stop scheduler."); } } catch (Exception e) { handleError("An error occurred while attempting to stop scheduler:", e, currentContext); } }