aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime/src
diff options
context:
space:
mode:
authormwebster <mwebster>2007-03-07 01:29:16 +0000
committermwebster <mwebster>2007-03-07 01:29:16 +0000
commit49aad5d5b4767aa81d2dac74ea80d55bdc8e9643 (patch)
tree72faf8dc29c7540f75959b34ecc5c91b41d5f73a /loadtime/src
parent579ec14c9e86cdbaac656872e26f3e954e8f8946 (diff)
downloadaspectj-49aad5d5b4767aa81d2dac74ea80d55bdc8e9643.tar.gz
aspectj-49aad5d5b4767aa81d2dac74ea80d55bdc8e9643.zip
Bug 176546 "Allow custom aop.xml provider through IWeavingContext"
Diffstat (limited to 'loadtime/src')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java4
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java26
2 files changed, 26 insertions, 4 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
index 40497e103..6aa204393 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
@@ -130,7 +130,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
}
};
- List definitions = parseDefinitions(classLoader);
+ List definitions = weavingContext.getDefinitions(classLoader,this);
if (definitions.isEmpty()) {
disable(); // TODO maw Needed to ensure messages are flushed
if (trace.isTraceEnabled()) trace.exit("initialize",definitions);
@@ -178,7 +178,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
* @param weaver
* @param loader
*/
- private List parseDefinitions(final ClassLoader loader) {
+ List parseDefinitions(final ClassLoader loader) {
if (trace.isTraceEnabled()) trace.enter("parseDefinitions",this,loader);
List definitions = new ArrayList();
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java
index 02c8a091e..6ffd2cb28 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java
@@ -14,6 +14,11 @@ package org.aspectj.weaver.loadtime;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
+import java.util.List;
+
+import org.aspectj.weaver.tools.Trace;
+import org.aspectj.weaver.tools.TraceFactory;
+import org.aspectj.weaver.tools.WeavingAdaptor;
/**
* Use in non-OSGi environment
@@ -21,17 +26,19 @@ import java.util.Enumeration;
* @author David Knibb
*/
public class DefaultWeavingContext implements IWeavingContext {
-
+
protected ClassLoader loader;
-
private String shortName;
+ private static Trace trace = TraceFactory.getTraceFactory().getTrace(DefaultWeavingContext.class);
+
/**
* Construct a new WeavingContext to use the specifed ClassLoader
* This is the constructor which should be used.
* @param loader
*/
public DefaultWeavingContext(ClassLoader loader) {
+ super();
this.loader = loader;
}
@@ -93,4 +100,19 @@ public class DefaultWeavingContext implements IWeavingContext {
}
return isLocallyDefined;
}
+
+ /**
+ * Simply call weaving adaptor back to parse aop.xml
+ *
+ * @param weaver
+ * @param loader
+ */
+ public List getDefinitions(final ClassLoader loader, final WeavingAdaptor adaptor) {
+ if (trace.isTraceEnabled()) trace.enter("getDefinitions",this,new Object[] { loader, adaptor });
+
+ List definitions = ((ClassLoaderWeavingAdaptor)adaptor).parseDefinitions(loader);
+
+ if (trace.isTraceEnabled()) trace.exit("getDefinitions",definitions);
+ return definitions;
+ }
}