blob: 95920434257db7d75b79c657a0a32a4c6925b769 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The AspectJTM Programming Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM Programming Guide"><link rel="next" href="preface.html" title="Preface"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The AspectJ<sup>TM</sup> Programming Guide</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="preface.html">Next</a></td></tr></table><hr></div><div class="book" id="d0e1"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>The AspectJ<sup>TM</sup> Programming Guide</h1></div><div><h3 class="author">the AspectJ Team</h3></div><div><div class="legalnotice"><p>
Copyright (c) 1998-2001 Xerox Corporation,
2002-2003 Palo Alto Research Center, Incorporated.
All rights reserved.
</p></div></div><div><div class="abstract"><p><a name="d0e15"></a><b>Abstract</b></p><p>
This programming guide describes the AspectJ language. A
companion guide describes the tools which are part of the
AspectJ development environment.
</p><p>
If you are completely new to AspectJ, you should first read
<a href="starting.html">Getting Started with AspectJ</a> for a broad overview of programming
in AspectJ. If you are already familiar with AspectJ, but want a deeper
understanding, you should read <a href="language.html">The AspectJ Language</a> and
look at the examples in the chapter. If you want a more formal
definition of AspectJ, you should read <a href="semantics.html">Semantics</a>.
</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="preface.html">Preface</a></dt><dt>1. <a href="starting.html">Getting Started with AspectJ</a></dt><dd><dl><dt><a href="starting.html#starting-intro">Introduction</a></dt><dt><a href="starting-aspectj.html">Introduction to AspectJ</a></dt><dd><dl><dt><a href="starting-aspectj.html#d0e181">The Dynamic Join Point Model</a></dt><dt><a href="starting-aspectj.html#d0e194">Pointcuts</a></dt><dt><a href="starting-aspectj.html#d0e304">Advice</a></dt><dt><a href="starting-aspectj.html#d0e422">Inter-type declarations</a></dt><dt><a href="starting-aspectj.html#d0e491">Aspects</a></dt></dl></dd><dt><a href="starting-development.html">Development Aspects</a></dt><dd><dl><dt><a href="starting-development.html#d0e513">Tracing</a></dt><dt><a href="starting-development.html#d0e541">Profiling and Logging</a></dt><dt><a href="starting-development.html#d0e586">Pre- and Post-Conditions</a></dt><dt><a href="starting-development.html#d0e624">Contract Enforcement</a></dt><dt><a href="starting-development.html#d0e658">Configuration Management</a></dt></dl></dd><dt><a href="starting-production.html">Production Aspects</a></dt><dd><dl><dt><a href="starting-production.html#d0e671">Change Monitoring</a></dt><dt><a href="starting-production.html#d0e742">Context Passing</a></dt><dt><a href="starting-production.html#starting-production-consistentBehavior">Providing Consistent Behavior</a></dt></dl></dd><dt><a href="starting-conclusion.html">Conclusion</a></dt></dl></dd><dt>2. <a href="language.html">The AspectJ Language</a></dt><dd><dl><dt><a href="language.html#language-intro">Introduction</a></dt><dt><a href="language-anatomy.html">The Anatomy of an Aspect</a></dt><dd><dl><dt><a href="language-anatomy.html#d0e863">An Example Aspect</a></dt><dt><a href="language-anatomy.html#d0e880">Pointcuts</a></dt><dt><a href="language-anatomy.html#d0e923">Advice</a></dt></dl></dd><dt><a href="language-joinPoints.html">Join Points and Pointcuts</a></dt><dd><dl><dt><a href="language-joinPoints.html#d0e1018">Some Example Pointcuts</a></dt><dt><a href="language-joinPoints.html#d0e1288">call vs. execution</a></dt><dt><a href="language-joinPoints.html#d0e1334">Pointcut composition</a></dt><dt><a href="language-joinPoints.html#d0e1454">Pointcut Parameters</a></dt><dt><a href="language-joinPoints.html#d0e1580">Example: <tt>HandleLiveness</tt></a></dt></dl></dd><dt><a href="language-advice.html">Advice</a></dt><dt><a href="language-interType.html">Inter-type declarations</a></dt><dd><dl><dt><a href="language-interType.html#d0e1828">Inter-type Scope</a></dt><dt><a href="language-interType.html#d0e1853">Example: <tt>PointAssertions</tt></a></dt></dl></dd><dt><a href="language-thisJoinPoint.html">thisJoinPoint</a></dt></dl></dd><dt>3. <a href="examples.html">Examples</a></dt><dd><dl><dt><a href="examples.html#examples-intro">Introduction</a></dt><dt><a href="examples-howto.html">Obtaining, Compiling and Running the Examples</a></dt><dt><a href="examples-basic.html">Basic Techniques</a></dt><dd><dl><dt><a href="examples-basic.html#examples-joinPoints">Join Points and <tt>thisJoinPoint</tt></a></dt><dt><a href="examples-basic.html#examples-roles">Roles and Views</a></dt></dl></dd><dt><a href="examples-development.html">Development Aspects</a></dt><dd><dl><dt><a href="examples-development.html#d0e2490">Tracing using aspects</a></dt></dl></dd><dt><a href="examples-production.html">Production Aspects</a></dt><dd><dl><dt><a href="examples-production.html#d0e2692">A Bean Aspect</a></dt><dt><a href="examples-production.html#d0e2874">The Subject/Observer Protocol</a></dt><dt><a href="examples-production.html#d0e3011">A Simple Telecom Simulation</a></dt></dl></dd><dt><a href="examples-reusable.html">Reusable Aspects</a></dt><dd><dl><dt><a href="examples-reusable.html#d0e3355">Tracing using Aspects, Revisited</a></dt></dl></dd></dl></dd><dt>4. <a href="idioms.html">Idioms</a></dt><dd><dl><dt><a href="idioms.html#idioms-intro">Introduction</a></dt></dl></dd><dt>5. <a href="pitfalls.html">Pitfalls</a></dt><dd><dl><dt><a href="pitfalls.html#pitfalls-intro">Introduction</a></dt><dt><a href="pitfalls-infiniteLoops.html">Infinite loops</a></dt></dl></dd><dt>A. <a href="quick.html">AspectJ Quick Reference</a></dt><dd><dl><dt><a href="quick.html#quick-pointcuts">Pointcuts</a></dt><dt><a href="quick-typePatterns.html">Type Patterns</a></dt><dt><a href="quick-advice.html">Advice</a></dt><dt><a href="quick-interType.html">Inter-type member declarations</a></dt><dt><a href="quick-other.html">Other declarations</a></dt><dt><a href="quick-aspectAssociations.html">Aspects</a></dt></dl></dd><dt>B. <a href="semantics.html">Language Semantics</a></dt><dd><dl><dt><a href="semantics.html#semantics-intro">Introduction</a></dt><dt><a href="semantics-joinPoints.html">Join Points</a></dt><dt><a href="semantics-pointcuts.html">Pointcuts</a></dt><dd><dl><dt><a href="semantics-pointcuts.html#d0e5080">Pointcut definition</a></dt><dt><a href="semantics-pointcuts.html#d0e5122">Context exposure</a></dt><dt><a href="semantics-pointcuts.html#d0e5197">Primitive pointcuts</a></dt><dt><a href="semantics-pointcuts.html#d0e5541">Signatures</a></dt><dt><a href="semantics-pointcuts.html#d0e5589">Matching</a></dt><dt><a href="semantics-pointcuts.html#d0e5817">Type patterns</a></dt><dt><a href="semantics-pointcuts.html#d0e5966">Pattern Summary</a></dt></dl></dd><dt><a href="semantics-advice.html">Advice</a></dt><dd><dl><dt><a href="semantics-advice.html#d0e6148">Advice modifiers</a></dt><dt><a href="semantics-advice.html#d0e6156">Advice and checked exceptions</a></dt><dt><a href="semantics-advice.html#d0e6220">Advice precedence</a></dt><dt><a href="semantics-advice.html#d0e6297">Reflective access to the join point</a></dt></dl></dd><dt><a href="semantics-declare.html">Static crosscutting</a></dt><dd><dl><dt><a href="semantics-declare.html#d0e6358">Inter-type member declarations</a></dt><dt><a href="semantics-declare.html#d0e6526">Access modifiers</a></dt><dt><a href="semantics-declare.html#d0e6543">Conflicts</a></dt><dt><a href="semantics-declare.html#d0e6640">Extension and Implementation</a></dt><dt><a href="semantics-declare.html#d0e6683">Interfaces with members</a></dt><dt><a href="semantics-declare.html#d0e6727">Warnings and Errors</a></dt><dt><a href="semantics-declare.html#d0e6759">Softened exceptions</a></dt><dt><a href="semantics-declare.html#d0e6802">Advice Precedence</a></dt><dt><a href="semantics-declare.html#d0e6865">Statically determinable pointcuts</a></dt></dl></dd><dt><a href="semantics-aspects.html">Aspects</a></dt><dd><dl><dt><a href="semantics-aspects.html#d0e6898">Aspect Declaration</a></dt><dt><a href="semantics-aspects.html#d0e6929">Aspect Extension</a></dt><dt><a href="semantics-aspects.html#d0e6949">Aspect instantiation</a></dt><dt><a href="semantics-aspects.html#d0e7112">Aspect privilege</a></dt></dl></dd></dl></dd><dt>C. <a href="implementation.html">Implementation Notes</a></dt><dd><dl><dt><a href="implementation.html#d0e7144">Compiler Notes</a></dt><dt><a href="apcs02.html">Bytecode Notes</a></dt><dd><dl><dt><a href="apcs02.html#d0e7215">The .class expression and String +</a></dt><dt><a href="apcs02.html#d0e7246">The Handler join point</a></dt><dt><a href="apcs02.html#d0e7291">Initializers and Inter-type Constructors</a></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="preface.html">Next</a></td></tr><tr><td width="40%" align="left">&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;Preface</td></tr></table></div></body></html>