Hi,
I've got this extension which I'm using to explicitly register all of the managed
beans used by Weld Java SE:
public class WeldSEBeanRegistrant implements Extension
{
private final ClassTransformer transformer = new ClassTransformer(new TypeStore());
public void registerWeldSEBeans(@Observes AfterBeanDiscovery event, BeanManagerImpl
beanManager)
{
addBean(ShutdownManager.class, beanManager, event);
addBean(ParametersFactory.class, beanManager, event);
}
private void addBean(final Class<?> klass, BeanManagerImpl beanManager,
AfterBeanDiscovery event)
{
WeldClass<?> weldClass = WeldClassImpl.of(klass, transformer);
ManagedBean<?> bean = ManagedBean.of(weldClass, beanManager);
event.addBean(bean);
bean.initialize( ___environment___);
}
}
My question is: where should I get the value for ___environment___ from? Is there common
idiom for this?
I feel like if I could get access to the 'parent' variable at WeldBootstrap:199 I
could call it.getBeanDeployer().getEnvironment() ... but I could be way off!
Cheers,
Pete.