[jboss-user] [JBoss Seam] - Re: SeamTest and expectedExceptions

pete.muir@jboss.org do-not-reply at jboss.com
Sat Oct 13 18:24:13 EDT 2007


Sorry for the delay,

let me try to get this right (its not trivial)

anonymous wrote : So, this is what I hear you saying:
  | 
  | <my:component-class installed="true" my-property="me"/>
  | means "Go find the class called ComponentClass, and make sure it's going to be installed.  In addition, when instantiating, set myProperty to "me"."

Well, actually the namespacing rules are more complex than this.  It actually says (I hope ;)

1) Imply the class name from the namespace plus un-camel-cased xml element name

2) if name isn't in specified, get the name from the @Name annotation on the class

3) If a name already exists, only configure, don't install a copy (assuming @Install is set to true or not specified)

4) Otherwise, imply the name from the xml-element name

5) if installed="true" or not specified then mark the xml element as used

anonymous wrote : However,
  | <my:component-class installed="false" my-property="me"/>
  | means "See this xml element?  Ignore it.  Pretend it doesn't exist.  In particular, don't set myProperty to "me"."

Yes, essentially.

anonymous wrote : First, it's unintuitive.  "installed='true'" is describing the class, while "installed='false'" is describing this xml element.

Yes, its unintuitive.  However, installed="true" is, in both cases, describing the xml element (it's just that in some cases the xml element's presence causes a component to be installed - does that make sense from the above list of install proceedure?).

anonymous wrote : Second, I don't think Initialization.java actually implements this.  I haven't tested this, so don't quote me, but the code looks pretty clear.  The "installed" variable defined on/near line 324 isn't used to determine whether the properties are set or not.  So, in the above example, both xml declarations result in myProperty being set to "me".

No, what it does is control whether this xml element does just configuration or whether it actually installs a component as well (I think, but I'm tired). I.e. if the component isn't installed in code @Install(false) then the xml element can install one or not depending on the value of installed.

Let me know if this makes more sense.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094925#4094925

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094925



More information about the jboss-user mailing list