The AspectJTM Programming Guide

the AspectJ Team

Copyright (c) 1998-2002 Xerox Corporation. All rights reserved.

Abstract

This programming guide describes the AspectJ language. A companion guide describes the tools which are part of the AspectJ development environment.

If you are completely new to AspectJ, you should first read Getting Started with AspectJ for a broad overview of programming in AspectJ. If you are already familiar with AspectJ, but want a deeper understanding, you should read The AspectJ Language and look at the examples in the chapter. If you want a more formal definition of AspectJ, you should read Semantics.


Table of Contents

Preface
1. Getting Started with AspectJ
Introduction
AspectJ Semantics
The Dynamic Join Point Model
Pointcut Designators
Advice
Introduction
Aspect Declarations
Development Aspects
Tracing, Logging, and Profiling
Pre- and Post-Conditions
Contract Enforcement
Configuration Management
Production Aspects
Change Monitoring
Context Passing
Providing Consistent Behavior
Static Crosscutting: Introduction
Conclusion
2. The AspectJ Language
Introduction
The Anatomy of an Aspect
An Example Aspect
Pointcuts
Advice
Join Points and Pointcuts
Designators
call vs. execution
Pointcut composition
Pointcut Parameters
Example: HandleLiveness
Advice
Introduction
Introduction Scope
Example: PointAssertions
Reflection
3. Examples
About this Chapter
Obtaining, Compiling and Running the Examples
Basic Techniques
Join Points and thisJoinPoint
Roles and Views Using Introduction
Development Aspects
Tracing Aspects
Production Aspects
A Bean Aspect
The Subject/Observer Protocol
A Simple Telecom Simulation
Reusable Aspects
Tracing Aspects Revisited
4. Idioms
About this Chapter
5. Pitfalls
About this Chapter
Infinite loops
A. AspectJ Quick Reference
Pointcut Designators
Type Patterns
Advice
Static Crosscutting
Aspect Associations
B. Language Semantics
Join Points
Pointcuts
Pointcut naming
Context exposure
Primitive pointcuts
Signatures
Type patterns
Pointcuts and Join Points
Advice
Advice modifiers
Advice and checked exceptions
Advice precedence
Reflective access to the join point
Static crosscutting
Member introduction
Access modifiers
Conflicts
Extension and Implementation
Interfaces with members
Warnings and Errors
Softened exceptions
Statically determinable pointcuts
Aspects
Aspect Extension
Aspect instantiation
Aspect privilege
Aspect domination
C. Implementation Limitations
D. Glossary
Bibliography