Top Description Fields Constructors Methods
org.springframework.aop.framework

public Class ProxyProcessorSupport

extends ProxyConfig
implements Ordered, BeanClassLoaderAware, AopInfrastructureBean
Class Inheritance
All Implemented Interfaces
org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.Aware, org.springframework.core.Ordered
Known Direct Subclasses
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator, org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor
Annotations
@SuppressWarnings:serial
Imports
java.io.Closeable, org.springframework.beans.factory.Aware, .BeanClassLoaderAware, .DisposableBean, .InitializingBean, org.springframework.core.Ordered, org.springframework.lang.Nullable, org.springframework.util.ClassUtils, .ObjectUtils

Base class with common functionality for proxy processors, in particular ClassLoader management and the evaluateProxyInterfaces algorithm.
Author
Juergen Hoeller
Since
4.1
See Also
AbstractAdvisingBeanPostProcessor, org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator

Field Summary

Modifier and TypeField and Description
private boolean
private int
order

This should run after all other processors, so that it can just add an advisor to existing proxies rather than double-proxy.

private ClassLoader
Inherited from org.springframework.aop.framework.ProxyConfig:
exposeProxyopaque

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
evaluateProxyInterfaces(Class<?>
the class of the bean
beanClass
,
ProxyFactory
the ProxyFactory for the bean
proxyFactory
)

Check the interfaces on the given bean class and apply them to the ProxyFactory, if appropriate.

public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.
protected ClassLoader
getProxyClassLoader()

Return the configured proxy ClassLoader for this processor.

protected boolean

Returns:

whether the given interface is just a container callback
isConfigurationCallbackInterface
(Class<?>
the interface to check
ifc
)

Determine whether the given interface is just a container callback and therefore not to be considered as a reasonable proxy interface.

protected boolean

Returns:

whether the given interface is an internal language interface
isInternalLanguageInterface
(Class<?>
the interface to check
ifc
)

Determine whether the given interface is a well-known internal language interface and therefore not to be considered as a reasonable proxy interface.

public void
setBeanClassLoader(ClassLoader
the owning class loader
classLoader
)

Implements org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Callback that supplies the bean class loader to a bean instance.
public void
setOrder(int
the ordering value
order
)

Set the ordering which will apply to this processor's implementation of Ordered, used when applying multiple processors.

public void
setProxyClassLoader(ClassLoader classLoader)

Set the ClassLoader to generate the proxy class in.

Default is the bean ClassLoader, i.e. the ClassLoader used by the containing org.springframework.beans.factory.BeanFactory for loading all bean classes.

Inherited from org.springframework.aop.framework.ProxyConfig:
copyFromisExposeProxyisFrozenisOpaqueisOptimizeisProxyTargetClasssetExposeProxysetFrozensetOpaquesetOptimizesetProxyTargetClasstoString

Field Detail

classLoaderConfiguredback to summary
private boolean classLoaderConfigured
orderback to summary
private int order

This should run after all other processors, so that it can just add an advisor to existing proxies rather than double-proxy.

proxyClassLoaderback to summary
private ClassLoader proxyClassLoader
Annotations
@Nullable

Constructor Detail

ProxyProcessorSupportback to summary
public ProxyProcessorSupport()

Method Detail

evaluateProxyInterfacesback to summary
protected void evaluateProxyInterfaces(Class<?> beanClass, ProxyFactory proxyFactory)

Check the interfaces on the given bean class and apply them to the ProxyFactory, if appropriate.

Calls isConfigurationCallbackInterface and isInternalLanguageInterface to filter for reasonable proxy interfaces, falling back to a target-class proxy otherwise.

Parameters
beanClass:Class<?>

the class of the bean

proxyFactory:ProxyFactory

the ProxyFactory for the bean

getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

Get the order value of this object.

Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

Same order values will result in arbitrary sort positions for the affected objects.

Returns:int

the order value

Annotations
@Override
getProxyClassLoaderback to summary
protected ClassLoader getProxyClassLoader()

Return the configured proxy ClassLoader for this processor.

Annotations
@Nullable
isConfigurationCallbackInterfaceback to summary
protected boolean isConfigurationCallbackInterface(Class<?> ifc)

Determine whether the given interface is just a container callback and therefore not to be considered as a reasonable proxy interface.

If no reasonable proxy interface is found for a given bean, it will get proxied with its full target class, assuming that as the user's intention.

Parameters
ifc:Class<?>

the interface to check

Returns:boolean

whether the given interface is just a container callback

isInternalLanguageInterfaceback to summary
protected boolean isInternalLanguageInterface(Class<?> ifc)

Determine whether the given interface is a well-known internal language interface and therefore not to be considered as a reasonable proxy interface.

If no reasonable proxy interface is found for a given bean, it will get proxied with its full target class, assuming that as the user's intention.

Parameters
ifc:Class<?>

the interface to check

Returns:boolean

whether the given interface is an internal language interface

setBeanClassLoaderback to summary
public void setBeanClassLoader(ClassLoader classLoader)

Implements org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Doc from org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Callback that supplies the bean class loader to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean#afterPropertiesSet() method or a custom init-method.

Parameters
classLoader:ClassLoader

the owning class loader

Annotations
@Override
setOrderback to summary
public void setOrder(int order)

Set the ordering which will apply to this processor's implementation of Ordered, used when applying multiple processors.

The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.

Parameters
order:int

the ordering value

setProxyClassLoaderback to summary
public void setProxyClassLoader(ClassLoader classLoader)

Set the ClassLoader to generate the proxy class in.

Default is the bean ClassLoader, i.e. the ClassLoader used by the containing org.springframework.beans.factory.BeanFactory for loading all bean classes. This can be overridden here for specific proxies.