DataTreeIdentifier<DataObject> dataTreeId = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
bindingContext.appConfigPath);
appConfigChangeListenerReg = dataBroker.registerDataTreeChangeListener(dataTreeId,
- (ClusteredDataTreeChangeListener<DataObject>) changes -> onAppConfigChanged(changes));
+ (ClusteredDataTreeChangeListener<DataObject>) this::onAppConfigChanged);
readInitialAppConfig(dataBroker);
}
private void readInitialAppConfig(final DataBroker dataBroker) {
+ @SuppressWarnings("resource") // it's closed in the callback
final ReadOnlyTransaction readOnlyTx = dataBroker.newReadOnlyTransaction();
CheckedFuture<Optional<DataObject>, ReadFailedException> future = readOnlyTx.read(
LogicalDatastoreType.CONFIGURATION, bindingContext.appConfigPath);