Introduction


This chapter examines the different ways that advice can be specified in AspectJ. Pointcuts define which join points you are interested in and advice defines what to do when those join points are encountered.

An advice block contains straightforward Java code. Advice looks much like a Java method, except that it cannot be called directly from your application. It is the AspectJ runtime system that executes the advice according to the pointcut logic associated with that advice.

This chapter begins by examining how advice can interact with your application's classes, including the mechanisms by which to access the triggering join point context. The different types of advice are then discussed before finally covering advice precedence and how the order in which advice is invoked can be controlled where more than one piece of advice is applied to the same join point.



AspectJ Cookbook
Aspectj Cookbook
ISBN: 0596006543
EAN: 2147483647
Year: 2006
Pages: 203
Authors: Russ Miles

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net