NIFI-5708 Fixing the creation of ValidationContextFactory for controller services so it uses the ComponentVariableRegistry and not the file-based instance

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #3081
This commit is contained in:
Bryan Bende 2018-10-16 13:58:48 -04:00 committed by Matthew Burgess
parent 4d21f9b34e
commit 51ed618cf0

View File

@ -157,12 +157,13 @@ public class StandardControllerServiceProvider implements ControllerServiceProvi
originalService.initialize(new StandardControllerServiceInitializationContext(id, terminationAwareLogger, this, getStateManager(id), nifiProperties)); originalService.initialize(new StandardControllerServiceInitializationContext(id, terminationAwareLogger, this, getStateManager(id), nifiProperties));
final ValidationContextFactory validationContextFactory = new StandardValidationContextFactory(this, variableRegistry);
final LoggableComponent<ControllerService> originalLoggableComponent = new LoggableComponent<>(originalService, bundleCoordinate, terminationAwareLogger); final LoggableComponent<ControllerService> originalLoggableComponent = new LoggableComponent<>(originalService, bundleCoordinate, terminationAwareLogger);
final LoggableComponent<ControllerService> proxiedLoggableComponent = new LoggableComponent<>(proxiedService, bundleCoordinate, terminationAwareLogger); final LoggableComponent<ControllerService> proxiedLoggableComponent = new LoggableComponent<>(proxiedService, bundleCoordinate, terminationAwareLogger);
final ComponentVariableRegistry componentVarRegistry = new StandardComponentVariableRegistry(this.variableRegistry); final ComponentVariableRegistry componentVarRegistry = new StandardComponentVariableRegistry(this.variableRegistry);
final ValidationContextFactory validationContextFactory = new StandardValidationContextFactory(this, componentVarRegistry);
final ControllerServiceNode serviceNode = new StandardControllerServiceNode(originalLoggableComponent, proxiedLoggableComponent, invocationHandler, final ControllerServiceNode serviceNode = new StandardControllerServiceNode(originalLoggableComponent, proxiedLoggableComponent, invocationHandler,
id, validationContextFactory, this, componentVarRegistry, flowController, validationTrigger); id, validationContextFactory, this, componentVarRegistry, flowController, validationTrigger);
serviceNode.setName(rawClass.getSimpleName()); serviceNode.setName(rawClass.getSimpleName());