Package jodd.petite
Class ScopedProxyManager
- java.lang.Object
-
- jodd.petite.ScopedProxyManager
-
public class ScopedProxyManager extends java.lang.ObjectManager for mixing scopes. 'Mixed scopes' is the situation when 'smaller' scope is injected into the 'bigger' scope. Trivial example is when prototype scoped bean is injected into singleton bean.Mixed scopes are handled using smart factory/proxy-wrapper singletons instead of 'smaller' scoped beans. On each method call of wrapped factory, smaller scoped bean will be looked up and that instance will be used for passing by the method call.
Manager also has to determine if scope combination is candidate for mixed scopes.
-
-
Field Summary
Fields Modifier and Type Field Description protected jodd.proxetta.ProxyAspectaspectprotected java.util.Map<java.lang.String,java.lang.Object>proxiesprotected jodd.util.TypeCache<java.lang.Class>proxyClasses
-
Constructor Summary
Constructors Constructor Description ScopedProxyManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateMixingMessage(BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)Creates mixed scope message.protected java.lang.ObjectcreateScopedProxyBean(PetiteContainer petiteContainer, BeanDefinition refBeanDefinition)Creates scoped proxy bean for given bean definition.java.lang.ObjectlookupValue(PetiteContainer petiteContainer, BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)Returns scoped proxy bean if injection scopes are mixed on some injection point.
-
-
-
Method Detail
-
lookupValue
public java.lang.Object lookupValue(PetiteContainer petiteContainer, BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)
Returns scoped proxy bean if injection scopes are mixed on some injection point. May returnnullif mixing scopes is not detected.
-
createMixingMessage
protected java.lang.String createMixingMessage(BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)
Creates mixed scope message.
-
createScopedProxyBean
protected java.lang.Object createScopedProxyBean(PetiteContainer petiteContainer, BeanDefinition refBeanDefinition)
Creates scoped proxy bean for given bean definition.
-
-