brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #285: Adding HttpExecutor to be used for interc...
Date Mon, 05 Sep 2016 15:34:45 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message