brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [32/50] git commit: Aggregate the class loaders of classes involved in the proxy creation.
Date Wed, 09 Jul 2014 21:46:45 GMT
Aggregate the class loaders of classes involved in the proxy creation.

Should be more generic than the previous approach.


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

Branch: refs/heads/master
Commit: 39f740fe748ca3601d7c200a13a5467f4f3a2279
Parents: 6dda7b6
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Tue Jul 8 10:33:28 2014 +0300
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Wed Jul 9 22:34:45 2014 +0100

----------------------------------------------------------------------
 .../java/brooklyn/entity/proxying/InternalEntityFactory.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/39f740fe/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java b/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
index 931c2d3..d5461ec 100644
--- a/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
+++ b/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
@@ -147,8 +147,10 @@ public class InternalEntityFactory {
         // Building our own aggregating class loader gets around this.
         // But we really should not have to do this! What are the consequences?
         AggregateClassLoader aggregateClassLoader =  AggregateClassLoader.newInstanceWithNoLoaders();
-        aggregateClassLoader.addFirst(classloader);
-        aggregateClassLoader.addLast(Entity.class.getClassLoader());
+        aggregateClassLoader.addFirst(entity.getClass().getClassLoader());
+        for(Class<?> iface : interfaces) {
+            aggregateClassLoader.addLast(iface.getClassLoader());
+        }
 
         return (T) java.lang.reflect.Proxy.newProxyInstance(
                 aggregateClassLoader,


Mime
View raw message