-javaagentswitch mentioned in Section 12.6, “Loadtime transformation in the JBoss Enterprise Application Platform Using Sun JDK”. If you wish to use that, then the steps in Section 12.6, “Loadtime transformation in the JBoss Enterprise Application Platform Using Sun JDK” are sufficient. However, JRockit also comes with its own framework for intercepting when classes are loaded, which might be faster than the
-javaagentswitch. If you want to do load-time transformations using the special JRockit hooks, these are the steps you must take.
- Set the
enableLoadtimeWeavingattribute/property to true. By default, JBoss Enterprise Application Platform will not do load-time bytecode manipulation of AOP files unless this is set. If
true, failed bytecode transformation will only give an error warning. This flag is needed because sometimes a JBoss deployment will not include all the classes referenced.
- Copy the
lib/directory of your JBoss AOP distribution to the
bin/directory of your the JBoss Enterprise Application Platform installation.
- Next edit
run.bat(depending on what OS you are on) and add the following to the
# Setup JBoss specific properties JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME \ -Xmanagement:class=org.jboss.aop.hook.JRockitPluggableClassPreProcessor" JBOSS_CLASSPATH="$JBOSS_CLASSPATH:jrockit-pluggable-instrumentor.jar"
- Set the class of the
org.jboss.aop.deployers.AspectManagerJRockiton JBoss Enterprise Application Platform 5, or
org.jboss.aop.deployment.AspectManagerServiceas these are what work with special hooks in JRockit.