public void load(@Observes AfterDeploymentValidation event, BeanManager beanManager) { for (Bean<?> bean : eagerBeansList) { // note: toString() is important to instantiate the bean beanManager .getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(bean)) .toString(); } }
/** * Retrieve the bean that matches the key * * @return Return the object identified by the key. * @param key The key identifying the bean. */ public Object getBean(String key) { BeanWrapper beanWrapper = (BeanWrapper) beanManager.getBean(key); if (beanWrapper == null) { return beanWrapper; } return beanWrapper.getProxy(); }
/** * This method returns the list of keys. * * @return The list of beans managed by this object. */ public Set getKeys() { return beanManager.getKeys(); }