Please remove me from Mailing List, Thanks in advance !!!


M Khurram

The only way to contorl or finish successfully "Think before it will happen, as when it will be happening you will not have time to Think"





From: David Blevins <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: Wrong interceptor chaining order
Date: Wed, 21 Mar 2007 15:37:33 -0700

Wow, you're going to be the interceptor king pretty soon here :) This is an extremely sharp observation. I certainly never saw it.

Comments below...

On Mar 21, 2007, at 12:37 PM, Prasad Kashyap wrote:

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.

This is easy to fix, we just need to tweak the AnnotationDeployer to put the interceptor declarations found via the @Interceptors annotation at the *beginning* of the list rather than at the end.

http://fisheye6.cenqua.com/browse/openejb/trunk/openejb3/container/ openejb-core/src/main/java/org/apache/openejb/config/ AnnotationDeployer.java?r=519454#l335

So right there on line 335 (love fisheye) we'd need to put that binding *before* the bindings already declared in the list.

Feel free to hack on it. It's actually a fantastic place to starting digging into the runtime code.

-David



_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Reply via email to