ConfigurationChangeCoordinator implements Closeable, ConfigurationChangeNotifier { public void initialize(Properties properties, ConfigurationFileHolder configurationFileHolder, Collection<ConfigurationChangeListener> changeListenerSet) { final String ingestorsCsv = properties.getProperty(NOTIFIER_INGESTORS_KEY); if (ingestorsCsv != null && !ingestorsCsv.isEmpty()) { for (String ingestorClassname : Arrays.asList(ingestorsCsv.split(","))) { ingestorClassname = ingestorClassname.trim(); try { Class<?> ingestorClass = Class.forName(ingestorClassname); ChangeIngestor changeIngestor = (ChangeIngestor) ingestorClass.newInstance(); changeIngestor.initialize(properties, configurationFileHolder, this); changeIngestors.add(changeIngestor); logger.info("Initialized "); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException("Issue instantiating ingestor " + ingestorClassname, e); } } } configurationChangeListeners.clear(); configurationChangeListeners.addAll(changeListenerSet); }  void initialize(Properties properties, ConfigurationFileHolder configurationFileHolder, Collection<ConfigurationChangeListener> changeListenerSet); void start(); Set<ConfigurationChangeListener> getChangeListeners(); Collection<ListenerHandleResult> notifyListeners(ByteBuffer newConfig); @Override void close(); static final String NOTIFIER_PROPERTY_PREFIX; static final String NOTIFIER_INGESTORS_KEY; }
@Test public void testInit() throws Exception { properties.put("nifi.minifi.notifier.ingestors", "org.apache.nifi.minifi.bootstrap.configuration.ingestors.RestChangeIngestor"); final ConfigurationChangeListener testListener = Mockito.mock(ConfigurationChangeListener.class); coordinatorSpy.initialize(properties, Mockito.mock(ConfigurationFileHolder.class), Collections.singleton(testListener)); }