On 3/23/07, David Blevins <[EMAIL PROTECTED]> wrote:

On Mar 23, 2007, at 10:43 AM, Prasad Kashyap wrote:

> I have a bean with one of the methods annotated by a
> @ExcludeClassInterceptor.
>
> The bean itself has 2 class level interceptors, 1 defined as an
> annotation (ClassInterceptor) and 1 specified in the DD
> (DDInterceptor).
>
> With the default ordering, everything invokes as expected and the
> method gets excluded from interception.
>
> However, if an attempt is made to change the ordering of the class
> level interceptors, the @ExcludeClassInterceptor  annotation seems to
> be disregarded. The excluded method gets intercepted too.
>
> See dd snippet below. If the ordering is not changed (default
> ordering), the ClassInterceptor executes before the DDInterceptor.
>
> <interceptor-binding>
>    <ejb-name>BasicStatelessIntercepted</ejb-name>
>        <interceptor-order>
>            <interceptor-class>
>                org.apache.openejb.test.interceptor.DDInterceptor
>            </interceptor-class>
>            <interceptor-class>
>                org.apache.openejb.test.interceptor.ClassInterceptor
>            </interceptor-class>
>    </interceptor-order>
> </interceptor-binding>

This one is a toughie without the full test case to look at.  The
interceptor-order is supposed to trump all other bindings at that
same level or lower (low being package, high being method), but it

The spec I believe talks in terms of package being high and method
being low. For eg. in Section 12.8.2, it says, "The
exclude-default-interceptors element disables default interceptors for
the level at which it is specified and lower. That is,
exclude-default-interceptors when applied at the class-level disables
the application of default-interceptors for all methods of the class."

So an @Exclude when specified at the class level applies to it's lower
level, which is the method.

Also, in the next paragraph, it says, "If the interceptor-order
element is used, the ordering specified at the given level must be a
total order over all interceptor classes that have been defined at
that level and above (unless they have been explicitly excluded by
means of one of the exclude- elements described above)"

My understanding is that an @Exclude trumps ordering. It should
re-arrange the order after all @Excludes have been applied.

Cheers
Prasad

should not affect the ordering of any higher bindings (in this case
method level bindings).

Put up a patch and I'll take a look.

-David


Reply via email to