When an interceptor is declared in the DD and bound specifically to a
bean (not using the wildcard *), it becomes yet another class
interceptor for the bean. In such a scenario, Section 12.8.2 of the
spec says,

"The binding of interceptors to classes is additive. If interceptors
are bound at the class-level and/or default-level as well as at the
method-level, both class-level and/or default-level as well as
method-level interceptors will apply. The deployment descriptor may be
used to augment the interceptors and interceptor methods defined by
means of annotations.

<emphasis>When the deployment descriptor is used to augment the
interceptors specified in annotations, the interceptor methods
specified in the deployment descriptor will be invoked after those
specified in annotations, </emphasis>

according to the ordering specified in sections 12.3.1 and 12.4.1. The
interceptor-order deployment descriptor element may be used to
override this ordering."

Expected outcome:
-----------------------------
As per the statement in <emphasis></emphasis> above, the interceptor
declared in the DD and bound to the bean should be invoked after all
the other class level interceptors specified by annotations. This is
assuming that the order is not modified by the <interceptor-order>
element.

Actual result:
-------------------
The actual result I'm seeing is the class level interceptor bound in
the DD gets invoked by before those specified by the @Interceptor
annotation.


Cheers
Prasad

Reply via email to