Exclusions for default interceptors can be declared either in xml or as class annotations. Since annotations are more visible to maintainers, they are preferred.
<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>
@ExcludeDefaultInterceptors public class MyExcludedClass implements MessageListener { @ExcludeClassInterceptors @ExcludeDefaultInterceptors public void doTheThing() { // ... }