To use JBoss AOP you need to transform bytecode. THis can be done in a few ways:
THis is our post compiler. Read the doco for more information
To do load-time transformation you need to be able to hook in a transformer into your classloading. JBoss AOP does this in multiple ways. Please read the doco for more information.
* SystemClassLoader. JBoss AOP provides a SystemClassLoader implementation that adds hooks for transformation. This has been deprecated in JBoss AOP 1.4
* Massage java.lang.ClassLoader to add hooks. This is available with AOP 1.1. Please download the distro and read the docs.
* JDK 5.0 provides a standard way of hooking in an instrumentor through the java.lang.instrument package. JBoss AOP has an agent that can do this. Please read the doco.
Let me define my problem
I neet to aspectize classes at runtime. No knowledge of what to be done
Need to run at any complex Java environment, which has it own ClassLoading system and even already overwrites BootStrap & SystemClassLoaders, as a third party code which also loaded dynamicaly
And I have AOP 1.1 and it says replase SystemClassLoader which I can't, but I can define my one and can load classes only using my custom LocalSubSystemClassLoader, what you would advice to it?
Bill, you ask me to look at docs in AOP 1.1
so in the reference under the 10.2.2.1 bullet with the title 'Loadtime JDK 1.4' written:
"In order to do loadtime weaving of aspects with JDK 1.4, we had to massage java.lang.ClassLoader."
thats good for me
"What you have to do is generate a modification of java.lang.ClassLoader and add this class to the default bootstrap class path (bootclasspath) for your classes to get instrumented at loadtime."
thats not ok with me
So the issue is that I can't add this class to the bootstrap class path,
instead I can try to use this massaged ClassLoader for transforming bytecode locally,
but problem is that I coldn't manage use AspectXmlLoader for parsing xml correctly,
and i could not use your org.jboss.aop.standalone.SystemClassLoader without registering it even subclassing of it creates some problems
So i neet ClassLoader which will work with AspectManager's translate method locally
AspectManager.instance().translate(String className, ClassLoader loader)
I need that loader to work without registering or substituting it with any of System, Bootstrap or whatever loaders or other system resources,