JBoss.org Community Documentation

Chapter 4. Advices

4.1. Around Advices
4.2. Before/After/After-Throwing/Finally Advices
4.2.1. Before Advice Signature
4.2.2. After Advice Signature
4.2.3. After-Throwing Advice Signature
4.2.4. Finally Advice Signature
4.3. Annotated Advice Parameters
4.3.1. @Thrown annotated parameter
4.3.2. JoinPoint Arguments
4.4. Overloaded Advices
4.4.1. Annotated-parameter Signature
4.4.2. Default Signature
4.4.3. Mixing Different Signatures
4.5. Common Mistakes

Advices are aspect methods that are invoked during specific joinpoint executions.

JBoss AOP provides five types of advice.

The default one is the around advice, and it can be used on all execution modes. This advice wraps the joinpoint, in a way that it replaces the joinpoint execution in the base system, and is responsible for proceeding execution to the joinpoint.

Besides around advices, you can write advices that, instead of wrapping the joinpoint, are executed before or after it. In this category, JBoss AOP provides before, after, after-throwing and finally advices. These advices are available only when using the generated advisor mode (this is the default mode in JBoss AOP, to learn how to select another weaving mode, refer to Chapter X).

The next sections will explain in detail the binding and signature rules for JBoss AOP advices.