@Test public void testStartup() throws Exception { EventLogService eventLogService = new EventLogService(eventLog); eventLogService.startUp(); Field eventLogSystemField = eventLogService.getClass().getDeclaredField("eventLogSystem"); eventLogSystemField.setAccessible(true); EventLogSystem eventLogSystem = (EventLogSystem) eventLogSystemField.get(eventLogService); assertNotNull(eventLogSystem); Field eventLogThreadField = eventLogSystem.getClass().getDeclaredField("eventLogThread"); eventLogThreadField.setAccessible(true); Thread eventThread = (Thread) eventLogThreadField.get(eventLogSystem); assertNotNull(eventThread); assertEquals("EventLogThread", eventThread.getName()); eventLogService.startUp(); }
@Override protected void startUp() throws Exception { if (eventLogSystem != null) { LOGGER.info("already started {}", serviceName()); return; } eventLogSystem = new EventLogSystem(eventLog); eventLogSystem.start(); }
EventLogService extends AbstractIdleService { @Override protected void startUp() throws Exception { if (eventLogSystem != null) { LOGGER.info("already started {}", serviceName()); return; } eventLogSystem = new EventLogSystem(eventLog); eventLogSystem.start(); } }
EventLogService extends AbstractIdleService { @Override protected void startUp() throws Exception { if (eventLogSystem != null) { LOGGER.info("already started {}", serviceName()); return; } eventLogSystem = new EventLogSystem(eventLog); eventLogSystem.start(); } @Inject  EventLogService(final EventLog eventLog); }
EventLogService extends AbstractIdleService { @Override protected void startUp() throws Exception { if (eventLogSystem != null) { LOGGER.info("already started {}", serviceName()); return; } eventLogSystem = new EventLogSystem(eventLog); eventLogSystem.start(); } @Inject  EventLogService(final EventLog eventLog);  }
EventLogService extends AbstractIdleService { @Override protected void startUp() throws Exception { if (eventLogSystem != null) { LOGGER.info("already started {}", serviceName()); return; } eventLogSystem = new EventLogSystem(eventLog); eventLogSystem.start(); } @Inject  EventLogService(final EventLog eventLog);   }