markap14 commented on a change in pull request #4822:
URL: https://github.com/apache/nifi/pull/4822#discussion_r629677526



##########
File path: 
nifi-api/src/main/java/org/apache/nifi/processor/AbstractProcessor.java
##########
@@ -21,7 +21,7 @@
 public abstract class AbstractProcessor extends 
AbstractSessionFactoryProcessor {
 
     @Override
-    public final void onTrigger(final ProcessContext context, final 
ProcessSessionFactory sessionFactory) throws ProcessException {
+    public void onTrigger(final ProcessContext context, final 
ProcessSessionFactory sessionFactory) throws ProcessException {

Review comment:
       Yeah I think #2 is the way to go. The point of AbstractProcessor is to 
take the ProcessSessionFactory and manage the session for you to ensure that 
the session is properly committed/rolled back. By making that `final` we ensure 
that if you extend `AbstractProcessor` that is being taken care of for you. If 
we were to remove the `final` there it means that you could potentially have a 
Processor that inherits from `AbstractProcessor` but where the session is not 
properly managed, which would lead to a lot of confusion.




-- 
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.

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


Reply via email to