[weld-dev] A significantly negative article on Weld

Dan Allen dan.j.allen at gmail.com
Wed Nov 10 16:01:14 EST 2010


On Wed, Nov 10, 2010 at 3:52 PM, Clint Popetz <cpopetz at gmail.com> wrote:

> If you go that route, you lose the ability to inject instances of
> third party classes without defining a @Produces method.  That may be
> preferable to the existing problems caused by default @Dependents, but
> I wanted to point it out for clarity.
>

Actually, there is one other approach to registering a class from a non-bean
archive (no beans.xml), which is used in Weld Extensions. You can add the
annotated types explicitly in an extension:

    void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event,
BeanManager beanManager)
   {

 event.addAnnotatedType(beanManager.createAnnotatedType(BeanIAm.class));
   }

-Dan

-- 
Dan Allen
Principal 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20101110/9283033d/attachment.html 


More information about the weld-dev mailing list