@SuppressWarnings("unchecked") private static void configureLogging() { String clazz = System.getProperty(DaemonProperties.LOGGER_CONFIGURER); if (clazz != null) { try { Class<ILoggingConfigurer> configurerClazz = (Class<ILoggingConfigurer>) Class.forName(clazz); DaemonStarter.loggingConfigurer.set(configurerClazz.newInstance()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { DaemonStarter.rlog.warn("No ILoggingConfigurer set"); } } try { if (DaemonStarter.loggingConfigurer.get() != null) { DaemonStarter.loggingConfigurer.get().initializeLogging(); } } catch (final Exception e) { System.err.println("Logger config failed with exception: " + e.getMessage()); DaemonStarter.getLifecycleListener().exception(DaemonStarter.currentPhase.get(), e); } }
@SuppressWarnings("unchecked") private static void configureLogging() { String clazz = System.getProperty(DaemonProperties.LOGGER_CONFIGURER); if (clazz != null) { try { Class<ILoggingConfigurer> configurerClazz = (Class<ILoggingConfigurer>) Class.forName(clazz); DaemonStarter.loggingConfigurer.set(configurerClazz.newInstance()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { DaemonStarter.rlog.warn("No ILoggingConfigurer set"); } } try { if (DaemonStarter.loggingConfigurer.get() != null) { DaemonStarter.loggingConfigurer.get().initializeLogging(); } } catch (final Exception e) { System.err.println("Logger config failed with exception: " + e.getMessage()); DaemonStarter.getLifecycleListener().exception(DaemonStarter.currentPhase.get(), e); } }
/** * Abort the daemon * * @param error the error causing the abortion */ public static void abortSystem(final Throwable error) { DaemonStarter.currentPhase.set(LifecyclePhase.ABORTING); try { DaemonStarter.getLifecycleListener().aborting(); } catch (Exception e) { DaemonStarter.rlog.error("Custom abort failed", e); } if (error != null) { DaemonStarter.rlog.error("Unrecoverable error encountered --> Exiting : " + error.getMessage()); DaemonStarter.getLifecycleListener().exception(LifecyclePhase.ABORTING, error); } else { DaemonStarter.rlog.error("Unrecoverable error encountered --> Exiting"); } // Exit system with failure return code System.exit(1); } }
/** * Abort the daemon * * @param error the error causing the abortion */ public static void abortSystem(final Throwable error) { DaemonStarter.currentPhase.set(LifecyclePhase.ABORTING); try { DaemonStarter.getLifecycleListener().aborting(); } catch (Exception e) { DaemonStarter.rlog.error("Custom abort failed", e); } if (error != null) { DaemonStarter.rlog.error("Unrecoverable error encountered --> Exiting : {}", error.getMessage()); DaemonStarter.getLifecycleListener().exception(LifecyclePhase.ABORTING, error); } else { DaemonStarter.rlog.error("Unrecoverable error encountered --> Exiting"); } // Exit system with failure return code System.exit(1); }
DaemonStarter.getLifecycleListener().exception(DaemonStarter.currentPhase.get(), e);
DaemonStarter.getLifecycleListener().exception(DaemonStarter.currentPhase.get(), e);