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

ASF GitHub Bot commented on NIFI-2909:
--------------------------------------

Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1156#discussion_r86527582
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
 ---
    @@ -141,48 +181,74 @@ public void setProperty(final String name, final 
String value) {
          * @return true if removed; false otherwise
          * @throws java.lang.IllegalArgumentException if the name is null
          */
    -    @Override
    -    public boolean removeProperty(final String name) {
    +    private boolean removeProperty(final String name) {
             if (null == name) {
                 throw new IllegalArgumentException();
             }
     
    -        lock.lock();
    -        try {
    -            verifyModifiable();
    +        final PropertyDescriptor descriptor = 
component.getPropertyDescriptor(name);
    +        String value = null;
    +        if (!descriptor.isRequired() && (value = 
properties.remove(descriptor)) != null) {
     
    -            try (final NarCloseable narCloseable = 
NarCloseable.withComponentNarLoader(component.getClass())) {
    -                final PropertyDescriptor descriptor = 
component.getPropertyDescriptor(name);
    -                String value = null;
    -                if (!descriptor.isRequired() && (value = 
properties.remove(descriptor)) != null) {
    -
    -                    if (descriptor.getControllerServiceDefinition() != 
null) {
    -                        if (value != null) {
    -                            final ControllerServiceNode oldNode = 
serviceProvider.getControllerServiceNode(value);
    -                            if (oldNode != null) {
    -                                oldNode.removeReference(this);
    -                            }
    -                        }
    +            if (descriptor.getControllerServiceDefinition() != null) {
    +                if (value != null) {
    +                    final ControllerServiceNode oldNode = 
serviceProvider.getControllerServiceNode(value);
    +                    if (oldNode != null) {
    +                        oldNode.removeReference(this);
                         }
    +                }
    +            }
     
    -                    try {
    -                        component.onPropertyModified(descriptor, value, 
null);
    -                    } catch (final Exception e) {
    -                        // nothing really to do here...
    -                    }
    +            try {
    +                component.onPropertyModified(descriptor, value, null);
    +            } catch (final Exception e) {
    +                // nothing really to do here...
    --- End diff --
    
    Same as above, just doesn't look right


> Provide a framework mechanism for loading additional classpath resources
> ------------------------------------------------------------------------
>
>                 Key: NIFI-2909
>                 URL: https://issues.apache.org/jira/browse/NIFI-2909
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>             Fix For: 1.1.0
>
>
> We currently have several components with a property for specifying 
> additional classpath resources (DBCP connection pool, scripting processors, 
> JMS). Each of these components is responsible for handling this in its own 
> way. 
> The framework should provide a more integrated solution to make it easier for 
> component developers to deal with this scenario. Some requirements that need 
> to be met by this solution:
> - Multiple instances of the same component with different resources added to 
> the classpath and not interfering with each other (i.e. two DBCP connection 
> pools using different drivers)
> - Ability to modify the actual ClassLoader of the component to deal with 
> frameworks that use Class.forName() without passing in a ClassLoader, meaning 
> if a processor loads class A and class A calls Class.forName(classBName), 
> then class B needs to be available in the ClassLoader that loaded the 
> processor's class which in turn loaded class A
> - A component developer should be able to indicate that a given 
> PropertyDescriptor represents a classpath resource and the framework should 
> take care of the ClassLoader manipulation



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

Reply via email to