Package com.atlassian.bamboo.spring
Class BambooProxyFactoryBean
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AdvisedSupport
org.springframework.aop.framework.ProxyCreatorSupport
org.springframework.aop.framework.ProxyFactoryBean
com.atlassian.bamboo.spring.BambooProxyFactoryBean
- All Implemented Interfaces:
Serializable,org.springframework.aop.framework.Advised,org.springframework.aop.TargetClassAware,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.FactoryBean<Object>,org.springframework.beans.factory.InitializingBean
public class BambooProxyFactoryBean
extends org.springframework.aop.framework.ProxyFactoryBean
implements org.springframework.beans.factory.InitializingBean
ProxyFactoryBean, when used with target bean reference, is unable to determine the produced object type during autowiring type checks.
This results in a full instantiation of the Factory and the singleton object it produces, resulting in a dependency resultion storm across all bean
factories when the first autowired dependency is being resolved.
There are several solutions to this:
* use targetName instead of target (not ideal, because you cannot inline the bean definition)
* all top level dependencies on the target have to be made lazy
* this class, which relies on the fact that the object type check has to use injection on the constructor to create the factory for the type check.
The constructors is wired with the class name and is able to present it during the type check.- See Also:
-
Field Summary
Fields inherited from class org.springframework.aop.framework.ProxyFactoryBean
GLOBAL_SUFFIX, loggerFields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCEFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.aop.framework.ProxyFactoryBean
adviceChanged, getProxy, isSingleton, setAdvisorAdapterRegistry, setAutodetectInterfaces, setBeanClassLoader, setBeanFactory, setFrozen, setInterceptorNames, setProxyClassLoader, setProxyInterfaces, setSingleton, setTargetNameMethods inherited from class org.springframework.aop.framework.ProxyCreatorSupport
addListener, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactoryMethods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisorCount, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toStringMethods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClassMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy
-
Constructor Details
-
BambooProxyFactoryBean
-
-
Method Details
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<Object>- Overrides:
getObjectTypein classorg.springframework.aop.framework.ProxyFactoryBean
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<Object>- Overrides:
getObjectin classorg.springframework.aop.framework.ProxyFactoryBean- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-