summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/contribution/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-05-01 11:01:53 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-05-01 11:01:53 +0000
commitd33d3a4372e15ec16e06ee88e1930eff86e32517 (patch)
treebe5cc1a18c2d3c0594e1ac7b2e1811381d4918c8 /sca-java-2.x/trunk/modules/contribution/src
parentd636f60e0a738e168d7471dc6e78464944191da9 (diff)
TUSCANY-4034: Add a way to null out the fields in a ClassLoaderModelResolver
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1332616 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/contribution/src')
-rw-r--r--sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
index 1ba394dde9..bb7ae3f29d 100644
--- a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
+++ b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.contribution.java.impl;
import java.io.IOException;
import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
@@ -29,6 +30,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Vector;
import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.contribution.Import;
@@ -123,6 +125,8 @@ public class ClassLoaderModelResolver extends URLClassLoader implements ModelRes
} catch (ClassNotFoundException e) {
return unresolved;
+ } finally {
+ contributionContainingClass = null;
}
}
@@ -178,5 +182,12 @@ public class ClassLoaderModelResolver extends URLClassLoader implements ModelRes
Class<?> clazz = super.findClass(name);
return clazz;
}
+
+ public void clear() {
+ contribution = null;
+ contributionContainingClass = null;
+ context = null;
+ importResolvers = null;
+ }
}