@Test public void testShutdown() throws Exception { EventLogService eventLogService = new EventLogService(eventLog); eventLogService.shutDown(); Field eventLogSystemField = eventLogService.getClass().getDeclaredField("eventLogSystem"); eventLogSystemField.setAccessible(true); EventLogSystem eventLogSystem = (EventLogSystem) eventLogSystemField.get(eventLogService); assertNull(eventLogSystem); eventLogService.startUp(); eventLogService.shutDown(); eventLogSystemField = eventLogService.getClass().getDeclaredField("eventLogSystem"); eventLogSystemField.setAccessible(true); eventLogSystem = (EventLogSystem) eventLogSystemField.get(eventLogService); assertNull(eventLogSystem); }
@Override protected void shutDown() throws Exception { if (eventLogSystem == null) { LOGGER.info("already stopped {}", serviceName()); return; } eventLogSystem.stop(); eventLogSystem = null; }
EventLogService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (eventLogSystem == null) { LOGGER.info("already stopped {}", serviceName()); return; } eventLogSystem.stop(); eventLogSystem = null; } }
EventLogService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (eventLogSystem == null) { LOGGER.info("already stopped {}", serviceName()); return; } eventLogSystem.stop(); eventLogSystem = null; } @Inject  EventLogService(final EventLog eventLog); }
EventLogService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (eventLogSystem == null) { LOGGER.info("already stopped {}", serviceName()); return; } eventLogSystem.stop(); eventLogSystem = null; } @Inject  EventLogService(final EventLog eventLog);  }
EventLogService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (eventLogSystem == null) { LOGGER.info("already stopped {}", serviceName()); return; } eventLogSystem.stop(); eventLogSystem = null; } @Inject  EventLogService(final EventLog eventLog);   }