public Object getFieldValue(final Field field, final Object fieldOwner) { if (supportsField(field)) { String beanName = getBeanName(field); if (beanName == null) { return null; } SpringBeanLocator locator = new SpringBeanLocator(beanName, field.getType(), contextLocator); // only check the cache if the bean is a singleton Object cachedValue = cache.get(locator); if (cachedValue != null) { return cachedValue; } final Object target; if (wrapInProxies) { target = LazyInitProxyFactory.createProxy(field.getType(), locator); } else { target = locator.locateProxyTarget(); } // only put the proxy into the cache if the bean is a singleton if (locator.isSingletonBean()) { cache.put(locator, target); } return target; } return null; }
public SkillsRepository getSkillsRepository() { return (SkillsRepository) LazyInitProxyFactory.createProxy(SkillsRepository.class, bean("skillsRepository")); }