My Account
View Cart
Home
Community
Books & Videos
Safari Books Online
Conferences
Training
School of Technology
About
Complete List
Bestsellers
New Releases
Rough Cuts
Upcoming Titles
Ebooks
By Publisher
By Series
Out of Print
Order Info
Search
Search Tips
Tell a friend
AspectJ Cookbook
By
Russell Miles
December 2004
Pages: 354
|
Table of Contents
|
Index
|
Sample Chapter
|
Colophon
Table of Contents
Chapter 1
Aspect Orientation Overview
A Brief History of Aspect Orientation
AspectJ
A Definition of Aspect Orientation
Where to Go for More Information
Chapter 2
Getting Started with AspectJ
Introduction
Installing AspectJ
Developing a Simple Aspect
Compiling an Aspect and Multiple Java Files
Weaving Aspects into Jars
Weaving Aspects at Load Time
Generating Javadoc Documentation
Compiling an AspectJ Project Using Eclipse
Selecting the Aspects That Are Woven in a Build Within Eclipse
Building an AspectJ Project Using Ant
Chapter 3
Deploying AspectJ Applications
Introduction
Deploying a Command-Line AspectJ Application
Deploying an AspectJ Application as a Fully Contained Executable JAR File
Deploying a Java Servlet That Uses AspectJ
Deploying a JSP That Uses AspectJ
Deploying an Axis Web Service That Uses AspectJ
Chapter 4
Capturing Joing Points on Methods
Introduction
Capturing a Method Call
Capturing the Parameter Values Passed on a Method Call
Capturing the Target of a Method Call
Capturing a Method When It Is Executing
Capturing the Value of the this Reference When a Method Is Executing
Chapter 5
Capturing Join Points on Exception Handling
Introduction
Capturing When an Exception Is Caught
Capturing the Thrown Exception
Capturing the Object Handling the Exception
Chapter 6
Capturing Join Points on Advice
Introduction
Capturing When Advice Is Executing
Excluding Join Points That Are a Result of Advice Execution
Exposing the Original Join Point When Advice Is Being Advised
Chapter 7
Capturing Join Points on Class Object Construction
Introduction
Capturing a Call to a Constructor
Capturing a Constructor When It Is Executing
Capturing When an Object Is Initialized
Capturing When an Object Is About to Be Initialized
Capturing When a Class Is Initialized
Chapter 8
Capturing Join Points on Attributes
Introduction
Capturing When an Object's Attribute Is Accessed
Capturing the Value of the Field Being Accessed
Capturing When an Object's Field Is Modified
Capturing the Value of a Field When It Is Modified
Chapter 9
Capturing Join Points Within Programmatic Scope
Introduction
Capturing All Join Points Within a Particular Class
Capturing All Join Points Within a Particular Package
Capturing All Join Points Within a Particular Method
Chapter 10
Capturing Join Points Based on Control Flow
Introduction
Capturing All Join Points Within a Program's Control Flow Initiated by an Initial Join Point
Capturing All Join Points Within a Program's Control Flow, Excluding the Initial Join Point
Chapter 11
Capturing Join Points Based on Object Type
Introduction
Capturing When the this Reference Is a Specific Type
Capturing When a Join Point's Target Object Is a Specific Type
Capturing When the Arguments to a Join Point Are a Certain Number, Type, and Ordering
Chapter 12
Capturing Join Points Based on a Boolean or Combined Expression
Introduction
Capturing When a Runtime Condition Evaluates to True on a Join Point
Combining Pointcuts Using a Logical AND (&&)
Combining Pointcuts Using a Logical OR (||)
Capturing All Join Points NOT Specified by a Pointcut Declaration
Declaring Anonymous Pointcuts
Reusing Pointcuts
Chapter 13
Defining Advice
Introduction
Accessing Class Members
Accessing the Join Point Context
Executing Advice Before a Join Point
Executing Advice Around a Join Point
Executing Advice Unconditionally After a Join Point
Executing Advice Only After a Normal Return from a Join Point
Executing Advice Only After an Exception Has Been Raised in a Join Point
Controlling Advice Precedence
Advising Aspects
Chapter 14
Defining Aspect Instantiation
Introduction
Defining Singleton Aspects
Defining an Aspect per Instance
Defining an Aspect per Control Flow
Chapter 15
Defining Aspect Relationships
Introduction
Inheriting Pointcut Definitions
Implementing Abstract Pointcuts
Inheriting Classes into Aspects
Declaring Aspects Inside Classes
Chapter 16
Enhancing Classes and the Compiler
Introduction
Extending an Existing Class
Declaring Inheritance Between Classes
Implementing Interfaces Using Aspects
Declaring a Default Interface Implementation
Softening Exceptions
Extending Compilation
Chapter 17
Implementing Creational Object-Oriented Design Patterns
Introduction
Implementing the Singleton Pattern
Implementing the Prototype Pattern
Implementing the Abstract Factory Pattern
Implementing the Factory Method Pattern
Implementing the Builder Pattern
Chapter 18
Implementing Structural Object-Oriented Design Patterns
Introduction
Implementing the Composite Pattern
Implementing the Flyweight Pattern
Implementing the Adapter Pattern
Implementing the Bridge Pattern
Implementing the Decorator Pattern
Implementing the Proxy Pattern
Chapter 19
Implementing Behavioral Object-Oriented Design Patterns
Introduction
Implementing the Observer Pattern
Implementing the Command Pattern
Implementing the Iterator Pattern
Implementing the Mediator Pattern
Implementing the Chain of Responsibility Pattern
Implementing the Memento Pattern
Implementing the Strategy Pattern
Implementing the Visitor Pattern
Implementing the Template Method Pattern
Implementing the State Pattern
Implementing the Interpreter Pattern
Chapter 20
Applying Class and Component Scale Aspects
Introduction
Validating Parameters Passed to a Method
Overriding the Class Instantiated on a Call to a Constructor
Adding Persistence to a Class
Applying Mock Components to Support Unit Testing
Chapter 21
Applying Application Scale Aspects
Introduction
Applying Aspect-Oriented Tracing
Applying Aspect-Oriented Logging
Applying Lazy Loading
Managing Application Properties
Chapter 22
Applying Enterprise Scale Aspects
Introduction
Applying Development Guidelines and Rules
Applying Transactions
Applying Resource Pooling
Remoting a Class Transparently Using RMI
Applying a Security Policy
Chapter 23
Applying Aspect-Oriented Design Patterns
Introduction
Applying the Cuckoo's Egg Design Pattern
Applying the Director Design Pattern
Applying the Border Control Design Pattern
Applying the Policy Design Pattern
Appendix A
The AspectJ Runtime API
org.aspectj.lang
Signature
org.aspectj.lang.reflect
The SoftException Class
The NoAspectBoundException Class
Colophon
Return to
AspectJ Cookbook