[webbeans-dev] non-contextual managed bean creation

Pete Muir pmuir at redhat.com
Thu Aug 13 10:36:11 EDT 2009


On 13 Aug 2009, at 15:22, Kenneth Saks wrote:

>
> On Aug 12, 2009, at 6:02 PM, Pete Muir wrote:
>
>> Moving to webbeans-dev. Sorry for the delay in replying...
>>
>> On 11 Aug 2009, at 16:19, Kenneth Saks wrote:
>>
>>> I need to implement the java:global lookup logic defined by the EE  
>>> 6 Managed Bean spec for the 299-enabled case.    My starting point  
>>> is a bean class.  What API/SPI(s) do I call to create a non- 
>>> contextual managed bean instance that has been injected(with both  
>>> 299-style and EE-style dependencies) and has had  post-construct  
>>> called?
>>
>> I wrote this generic FAQ http://www.seamframework.org/Documentation/HowDoIDoNoncontextualInjectionForAThirdpartyFramework 
>>  which describes the process you need to follow.
>>
>> The only difference is that currently inject() doesn't inject any  
>> EE style dependencies. This is a bug in the RI. https://jira.jboss.org/jira/browse/WBRI-352
>
> Looks good, thanks.    The blog mentions "java:comp/BeanManager",  
> which I had bean meaning to follow-up on.  My assumption is that the  
> GlassFish container will implement the "java:comp/BeanManager"  
> naming entry and use an internal webbeans SPI to acquire the  
> BeanManager that gets returned from the lookup.

Yes, mine too :-)

For example, we do this in JBoss using a deployer http://anonsvn.jboss.org/repos/jbossas/projects/webbeans-ri-int/trunk/deployer/src/main/java/org/jboss/webbeans/integration/deployer/env/WebBeansJndiBinder.java

This uses the ManagerObjectFactory we provide in WebBeans http://anonsvn.jboss.org/repos/webbeans/ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/ManagerObjectFactory.java 
. Alternatively, the Bootstrap class allows you to call getManager().  
You could associate the result of this.



More information about the weld-dev mailing list