simonbence commented on a change in pull request #5356:
URL: https://github.com/apache/nifi/pull/5356#discussion_r722974016



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/spring/StatusHistoryRepositoryFactoryBean.java
##########
@@ -40,8 +40,6 @@
 
     @Override
     public StatusHistoryRepository getObject() throws Exception {
-        nifiProperties = applicationContext.getBean("nifiProperties", 
NiFiProperties.class);

Review comment:
       The `applicationContext` attribute is not in use any more, please remove 
it

##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-headless-server/src/main/java/org/apache/nifi/headless/HeadlessNiFiServer.java
##########
@@ -130,7 +131,11 @@ public void preDestruction() throws 
AuthorizerDestructionException {
             BulletinRepository bulletinRepository = new 
VolatileBulletinRepository();
             StandardFlowRegistryClient flowRegistryClient = new 
StandardFlowRegistryClient();
             flowRegistryClient.setProperties(props);
-            StatusHistoryRepository statusHistoryRepository = new 
VolatileComponentStatusRepository();
+
+            final StatusHistoryRepositoryFactoryBean 
statusHistoryRepositoryFactoryBean = new StatusHistoryRepositoryFactoryBean();

Review comment:
       As I stated previously, I firmly think, _extracting_ the relevant part 
from the factory bean into a factory would be the right way (and calling that 
from the factory bean). With this you introduce spring specific things directly 
to the Headless (which as far as I understand does not use Spring otherwise, 
but with this I might be wrong) and enforce Spring's API on this call. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to