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

    https://github.com/apache/brooklyn-server/pull/285#discussion_r77537414
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/location/AbstractLocation.java ---
    @@ -718,6 +719,35 @@ public boolean removeChild(Location child) {
             return removed;
         }
     
    +    public void init() {
    +        super.init();
    +        loadExtension();
    +    }
    +
    +    public void rebind() {
    +        super.rebind();
    +        loadExtension();
    +    }
    +
    +    private void loadExtension() {
    +        Map<String, String> extensions = 
getConfig(LocationConfigKeys.EXTENSIONS);
    +        if (extensions != null) {
    +            for (Map.Entry<String, String> extension: 
extensions.entrySet()) {
    +                try {
    +                    Class<?> extensionClassType =  new 
ClassLoaderUtils(this, getManagementContext()).loadClass(extension.getKey());
    +
    +                    if (!hasExtension(extensionClassType)) {
    +                        Object extensionClass = new ClassLoaderUtils(this, 
getManagementContext()).loadClass(extension.getValue()).newInstance();
    +                        addExtension((Class)extensionClassType, 
extensionClass);
    +                    }
    +                } catch (Exception e) {
    +                    LOG.error("Location extension can not be loaded 
(rethrowing): {}", new Object[] {extension.getKey(), extension.getValue(), e});
    --- End diff --
    
    Update the message to match the argument count


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to