ch.elca.el4j.core.aop
Class IntelligentAdvisorAutoProxyCreator

java.lang.Object
  extended by org.springframework.aop.framework.ProxyConfig
      extended by org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
          extended by org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
              extended by org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
                  extended by ch.elca.el4j.core.aop.IntelligentAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, InitializingBean, Ordered

public class IntelligentAdvisorAutoProxyCreator
extends DefaultAdvisorAutoProxyCreator
implements InitializingBean

Intelligent autoproxy creator for advisors. Will not create a new proxy for a given bean if this bean is already a proxy bean. All class members (plus getter and setter for them) do just take place in this class, because class AbstractAutoProxyCreator hides them.

Author:
Martin Zeltner (MZE)
See Also:
Serialized Form
File-location:
IntelligentAdvisorAutoProxyCreator
Last check-in date:
2010-11-02 11:44:37 +0100 (Di, 02. Nov 2010) by swisswheel for revision 4204

Field Summary
 
Fields inherited from class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
SEPARATOR
 
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
IntelligentAdvisorAutoProxyCreator()
           
 
Method Summary
 void afterPropertiesSet()
          
protected  Object createProxy(Class beanClass, String beanName, Object[] specificInterceptors, TargetSource targetSource)
          Will not create a new proxy for a given bean if this bean is already a proxy bean.
protected static Class deproxyBeanClass(Class beanClass, String beanName, BeanFactory beanFactory)
          Finds out if the given class is a generated one of a proxy.
protected  Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource)
          Here we additionally de-proxy beans (to avoid that certain applications of interceptors fail).
protected  AdvisorAdapterRegistry getAdvisorAdapterRegistry()
           
protected  String[] getInterceptorNames()
           
protected  boolean isApplyCommonInterceptorsFirst()
           
 boolean isForceUseOfAdvisorNamePrefix()
           
 void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
          COPYIED FROM SUPERCLASS!
 void setApplyCommonInterceptorsFirst(boolean applyCommonInterceptorsFirst)
          COPYIED FROM SUPERCLASS!
 void setForceUseOfAdvisorNamePrefix(boolean forceUseOfAdvisorNamePrefix)
           
 void setInterceptorNames(String[] interceptorNames)
          COPYIED FROM SUPERCLASS!
 
Methods inherited from class org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
getAdvisorBeanNamePrefix, isEligibleAdvisorBean, isUsePrefix, setAdvisorBeanNamePrefix, setBeanName, setUsePrefix
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, extendAdvisors, findAdvisorsThatCanApply, findCandidateAdvisors, findEligibleAdvisors, initBeanFactory, setBeanFactory, sortAdvisors
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
 
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntelligentAdvisorAutoProxyCreator

public IntelligentAdvisorAutoProxyCreator()
Method Detail

createProxy

protected Object createProxy(Class beanClass,
                             String beanName,
                             Object[] specificInterceptors,
                             TargetSource targetSource)
Will not create a new proxy for a given bean if this bean is already a proxy bean.

Overrides:
createProxy in class AbstractAutoProxyCreator

getAdvicesAndAdvisorsForBean

protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass,
                                                String beanName,
                                                TargetSource targetSource)
Here we additionally de-proxy beans (to avoid that certain applications of interceptors fail).

Overrides:
getAdvicesAndAdvisorsForBean in class AbstractAdvisorAutoProxyCreator

deproxyBeanClass

protected static Class deproxyBeanClass(Class beanClass,
                                        String beanName,
                                        BeanFactory beanFactory)
Finds out if the given class is a generated one of a proxy. If yes, the original class will be returned.

Parameters:
beanClass - Is the class of the bean.
beanName - Is the name opf the bean.
beanFactory - Is the beanFactory (to be able to keep this method static).
Returns:
Returns the original class if it is a proxy class. Else the given class will be returned.

getInterceptorNames

protected String[] getInterceptorNames()
Returns:
Returns the interceptorNames.

setInterceptorNames

public void setInterceptorNames(String[] interceptorNames)
COPYIED FROM SUPERCLASS! Added to have access to the interceptor names.

Overrides:
setInterceptorNames in class AbstractAutoProxyCreator

getAdvisorAdapterRegistry

protected AdvisorAdapterRegistry getAdvisorAdapterRegistry()
Returns:
Returns the advisorAdapterRegistry.

setAdvisorAdapterRegistry

public void setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
COPYIED FROM SUPERCLASS! Added to have access to the interceptor names.

Overrides:
setAdvisorAdapterRegistry in class AbstractAutoProxyCreator

isApplyCommonInterceptorsFirst

protected boolean isApplyCommonInterceptorsFirst()
Returns:
Returns the applyCommonInterceptorsFirst.

setApplyCommonInterceptorsFirst

public void setApplyCommonInterceptorsFirst(boolean applyCommonInterceptorsFirst)
COPYIED FROM SUPERCLASS! Set whether the common interceptors should be applied before bean-specific ones. Default is "true"; else, bean-specific interceptors will get applied first.

Overrides:
setApplyCommonInterceptorsFirst in class AbstractAutoProxyCreator
Parameters:
applyCommonInterceptorsFirst - See method description.

isForceUseOfAdvisorNamePrefix

public boolean isForceUseOfAdvisorNamePrefix()
Returns:
Returns the forceUseOfAdvisorNamePrefix.

setForceUseOfAdvisorNamePrefix

public void setForceUseOfAdvisorNamePrefix(boolean forceUseOfAdvisorNamePrefix)
Parameters:
forceUseOfAdvisorNamePrefix - Is the forceUseOfAdvisorNamePrefix to set.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception


Copyright © 2005-2011 ELCA. All Rights Reserved.