|
|
@@ -19,6 +19,7 @@ import java.io.IOException; |
|
|
|
import java.io.PrintWriter; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URLClassLoader; |
|
|
|
import java.security.ProtectionDomain; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashSet; |
|
|
@@ -82,9 +83,10 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
private WeavingAdaptorMessageHolder messageHolder; |
|
|
|
private boolean abortOnError = false; |
|
|
|
protected GeneratedClassHandler generatedClassHandler; |
|
|
|
protected Map generatedClasses = new HashMap(); /* String -> UnwovenClassFile */ |
|
|
|
protected Map<String, IUnwovenClassFile> generatedClasses = new HashMap<String, IUnwovenClassFile>(); |
|
|
|
public BcelObjectType delegateForCurrentClass; // lazily initialized, should be used to prevent parsing bytecode multiple |
|
|
|
// times |
|
|
|
protected ProtectionDomain activeProtectionDomain; |
|
|
|
|
|
|
|
private boolean haveWarnedOnJavax = false; |
|
|
|
|
|
|
@@ -127,7 +129,7 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
} |
|
|
|
|
|
|
|
private List getFullClassPath(ClassLoader loader) { |
|
|
|
List list = new LinkedList(); |
|
|
|
List<String> list = new LinkedList<String>(); |
|
|
|
for (; loader != null; loader = loader.getParent()) { |
|
|
|
if (loader instanceof URLClassLoader) { |
|
|
|
URL[] urls = ((URLClassLoader) loader).getURLs(); |
|
|
@@ -143,7 +145,7 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
} |
|
|
|
|
|
|
|
private List getFullAspectPath(ClassLoader loader) { |
|
|
|
List list = new LinkedList(); |
|
|
|
List<String> list = new LinkedList<String>(); |
|
|
|
for (; loader != null; loader = loader.getParent()) { |
|
|
|
if (loader instanceof WeavingClassLoader) { |
|
|
|
URL[] urls = ((WeavingClassLoader) loader).getAspectURLs(); |
|
|
@@ -517,8 +519,8 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static List makeClasspath(String cp) { |
|
|
|
List ret = new ArrayList(); |
|
|
|
private static List<String> makeClasspath(String cp) { |
|
|
|
List<String> ret = new ArrayList<String>(); |
|
|
|
if (cp != null) { |
|
|
|
StringTokenizer tok = new StringTokenizer(cp, File.pathSeparator); |
|
|
|
while (tok.hasMoreTokens()) { |
|
|
@@ -816,15 +818,12 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
public void acceptResult(IUnwovenClassFile result) { |
|
|
|
if (wovenClass == null) { |
|
|
|
wovenClass = result; |
|
|
|
|
|
|
|
String name = result.getClassName(); |
|
|
|
if (shouldDump(name.replace('/', '.'), false)) { |
|
|
|
dump(name, result.getBytes(), false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* Classes generated by weaver e.g. around closure advice */ |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// Classes generated by weaver e.g. around closure advice |
|
|
|
String className = result.getClassName(); |
|
|
|
generatedClasses.put(className, result); |
|
|
|
generatedClasses.put(wovenClass.getClassName(), result); |
|
|
@@ -855,4 +854,8 @@ public class WeavingAdaptor implements IMessageContext { |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setActiveProtectionDomain(ProtectionDomain protectionDomain) { |
|
|
|
activeProtectionDomain = protectionDomain; |
|
|
|
} |
|
|
|
} |