[webbeans-dev] Re: Rough draft proposal for resource injection
Gavin King
gavin at hibernate.org
Thu Jan 8 10:24:33 EST 2009
Here's a second draft (still rough) that incorporates persistence
contexts and units into the same approach.
On Fri, Jan 9, 2009 at 12:47 AM, Gavin King <gavin at hibernate.org> wrote:
> Everyone, please take a look at section 3.6 of this spec draft, which
> defines a proposal for EE resource injection.
>
> Basically, what I've proposed is that web beans would let you rewrite
> the following:
>
> @Resource(mappedName="customerDatabase") Datasource ds;
>
> as:
>
> @CustomerDatabase Datasource ds;
>
> <javaxsql:Datasource>
> <Resource>
> <mappedName>customerDatabase</mappedName>
> </Resource>
> <myapp:CustomerDatabase/>
> </javaxsql:Datasource>
>
> and:
>
> @EJB(ejbLink="somejar#Foo") Foo foo;
>
> as:
>
> @Current Foo foo;
>
> <myapp:Foo>
> <EJB>
> <ejbLink>somejar#Foo</ejbLink>
> </EJB>
> </myapp:Foo>
>
> and:
>
> @WebServiceRef(name="barbar", wsdlLocation="barbarbar") Bar bar;
>
> as:
>
> @Current Bar bar;
>
> <myapp:Bar>
> <WebServiceRef>
> <name>barbar</name>
> <wsdlLocation>barbarbar</wsdLocation>
> </WebServiceRef>
> </myapp:Bar>
>
> So this proposal is just basically an indirection around the
> pre-existing semantics of Java EE injection, that gives you all the
> nice Web Beans typesafety.
>
> This seems a really nice, easy way to define this stuff, and I love
> how the XML looks.
>
> --
> Gavin King
> gavin.king at gmail.com
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org
>
--
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Web Beans 20090109.pdf
Type: application/pdf
Size: 538284 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/weld-dev/attachments/20090109/eb637408/attachment.pdf
More information about the weld-dev
mailing list