[ 
https://issues.apache.org/jira/browse/NIFI-424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14384270#comment-14384270
 ] 

Mark Payne edited comment on NIFI-424 at 3/27/15 6:13 PM:
----------------------------------------------------------

Brandon,

Looks like you don't have the ASF Header added to the 
StandardControllerServiceProviderTest.java and TestControllerService.java files.

Otherwise, looks good!


was (Author: markap14):
Brandon,

Looks like you don't have the ASF Header added to the 
StandardControllerServiceProviderTest.java and TestControllerService.java files.

You shouldn't need the 
nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/resources/META-INF/services/org.apache.nifi.controller.ControllerService
 to include the dummy controller service, since it's only being used in unit 
tests. This is only needed for NiFi to identify the service, but the Mock 
framework doesn't need it because you are explicitly telling it the classname.

Otherwise, looks good!

> Processors / Controller Services should not be able to directly call 
> ControllerService.initialize and ControllerService.onPropertyModified
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-424
>                 URL: https://issues.apache.org/jira/browse/NIFI-424
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Brandon DeVries
>         Attachments: 
> 0001-NIFI-424-Processors-Controller-Services-should-not-b.patch
>
>
> Currently, when a component obtains a Controller Service, it could call 
> onPropertyModified or initialize, which can cause some weird and unexpected 
> behaviors, since these methods are expected to be called only within the 
> constraints of a well-defined component lifecycle. We should prevent this by 
> intercepting the method call and throwing an IllegalStateException unless the 
> method call is coming from the framework.
> Implementation details: This can be achieved by looking at the 
> StandardControllerServiceProvider, which implements all Controller Service 
> interfaces with proxies. In that proxy, it should simply throw an Exception. 
> Then, just ensure that the framework never calls the proxy but only calls 
> directly into the implementing class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to