users@glassfish.java.net

Re: Injecting BeanManager into CDI portable extension: possible, or GF bug?

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 Jul 2010 11:03:18 PDT

Well, it looks like I can have the BeanManager "injected" into my afterDeploymentValidation() method by simply adding it as a second parameter, like this:

[code]public void afterDeploymentValidation(final AfterDeploymentValidation event, final BeanManager beanManager) {

}[/code]

(Note the absence of the @Inject annotation.)

The CDI specification section 11.5.3 had my answer. I would think, though, that the presence or absence of @Inject wouldn't matter...? I must say that when CDI works it's great, but oftentimes it's a wee bit too magic-oriented for me. :-)

Best,
Laird
[Message sent by forum member 'ljnelson']

http://forums.java.net/jive/thread.jspa?messageID=477374