protected void handleTermination() throws TimeoutException { if (commandLineDaemon.getTimeout() > 0) { this.awaitTerminated(commandLineDaemon.getTimeout(), commandLineDaemon.getTimeoutUnit()); } else this.awaitTerminated(); } }
public void run() throws Exception { if (!isRunning()) { startUp(); } handleTermination(); }
private static void doRunDaemon(AbstractCommandLineHandler abstractCommandLineHandler) throws Exception { // ExecutorService executor = null; // SimpleTimeLimiter.create(executor).newProxy(abstractCommandLineHandler, CommandLineDaemon.class) new CommandLineDaemonService(((CommandLineDaemon) abstractCommandLineHandler)).run(); } }
@Override public void run() { try { onShutdown(); } catch (Exception e) { LOGGER.error("error exiting:", e); } finally { try { mainThread.join(shutdownTimeoutInSeconds); } catch (InterruptedException e) { LOGGER.warn("Error waiting for shutdown", e); } } } }
protected void doRunInternal() throws Exception { abstractCommandLineHandler = GuiceHelper.getGuiceInjector().getInstance(getCommandLineHandlerClass()); if (CommandLineDaemon.class.isAssignableFrom(abstractCommandLineHandler.getClass())) { doRunDaemon(abstractCommandLineHandler); } else abstractCommandLineHandler.run(arguments); }