JBoss.org Community Documentation
To mark a class as an interceptor or an aspect factory you annotate it with the
@InterceptorDef
annotation. The class must either implement
the
org.jboss.aop.advice.Interceptor
interface or the
org.jboss.aop.advice.AspectFactory
interface.
The declaration of
org.jboss.aop.InterceptorDef
is:
package org.jboss.aop; @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Aspect { Scope scope() default Scope.PER_VM; }
The same
Scope
enum is used as for
Aspect
.
The following examples use the @Bind annotation, which will be described in more
detail below.