The @Interceptor annotation may be used to explicitly designate a class as an interceptor class. Support
for this annotation is not required.
which implies that an interceptor class (@Interceptor class Foo), that is bound using the @Interceptors(Foo.class) annotation may be annotated with the @Interceptor annotation (with no interceptor bindings) to be explicitly designated as an interceptor class.
In addition, the JavaDoc for the Interceptor annotation (version 1.2) says:
This annotation is optional if the Interceptors annotation or the EJB deployment descriptor are used to associate the interceptor with the target class. It is required when an interceptor binding is used.
which is in line with the above.
However, the Interceptors 1.2 specification says:
All interceptors declared using the Interceptor annotation should specify at least one interceptor binding. If an interceptor declared using the Interceptor annotation does not declare any interceptor binding, non-portable behavior results.
Now, the interceptor (@Interceptor class Foo) which does not specify any interceptor binding but uses the @Interceptor annotation suddenly relies on non-portable behavior.
The Interceptors 1.1 specification says:
which implies that an interceptor class (@Interceptor class Foo), that is bound using the @Interceptors(Foo.class) annotation may be annotated with the @Interceptor annotation (with no interceptor bindings) to be explicitly designated as an interceptor class.
In addition, the JavaDoc for the Interceptor annotation (version 1.2) says:
which is in line with the above.
However, the Interceptors 1.2 specification says:
Now, the interceptor (@Interceptor class Foo) which does not specify any interceptor binding but uses the @Interceptor annotation suddenly relies on non-portable behavior.
Affected Versions
[1.2]