protected Object getInstance() { Bean<X> bean = getParentBean(); Class<?> type = bean.getBeanClass(); if (_isIfExists) { Class scopeType = bean.getScope(); Context context = _beanManager.getContext(scopeType); if (context != null) return context.get(bean); else return null; } CreationalContext env = _beanManager.createCreationalContext(getParentBean()); return _beanManager.getReference(getParentBean(), type, env); }