JBoss.org Community Documentation

5.2. Configuring the microcontainer

Before we can apply the audit aspect to our service we must first add a number of JARs to the extension classpath. These can be found in the lib subdirectory of the client-aop distribution located in the examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir directory:

run.sh
client-1.0.0.jar
jboss-beans.xml
lib/auditAspect-1.0.0.jar
   /concurrent-1.3.4.jar
   /humanResourcesService-1.0.0.jar
   /javassist-3.6.0.GA.jar
   /jboss-aop-2.0.0.beta1.jar
   /jboss-aop-mc-int-2.0.0.Beta6.jar
   /jboss-common-core-2.0.4.GA.jar
   /jboss-common-core-2.2.1.GA.jar
   /jboss-common-logging-log4j-2.0.4.GA.jar
   /jboss-common-logging-spi-2.0.4.GA.jar
   /jboss-container-2.0.0.Beta6.jar
   /jboss-dependency-2.0.0.Beta6.jar
   /jboss-kernel-2.0.0.Beta6.jar
   /jbossxb-2.0.0.CR4.jar
   /log4j-1.2.14.jar
   /trove-2.1.1.jar
   /xercesImpl-2.7.1.jar

First of all we need to include the auditAspect jar as we need to create an instance of our aspect at runtime in order to execute the logic. We then need to include the jar file for JBoss AOP (jboss-aop) together with its dependencies; javassist and trove. Finally we need to add the jboss-aop-mc-int jar as this contains an XML schema definition that allows us to define aspects inside our XML deployment descriptor. It also contains integration code to create dependencies between normal beans and aspect beans within the microcontainer so that we can add behaviour during the deployment and undeployment phases.

Note

Since we are using Maven2 to assemble the client-aop distribution we can easily add these JAR files by declaring the appropriate dependencies in our pom.xml file and creating a valid assembly descriptor. If you are using Ant to perform your build then you will need to do this in a different way.