Chapter 7. Take My Advice

This chapter explains in detail the use of advice in AspectJ. We examine the basic forms of advice that are supported, and the association between advice and a pointcut expression. We then cover the rules for writing logic within the body of an advice declaration, and tackle the issue of what happens when multiple pieces of advice all need to execute at the same join point. The declare soft mechanism for softening checked exceptions is also covered in this chapter, because it is best used in conjunction with advice implementing an exception-handling strategy. The chapter closes with a look at AspectJ’s declare error/declare warning mechanism, which like advice uses pointcuts to determine join points of interest, only ...

Get Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.