brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [36/50] git commit: Add the classloader as per Aled's suggestion.
Date Wed, 09 Jul 2014 21:46:49 GMT
Add the classloader as per Aled's suggestion.


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

Branch: refs/heads/master
Commit: 0f2e2c374fd032235ad4365a706f50dbf20aa3af
Parents: 8e57fb0
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Tue Jul 8 15:06:12 2014 +0300
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Wed Jul 9 22:34:46 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/0f2e2c37/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 935f55e..df73423 100644
--- a/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
+++ b/core/src/main/java/brooklyn/entity/proxying/InternalEntityFactory.java
@@ -129,6 +129,7 @@ public class InternalEntityFactory {
     public <T extends Entity> T createEntityProxy(EntitySpec<T> spec, T entity)
{
         // TODO Don't want the proxy to have to implement EntityLocal, but required by how

         // AbstractEntity.parent is used (e.g. parent.getAllConfig)
+        ClassLoader classloader = (spec.getImplementation() != null ? spec.getImplementation()
: spec.getType()).getClassLoader();
         MutableSet.Builder<Class<?>> builder = MutableSet.<Class<?>>builder()
                 .add(EntityProxy.class, Entity.class, EntityLocal.class, EntityInternal.class);
         if (spec.getType().isInterface()) {
@@ -146,6 +147,7 @@ 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.addFirst(entity.getClass().getClassLoader());
         for(Class<?> iface : interfaces) {
             aggregateClassLoader.addLast(iface.getClassLoader());


Mime
View raw message