131132133134135136137138139140141
{ 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()) {
146147148149150151152153154155156
Object target; try { // check whether there is a bean with the provided properties target = locator.locateProxyTarget(); } catch (IllegalStateException isx) { if (required) {
124125126127128129130131132133134
132133134135136137138139140141142
114115116117118119120121122123124
129130131132133134135136137138139
5859606162636465666768
Bean bean = new Bean(); ctx.putBean("bean", bean); SpringBeanLocator locator = new SpringBeanLocator(Bean.class, ctxLocator); assertTrue(locator.locateProxyTarget() == bean); } /** * tests if lookup by class is still working after deserialization */