3. AspectJ Configuration

For AspectJ LTW a configuration file will automatically be loaded from META-INF/aop.xml. Multiple includes or excludes can be used to target weaving, and if you wanted to include all subpackages and not just a specific package the package name could be specified as org.springbyexample.aspectjLoadTimeWeaving..* (notice the double periods before the asterisk). In this example, the aspect specified contains the pointcut and advice being applied.

        "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
        <!-- only weave classes in this package -->
        <include within="org.springbyexample.aspectjLoadTimeWeaving.*" />
        <!-- use only this aspect for weaving -->
        <aspect name="org.springbyexample.aspectjLoadTimeWeaving.PerformanceAdvice" />