summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-09-27 17:26:37 +0000
committeraclement <aclement>2008-09-27 17:26:37 +0000
commitecca4f0d36d30abd26390042da8c5c98895b95ec (patch)
tree5746999f2004044f29f4ca74f69223e529cfd00d
parenta85c94e29a245a321a233083e3dfb6dacc847edf (diff)
downloadaspectj-ecca4f0d36d30abd26390042da8c5c98895b95ec.tar.gz
aspectj-ecca4f0d36d30abd26390042da8c5c98895b95ec.zip
248814: perclassloaderdumpdir
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java15
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/definition/Definition.java11
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java5
3 files changed, 31 insertions, 0 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
index 95016f655..10eaefbab 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java
@@ -62,6 +62,7 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
private List m_dumpTypePattern = new ArrayList();
private boolean m_dumpBefore = false;
+ private boolean dumpDirPerClassloader = false;
private List m_includeTypePattern = new ArrayList();
private List m_excludeTypePattern = new ArrayList();
private List m_includeStartsWith = new ArrayList();
@@ -593,6 +594,9 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
if (definition.shouldDumpBefore()) {
m_dumpBefore = true;
}
+ if (definition.createDumpDirPerClassloader()) {
+ dumpDirPerClassloader = true;
+ }
}
}
@@ -728,10 +732,21 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
return false;
}
+ protected String getDumpDir() {
+ if (dumpDirPerClassloader) {
+ StringBuffer dir = new StringBuffer();
+ dir.append("_ajdump").append(File.separator).append(weavingContext.getClassLoaderName());
+ return dir.toString();
+ } else {
+ return super.getDumpDir();
+ }
+ }
+
/*
* shared classes methods
*/
+
/**
* @return Returns the key.
*/
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/definition/Definition.java b/loadtime/src/org/aspectj/weaver/loadtime/definition/Definition.java
index 3b6e06a1d..73801b930 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/definition/Definition.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/definition/Definition.java
@@ -26,6 +26,8 @@ public class Definition {
private final List m_dumpPatterns;
private boolean m_dumpBefore;
+
+ private boolean perClassloaderDumpDir;
private final List m_includePatterns;
@@ -42,6 +44,7 @@ public class Definition {
public Definition() {
m_weaverOptions = new StringBuffer();
m_dumpBefore = false;
+ perClassloaderDumpDir = false;
m_dumpPatterns = new ArrayList(0);
m_includePatterns = new ArrayList(0);
m_excludePatterns = new ArrayList(0);
@@ -67,6 +70,14 @@ public class Definition {
return m_dumpBefore;
}
+ public void setCreateDumpDirPerClassloader(boolean b) {
+ perClassloaderDumpDir = b;
+ }
+
+ public boolean createDumpDirPerClassloader() {
+ return perClassloaderDumpDir;
+ }
+
public List getIncludePatterns() {
return m_includePatterns;
}
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
index f620e78d9..101fcbaa7 100644
--- a/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
+++ b/loadtime/src/org/aspectj/weaver/loadtime/definition/DocumentParser.java
@@ -52,6 +52,7 @@ public class DocumentParser extends DefaultHandler {
private final static String WEAVER_ELEMENT = "weaver";
private final static String DUMP_ELEMENT = "dump";
private final static String DUMP_BEFOREANDAFTER_ATTRIBUTE = "beforeandafter";
+ private final static String DUMP_PERCLASSLOADERDIR_ATTRIBUTE = "perclassloaderdumpdir";
private final static String INCLUDE_ELEMENT = "include";
private final static String EXCLUDE_ELEMENT = "exclude";
private final static String OPTIONS_ATTRIBUTE = "options";
@@ -205,6 +206,10 @@ public class DocumentParser extends DefaultHandler {
if (isTrue(beforeAndAfter)) {
m_definition.setDumpBefore(true);
}
+ String perWeaverDumpDir = attributes.getValue(DUMP_PERCLASSLOADERDIR_ATTRIBUTE);
+ if (isTrue(perWeaverDumpDir)) {
+ m_definition.setCreateDumpDirPerClassloader(true);
+ }
} else if (EXCLUDE_ELEMENT.equals(qName) && m_inAspects) {
String typePattern = getWithinAttribute(attributes);
if (!isNull(typePattern)) {