Chapter 2. The AspectJ Language

Table of Contents

The Anatomy of an Aspect
An Example Aspect
Join Points and Pointcuts
Some Example Pointcuts
call vs. execution
Pointcut composition
Pointcut Parameters
Example: HandleLiveness
Writing good pointcuts
Inter-type declarations
Inter-type Scope
Example: PointAssertions


The previous chapter, Getting Started with AspectJ, was a brief overview of the AspectJ language. You should read this chapter to understand AspectJ's syntax and semantics. It covers the same material as the previous chapter, but more completely and in much more detail.

We will start out by looking at an example aspect that we'll build out of a pointcut, an introduction, and two pieces of advice. This example aspect will gives us something concrete to talk about.