[weld-dev] A significantly negative article on Weld

Mark Struberg struberg at yahoo.de
Wed Nov 10 16:04:01 EST 2010


Yes, you can either do it via an Extension or much easier via a @Produces method ;)

In any case, it wont work without adding code or configuration!

LieGrue,
strub

--- On Wed, 11/10/10, Dan Allen <dan.j.allen at gmail.com> wrote:

From: Dan Allen <dan.j.allen at gmail.com>
Subject: Re: [weld-dev] A significantly negative article on Weld
To: "Clint Popetz" <cpopetz at gmail.com>
Cc: "Mark Struberg" <struberg at yahoo.de>, "Samuel Mendenhall" <samuel.mendenhall at gmail.com>, "Pete Muir" <pmuir at bleepbleep.org.uk>, "Weld Dev List" <weld-dev at lists.jboss.org>
Date: Wednesday, November 10, 2010, 9:01 PM

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





      



More information about the weld-dev mailing list