Chapter 2. The AspectJ Language

Table of Contents

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

Introduction

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.