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();
if (definition.shouldDumpBefore()) {
m_dumpBefore = true;
}
+ if (definition.createDumpDirPerClassloader()) {
+ dumpDirPerClassloader = true;
+ }
}
}
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.
*/
private final List m_dumpPatterns;
private boolean m_dumpBefore;
+
+ private boolean perClassloaderDumpDir;
private final List m_includePatterns;
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);
return m_dumpBefore;
}
+ public void setCreateDumpDirPerClassloader(boolean b) {
+ perClassloaderDumpDir = b;
+ }
+
+ public boolean createDumpDirPerClassloader() {
+ return perClassloaderDumpDir;
+ }
+
public List getIncludePatterns() {
return m_includePatterns;
}
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";
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)) {