mirror of https://github.com/apache/nifi.git
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:
parent
6df97bbc88
commit
9e296830ab
|
@ -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);
|
||||
|
|
|
@ -162,7 +162,7 @@ public class StandardControllerServiceProvider implements ControllerServiceProvi
|
|||
}
|
||||
}
|
||||
|
||||
serviceCache.put(id, serviceNode);
|
||||
serviceCache.putIfAbsent(id, serviceNode);
|
||||
|
||||
return serviceNode;
|
||||
} catch (final Throwable t) {
|
||||
|
|
Loading…
Reference in New Issue