<<Previous | Next>>
The application that needs to be monitored can be instrumented using Aspectwerkz. In contrast to AspectJ which uses compile
time weaving to add the aspects, Aspectwekz can use load time weaving. This means that the weaving of the application that
was required when using AspectJ is not required. The steps required for preparing an application for monitoring using
AspectWerkz is described below.
Download the latest release of Aspectwerkz
Unzip the jar file into some directory, say $ASPECT_HOME
Make the following changes to the start up script of your application server
Add a variable in the script to point to the aspectwerkz home directory $ASPECT_HOME set ASPECTWERKZ_HOME=$ASPECT_HOME
Replace %JAVA_HOME%\bin\java with %ASPECTWERKZ_HOME%\bin\aspectwerkz.bat to start the application server. Use the Ant task with the instrument property set to false.
This will not instrument the application but will add the required servlet filters and application lifecycle listeners.
The file $INFRARED_Home/setup/aop.xml should be made available as a resource META-INF/aop.xml. For web application, copying the file $INFRARED_Home/setup/aop.xml to WEB-INF/classes/META-INF suffices. For EAR applications, this is appserver dependant. For Weblogic, copying the file $INFRARED_Home/setup/aop.xml to APP-INF/classes/META-INF suffices.
Aspectwerkz will instrument all classes that are visible from the classloader that loaded aop.xml.
In the case of web applications, this means that all web application classes in WEB-INF/classes and all libraries in
WEB-INF/lib will be instrumented.
In the case of EAR applications, all classes and libraries in all modules of the EAR will be instrumented.
Often you don't want all libraries to be instrumented; for this, the exclusion property must be set in aop.xml. The aop.xml
that ships with InfraRED excludes InfraRED libs from instrumentation.
More details on this are available here and here
|