文档介绍:AspectJ in Action
AspectJ in Action
PRACTICAL ASPECT-ORIENTED
PROGRAMMING
RAMNIVAS LADDAD
MANNING
Greenwich
(74° w. long.)
For online information and ordering of this and other Manning books, go to
. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact:
Special Sales Department
Manning Publications Co.
209 Bruce Park Avenue Fax: (203) 661-9018
Greenwich, CT 06830 email: orders@
©2003 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted,
in any form or by means electronic, mechanical, photocopying, or otherwise, without
prior written permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products
are claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial
caps or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to
have the books they publish printed on acid-free paper, and we exert our best efforts to that
end.
Manning Publications Co. Copyeditor: Liz Welch
209 Bruce Park Avenue Typesetter: Denis Dalinnik
Greenwich, CT 06830 Cover designer: Leslie Haimes
ISBN 1-930110-93-6
Printed in the United States of America
**********–VHG–05 040302
To my late grandfather, Jodhrajji.
You were always there for me.
brief contents
PART 1UNDERSTANDING AOP AND ASPECTJ.............................1
1 ■ Introduction to AOP 3
2 ■ Introducing AspectJ 32
3 ■ AspectJ: syntax basics 64
4 ■ Advanced AspectJ 100
PART 2BASIC APPLICATIONS OF ASPECTJ................................143
5 ■ Monitoring techniques: logging, tracing,
and profiling 145
6 ■ Policy enforcement: system wide contracts 178
7 ■ Optimization: pooling and caching 202
PART 3ADVANCED APPLICATIONS OF A