On Wed, Nov 10, 2010 at 3:52 PM, Clint Popetz <cpopetz(a)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