2021-04-28 16:49:39 +02:00
Exclusions for default interceptors can be declared either in xml or as class annotations. Since annotations are more visible to maintainers, they are preferred.
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
<assembly-descriptor>
<interceptor-binding>
<ejb-name>MyExcludedClass</ejb-name>
<exclude-default-interceptors>true</exclude-default-interceptors> <!-- Noncompliant -->
<exclude-class-interceptors>true</exclude-class-interceptors> <!-- Noncomopliant -->
<method>
<method-name>doTheThing</method-name>
</method>
</interceptor-binding>
</assembly-descriptor>
----
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
@ExcludeDefaultInterceptors
public class MyExcludedClass implements MessageListener
{
@ExcludeClassInterceptors
@ExcludeDefaultInterceptors
public void doTheThing() {
// ...
}
----
2021-04-28 18:08:03 +02:00