From: aclement Date: Thu, 8 Feb 2007 12:36:21 +0000 (+0000) Subject: temporary API extension for allowing more weaver control X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=62674469a5b197c8db0849b3359776d9b5083e2e;p=aspectj.git temporary API extension for allowing more weaver control --- diff --git a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java index 4df029d2f..8ae0f57f8 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/Aj.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/Aj.java @@ -12,6 +12,7 @@ package org.aspectj.weaver.loadtime; import java.util.Map; +import java.util.Set; import java.util.WeakHashMap; import org.aspectj.weaver.Dump; @@ -100,6 +101,22 @@ public class Aj implements ClassPreProcessor { private static Map weavingAdaptors = new WeakHashMap(); + static boolean discardWeaverFor(ClassLoader loader) { + Object weaver = null; + synchronized(weavingAdaptors) { + weaver = weavingAdaptors.remove(loader); + } + return weaver!=null; + } + + static Set getActiveLoaderList() { + Set existingLoaders = null; + synchronized(weavingAdaptors) { + existingLoaders = weavingAdaptors.keySet(); + } + return existingLoaders; + } + static WeavingAdaptor getWeaver(ClassLoader loader, IWeavingContext weavingContext) { ExplicitlyInitializedClassLoaderWeavingAdaptor adaptor = null; synchronized(weavingAdaptors) { @@ -179,5 +196,13 @@ public class Aj implements ClassPreProcessor { public void flushGeneratedClasses(ClassLoader loader){ ((ClassLoaderWeavingAdaptor)WeaverContainer.getWeaver(loader, weavingContext)).flushGeneratedClasses(); } + + public static boolean discardWeaverFor(ClassLoader loader) { + return WeaverContainer.discardWeaverFor(loader); + } + + public static Set getActiveLoaderList() { + return WeaverContainer.getActiveLoaderList(); + } } \ No newline at end of file