You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Andrea Smyth <an...@iona.com> on 2007/06/01 20:11:27 UTC
wildcard bean definitions
Hi all,
The support for wildcard beans that was introduced a while ago only
seems to apply to standard beans, i.e.
{http://www.springframework.org/schema/beans}bean elements, but not to
custom beans such as
{http://cxf.apache.org/transports/http/configuration}conduit elements.
With more and more use of Spring's support for custom schema it would be
good to support this for custom beans also:
<h:conduit name="*.http-conduit">
<h:client ConnectionTimeout="79"/>
</h:conduit>
The problem seems to be that the wildcard definitions map uses the
simple class name as the key. If line 152 in ConfigurerImpl:
String className = beanInstance.getClass().getSimpleName();
is changed to use the qualified name, the above works as expected.
What was the rationale for choosing the simple name as a key? Are there
any objections to changing this to using the qualified class name?
Note that for custom beans that class name never needs to be specified
- the bean definition parser provides it (and it would result in invalid
xml unless a "class" attribute was actually defined for a custom bean).
Cheers,
Andrea.
RE: wildcard bean definitions
Posted by "Tully, Gary" <Ga...@iona.com>.
Hi Andrea,
The rational for the use of the simple name was brevity and ease of use.
The class attribute in the wildcard case serves to partition/specialise
the application of the wildcard. I added this because the wildcard is
applied globally and the addition of a single wildcard would cause
additional work to be preformed for every configured bean which would
have a detrimental effect on start-up time.
The optional class attribute provided a quick match criteria that allows
the wildcard to be targeted to specific set of beans. Because I was not
interested in identity matching I figured that the simple name was
sufficient along with it being easier to remember/find and type.
I have no objection to changing to use the fully qualified name. Having
the feature work for custom beans is no match to the rational of brevity
:-)
Hope this helps,
Gary.
-----Original Message-----
From: Andrea Smyth [mailto:andrea.smyth@iona.com]
Sent: 01 June 2007 19:11
To: cxf-dev@incubator.apache.org
Subject: wildcard bean definitions
Hi all,
The support for wildcard beans that was introduced a while ago only
seems to apply to standard beans, i.e.
{http://www.springframework.org/schema/beans}bean elements, but not to
custom beans such as
{http://cxf.apache.org/transports/http/configuration}conduit elements.
With more and more use of Spring's support for custom schema it would be
good to support this for custom beans also:
<h:conduit name="*.http-conduit">
<h:client ConnectionTimeout="79"/> </h:conduit>
The problem seems to be that the wildcard definitions map uses the
simple class name as the key. If line 152 in ConfigurerImpl:
String className = beanInstance.getClass().getSimpleName();
is changed to use the qualified name, the above works as expected.
What was the rationale for choosing the simple name as a key? Are there
any objections to changing this to using the qualified class name?
Note that for custom beans that class name never needs to be specified
- the bean definition parser provides it (and it would result in invalid
xml unless a "class" attribute was actually defined for a custom bean).
Cheers,
Andrea.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland