AOP out of the box does not support this. If you are running in JBoss AS with -javaagent,
you can add an addidional transformer to PluggableInstrumentor's Instrumentation as
shown here
https://svn.jboss.org/repos/jbossas/projects/aop/branches/Branch_2_0/asin...
When running standalone with -javaagent, rather than using PluggableInstrumentor, you use
https://svn.jboss.org/repos/jbossas/projects/aop/branches/Branch_2_0/aop/...
instead, which unfortunately does not allow you access to the Instrumentation. I have
added support for this in svn. [
url]https://jira.jboss.org/jira/browse/JBAOP-672
| [kabir@~/sourcecontrol/jboss-aop/trunk/subversion]
| $svn diff aop/src/main/org/jboss/aop/standalone/Agent.java
| Index: aop/src/main/org/jboss/aop/standalone/Agent.java
| ===================================================================
| --- aop/src/main/org/jboss/aop/standalone/Agent.java (revision 79975)
| +++ aop/src/main/org/jboss/aop/standalone/Agent.java (working copy)
| @@ -35,9 +35,16 @@
| */
| public class Agent
| {
| + private static Instrumentation instrumentation;
| +
| + public static Instrumentation getInstrumentation()
| + {
| + return instrumentation;
| + }
|
| public static void premain(String agentArgs, Instrumentation inst)
| {
| + instrumentation = inst;
| StandaloneClassPoolFactory factory = new StandaloneClassPoolFactory();
| AspectManager.setClassPoolFactory(factory);
| // necessary for configuration
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185355#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...