O'Reilly logo

AspectJ Cookbook by Russ Miles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. The AspectJ Runtime API

It is sometimes useful to access information about the join points that trigger an advice in your aspects at runtime, and AspectJ provides a runtime API in the org.aspectj.* packages that can be used for just this purpose. ??? shows the package breakdown for the AspectJ runtime API.

The package structure of the AspectJ runtime API

Figure A-1. The package structure of the AspectJ runtime API

The main packages of the AspectJ runtime API contain:

org.aspectj.lang

Provides interfaces and support classes for discovering runtime information about join points.

org.aspectj.lang.reflect

Contains interfaces that provide more specialized information concerning join point signatures.

org.aspectj.weaver.tools

Provides interfaces to support a JVM class loader in performing load-time weaving.

This appendix focuses on the contents of org.aspectj.lang and org.aspectj.lang.reflect and gives a brief overview of each of the main components in those packages. If you want to delve into the API, then the full documentation is available within your AspectJ installation at %ASPECTJ_INSTALLATION_DIR%/doc/api/index.html.

org.aspectj.lang

Similar to the familiar java.lang package that conatins the most fundamental constructs for the Java language, the org.aspectj.lang package provides a set of classes for interacting with join points at the most basic and common level.

JoinPoint and JoinPoint.StaticPart

Figure A-1Figure A-1

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required