jodd.petite
Class ScopedProxyManager

java.lang.Object
  extended by jodd.petite.ScopedProxyManager

public class ScopedProxyManager
extends java.lang.Object

Manager 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
protected  jodd.proxetta.ProxyAspect aspect
           
protected  java.util.Map<java.lang.String,java.lang.Object> proxies
           
protected  java.util.Map<java.lang.Class,java.lang.Class> proxyClasses
           
 
Constructor Summary
ScopedProxyManager()
           
 
Method Summary
protected  java.lang.String createMixingMessage(BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)
          Creates mixed scope message.
protected  java.lang.Object createScopedProxyBean(PetiteContainer petiteContainer, BeanDefinition refBeanDefinition)
          Creates scoped proxy bean for given bean definition.
 java.lang.Object lookupValue(PetiteContainer petiteContainer, BeanDefinition targetBeanDefinition, BeanDefinition refBeanDefinition)
          Returns scoped proxy bean if injection scopes are mixed on some injection point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aspect

protected jodd.proxetta.ProxyAspect aspect

proxyClasses

protected java.util.Map<java.lang.Class,java.lang.Class> proxyClasses

proxies

protected java.util.Map<java.lang.String,java.lang.Object> proxies
Constructor Detail

ScopedProxyManager

public ScopedProxyManager()
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 return null if 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.



Copyright © 2003-2013 Jodd Team