[webbeans-dev] Re: Rough draft proposal for resource injection

Gavin King gavin at hibernate.org
Thu Jan 8 21:58:21 EST 2009


OK, gotcha. It's cos the XML needs to be parsed a bit differently, and
the resulting information passed back to Bean.

Hrrrrm. Scott, I agree that this makes sense, but I'm looking at the
size of my TODO list and thinking that this could wait until the next
rev of web beans...

On Fri, Jan 9, 2009 at 5:23 AM, Scott Ferguson <ferg at caucho.com> wrote:

> This fragment defines a Bean (with the registered type DataSource).  To
> create the Bean and process the XML, though, some code needs to understand
> javax.annotation.Resource.  The code that understands <ann:Resource> and
> which generates the DataSource Bean can (and should) be encapsulated and
> modularized.  Nothing in the current spec has that capability, i.e. it's not
> captured by the Bean concept.
>
> To see this, note that <ann:Resource> is currently forbidden by the spec,
> because it's not annotated by something like @BindingType.  In other words,
> the example is doing something unique beyond the capabilities of the rest of
> the spec.
>
> Or, in a different way, the spec definines the behavior of ann:Resource, and
> ejb:EJB, not sqlx:DataSource.   If the spec defined sqlx:DataSource
> directly, it would be a Bean, but because you're defining ann:Resource to
> choose a Bean type for sqlx:DataSource, it's something different.
>
> Or, another way, <sqlx:DataSource> is not a simple bean, and the
> <ann:Resource> specifies what kind of Bean it is.
>
> -- Scott
>
>
>>
>>
>> I don't understand what we need it for.
>>
>> I feel like Bean already provides sufficient pluggability...
>>
>>
>>> Second, the JavaEE annotation types should be defined in their own
>>> namespace
>>> for modularity and consistency, not the WebBeans namespace.
>>>
>>> <xsql:DataSource xmlns:xsql="urn:java:javax.sql">
>>> <ann:Resource xmlns:ann="urn:java:javax.annotation">
>>>   ...
>>> </ann:...>
>>>
>>> <my:Foo xmlns:my="urn:java:com.foo.my">
>>> <ejb:EJB xmlns:ejb="urn:java:javax.ejb">
>>>
>>> <jms:Queue xmlns:jms="urn:java:javax.jms">
>>> ...
>>
>> I'm OK with that if others are.
>>
>>
>>
>> --
>> Gavin King
>> gavin.king at gmail.com
>> http://in.relation.to/Bloggers/Gavin
>> http://hibernate.org
>> http://seamframework.org
>>
>>
>
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list