On Sat, Mar 27, 2010 at 4:31 AM, Mark Struberg <struberg@yahoo.de> wrote:
a) I still cannot find the paragraph in the spec where it is stated that only one single beans.xml may contain a <interceptors> section.

En contraire, if you interpret the following sentences from 9.4
"If the same class is listed twice under the <interceptors> element, the container automatically detects the problem and treats it as a deployment problem."
and
"An interceptor is said to be enabled if it is enabled in at least one bean archive."

Especially the last sentence definitely makes clear that Lincolns use case should 'just work'. I think this is only a bug in Weld being overly strict and not in the spec (this works in OWB btw).

You know, I'm sensing some inconsistency here in the information I've heard. I've seen Gavin explain that interceptors are only enabled by module, yet that isn't explicitly stated in the spec. Also, the section you found gives no indication of the limitation we've been talking about.

To me, the restriction makes sense because what order is used if two interceptors applied to the same class are activated in different bean archives. But the spec does seem to allow for that case after all. Mark, what order would OWB use? Nik, if this is fixed in Weld, what order does Weld use?
 

b) such a enabler.jar would not work imo in a modular environment, because "If there is no class with the specified name, or if the class with the specified name is not an interceptor class, the container automatically detects the problem and treats it as a deployment problem." So if one jar is not in the dependencies, the list must not contain the Interceptors from this jar.

Naturally we would check to see if the class is registered as a bean before adding it to the enabled interceptor list, if we took this approach.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen