Example:
IFieldValueFactory factory = new AnnotProxyFieldValueFactory(contextLocator); field = obj.getClass().getDeclaredField("dependency"); IDependency dependency = (IDependency)factory.getFieldValue(field, obj);In the example above the
dependency
object returned is a lazy init proxy that will look up the actual IDependency bean from spring context upon first access to one of the methods. This class will also cache any produced proxies so that the same proxy is always returned for the same spring dependency. This helps cut down on session size beacause proxies for the same dependency will not be serialized twice. @see LazyInitProxyFactory @see SpringBean @see SpringBeanLocator @author Igor Vaynberg (ivaynberg) @author Istvan Devai
|
|