Source:
<code>public static void main(String[] args) { NotificationProperties prop = null; initLogging(); try { prop = NotificationProperties.getInstance(); prop.validate(); } catch (Exception ex) { log.error("Failed to parse configuration.", ex); System.err.println(ex.getMessage()); System.exit(1); } if (args != null && args.length > 0 && ARG_VALIDATE.equals(args[0])) { System.exit(0); } NotifierSignalHandler handler = new NotifierSignalHandler(); handler.addScheduledExecutorService(notifyScheduler); handler.addScheduledExecutorService(monitorScheduler); handler.addScheduledExecutorService(idleScheduler); Runtime.getRuntime().addShutdownHook(handler); try { NotificationService notificationService = new NotificationService(prop); Smtp smtp = new Smtp(prop); notificationService.registerTransport(smtp); NotificationService.Idle idleHandler = new NotificationService.Idle(); <START> idleHandler.register(smtp, prop.getInteger(NotificationProperties.MAIL_SEND_INTERVAL)); <END> EngineMonitorService engineMonitorService = new EngineMonitorService(prop); handler.addServiceHandler(notifyScheduler.scheduleWithFixedDelay(notificationService, 1, prop.getLong(NotificationProperties.INTERVAL_IN_SECONDS), TimeUnit.SECONDS)); handler.addServiceHandler(monitorScheduler.scheduleWithFixedDelay(engineMonitorService, 1, prop.getLong(NotificationProperties.ENGINE_INTERVAL_IN_SECONDS), TimeUnit.SECONDS)); handler.addServiceHandler(idleScheduler.scheduleWithFixedDelay(idleHandler, 0, prop.getLong(NotificationProperties.IDLE_INTERVAL), TimeUnit.SECONDS)); } catch (Exception e) { log.error("Failed to run the event notification service. ", e); System.exit(1); } }</code><technical_language>In object oriented design object care of properties behaviours. is some java style guide wrongly present that. In words, transport register it-self idle task, other around</technical_language>

Target:
public static void main(String[] args) { NotificationProperties prop = null; initLogging(); NotificationService notificationService = null; Smtp smtp = null; try { prop = NotificationProperties.getInstance(); prop.validate(); notificationService = new NotificationService(prop); smtp = new Smtp(prop); notificationService.registerTransport(smtp); } catch (Exception ex) { log.error("Failed to parse configuration.", ex); System.err.println(ex.getMessage()); System.exit(1); } if (args != null && args.length > 0 && ARG_VALIDATE.equals(args[0])) { System.exit(0); } NotifierSignalHandler handler = new NotifierSignalHandler(); handler.addScheduledExecutorService(notifyScheduler); handler.addScheduledExecutorService(monitorScheduler); handler.addScheduledExecutorService(idleScheduler); Runtime.getRuntime().addShutdownHook(handler); try { NotificationService.Idle idleHandler = new NotificationService.Idle(); idleHandler.register(smtp, prop.getInteger(smtp.MAIL_SEND_INTERVAL)); EngineMonitorService engineMonitorService = new EngineMonitorService(prop); handler.addServiceHandler(notifyScheduler.scheduleWithFixedDelay(notificationService, 1, prop.getLong(NotificationProperties.INTERVAL_IN_SECONDS), TimeUnit.SECONDS)); handler.addServiceHandler(monitorScheduler.scheduleWithFixedDelay(engineMonitorService, 1, prop.getLong(NotificationProperties.ENGINE_INTERVAL_IN_SECONDS), TimeUnit.SECONDS)); handler.addServiceHandler(idleScheduler.scheduleWithFixedDelay(idleHandler, 0, prop.getLong(NotificationProperties.IDLE_INTERVAL), TimeUnit.SECONDS)); } catch (Exception e) { log.error("Failed to run the event notification service. ", e); System.exit(1); } }