@Test public void relaysReloadToRegistryDelegate() { FileBackedRegistry<BackendService> delegate = mock(FileBackedRegistry.class); when(delegate.reload()).thenReturn(CompletableFuture.completedFuture(ReloadResult.reloaded("relaod ok"))); registry = new FileBackedBackendServicesRegistry(delegate, FileMonitor.DISABLED); registry.reload(); verify(delegate).reload(); }
@Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); }
FileBackedBackendServicesRegistry extends AbstractStyxService implements Registry<BackendService>, FileChangeMonitor.Listener { @Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); } }
FileBackedBackendServicesRegistry extends AbstractStyxService implements Registry<BackendService>, FileChangeMonitor.Listener { @Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); } @VisibleForTesting  FileBackedBackendServicesRegistry(FileBackedRegistry<BackendService> fileBackedRegistry, FileMonitor fileChangeMonitor); @VisibleForTesting  FileBackedBackendServicesRegistry(Resource originsFile, FileMonitor fileChangeMonitor); }
FileBackedBackendServicesRegistry extends AbstractStyxService implements Registry<BackendService>, FileChangeMonitor.Listener { @Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); } @VisibleForTesting  FileBackedBackendServicesRegistry(FileBackedRegistry<BackendService> fileBackedRegistry, FileMonitor fileChangeMonitor); @VisibleForTesting  FileBackedBackendServicesRegistry(Resource originsFile, FileMonitor fileChangeMonitor); static FileBackedBackendServicesRegistry create(String originsFile); @Override Registry<BackendService> addListener(ChangeListener<BackendService> changeListener); @Override Registry<BackendService> removeListener(ChangeListener<BackendService> changeListener); @Override CompletableFuture<ReloadResult> reload(); @Override Iterable<BackendService> get(); @Override CompletableFuture<Void> stop(); @Override void fileChanged(); @Override String toString(); }
FileBackedBackendServicesRegistry extends AbstractStyxService implements Registry<BackendService>, FileChangeMonitor.Listener { @Override public CompletableFuture<ReloadResult> reload() { return this.fileBackedRegistry.reload() .thenApply(outcome -> logReloadAttempt("Admin Interface", outcome)); } @VisibleForTesting  FileBackedBackendServicesRegistry(FileBackedRegistry<BackendService> fileBackedRegistry, FileMonitor fileChangeMonitor); @VisibleForTesting  FileBackedBackendServicesRegistry(Resource originsFile, FileMonitor fileChangeMonitor); static FileBackedBackendServicesRegistry create(String originsFile); @Override Registry<BackendService> addListener(ChangeListener<BackendService> changeListener); @Override Registry<BackendService> removeListener(ChangeListener<BackendService> changeListener); @Override CompletableFuture<ReloadResult> reload(); @Override Iterable<BackendService> get(); @Override CompletableFuture<Void> stop(); @Override void fileChanged(); @Override String toString();  }