brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [03/10] git commit: AggregateClassLoader shouldn't relay requests to the parent.
Date Tue, 05 Aug 2014 05:24:47 GMT
AggregateClassLoader shouldn't relay requests to the parent.

A normal class loading first goes through the parent class loaders and
if that fails then findClass will be called. In the aggregate case we have
already explicitly listed all classloaders we want to try. Don't try to load
classes from parent.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/99808039
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/99808039
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/99808039

Branch: refs/heads/master
Commit: 998080399b8c00f721ee771b44a1e6f48d925886
Parents: 6b39304
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Wed Jul 23 18:25:02 2014 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Wed Jul 23 18:25:02 2014 +0300

----------------------------------------------------------------------
 .../main/java/brooklyn/util/javalang/AggregateClassLoader.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/99808039/utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java b/utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java
index d8d004c..74535c3 100644
--- a/utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java
+++ b/utils/common/src/main/java/brooklyn/util/javalang/AggregateClassLoader.java
@@ -30,7 +30,11 @@ public class AggregateClassLoader extends ClassLoader {
 
     private final List<ClassLoader> classLoaders = new CopyOnWriteArrayList<ClassLoader>();
 
-    private AggregateClassLoader() {}
+    private AggregateClassLoader() {
+        //Don't pass load requests to the app classloader,
+        //always relay to the classLoaders list.
+        super(null);
+    }
     
     /** creates default instance, with classloaders of Object and AggregateClassLoader */
     public static AggregateClassLoader newInstanceWithDefaultLoaders() {


Mime
View raw message