rspec/rules/S3282/java/rule.adoc

35 lines
855 B
Plaintext
Raw Normal View History

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 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 16:49:39 +02:00
== Compliant Solution
----
@ExcludeDefaultInterceptors
public class MyExcludedClass implements MessageListener
{
@ExcludeClassInterceptors
@ExcludeDefaultInterceptors
public void doTheThing() {
// ...
}
----