NIFI-4151: Ensure that we properly call invalidateValidationContext() when properties change; ensure that in the controller service provider we don't replace a controller service with a new node if the ID's match, as we won't be able to actually add the new one to the flow. This closes #1995

This commit is contained in:
Mark Payne 2017-07-07 15:18:51 -04:00 committed by Matt Gilman
parent 6df97bbc88
commit 9e296830ab
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
2 changed files with 4 additions and 4 deletions

View File

@ -217,7 +217,7 @@ public abstract class AbstractConfiguredComponent implements ConfigurableCompone
}
try {
getComponent().onPropertyModified(descriptor, oldValue, value);
onPropertyModified(descriptor, oldValue, value);
} catch (final Exception e) {
// nothing really to do here...
}
@ -253,7 +253,7 @@ public abstract class AbstractConfiguredComponent implements ConfigurableCompone
}
try {
getComponent().onPropertyModified(descriptor, value, null);
onPropertyModified(descriptor, value, null);
} catch (final Exception e) {
getLogger().error(e.getMessage(), e);
}
@ -436,7 +436,7 @@ public abstract class AbstractConfiguredComponent implements ConfigurableCompone
}
@Override
public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) {
public final void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) {
invalidateValidationContext();
try (final NarCloseable narCloseable = NarCloseable.withComponentNarLoader(getComponent().getClass(), getComponent().getIdentifier())) {
getComponent().onPropertyModified(descriptor, oldValue, newValue);

View File

@ -162,7 +162,7 @@ public class StandardControllerServiceProvider implements ControllerServiceProvi
}
}
serviceCache.put(id, serviceNode);
serviceCache.putIfAbsent(id, serviceNode);
return serviceNode;
} catch (final Throwable t) {