java.lang.Objectorg.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AdvisedSupport
org.springframework.aop.framework.ProxyCreatorSupport
org.springframework.aop.framework.ProxyFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, FactoryBean, Advised, Serializable
MethodInterceptors and Advisors are identified by a list of bean names in the current bean factory, specified through the "interceptorNames" property. The last entry in the list can be the name of a target bean or a org.springframework.aop.TargetSource ; however, it is normally preferable to use the "targetName"/"target"/"targetSource" properties instead.
Global interceptors and advisors can be added at the factory level. The specified ones are expanded in an interceptor list where an "xxx*" entry is included in the list, matching the given prefix with the bean names (e.g. "global*" would match both "globalBean1" and "globalBean2", "*" all defined interceptors). The matching interceptors get applied according to their returned order value, if they implement the org.springframework.core.Ordered interface.
Creates a JDK proxy when proxy interfaces are given, and a CGLIB proxy for the actual target class if not. Note that the latter will only work if the target class does not have final methods, as a dynamic subclass will be created at runtime.
It's possible to cast a proxy obtained from this factory to Advised , or to obtain the ProxyFactoryBean reference and programmatically manipulate it. This won't work for existing prototype references, which are independent. However, it will work for prototypes subsequently obtained from the factory. Changes to interception will work immediately on singletons (including existing references). However, to change interfaces or target it's necessary to obtain a new instance from the factory. This means that singleton instances obtained from the factory do not have the same object identity. However, they do have the same interceptors and target, and changing any reference will change all objects.
Rod - JohnsonJuergen - Hoeller| Field Summary | ||
|---|---|---|
| public static final String | GLOBAL_SUFFIX | This suffix in a value in an interceptor list indicates to expand globals. |
| protected final Log | logger | |
| Fields inherited from org.springframework.aop.framework.AdvisedSupport: |
|---|
| EMPTY_TARGET_SOURCE, targetSource, advisorChainFactory |
| Fields inherited from org.springframework.aop.framework.ProxyConfig: |
|---|
| opaque, exposeProxy |
| Method from org.springframework.aop.framework.ProxyFactoryBean Summary: |
|---|
| adviceChanged, createCompositeInterface, getObject, getObjectType, getProxy, isSingleton, setAdvisorAdapterRegistry, setAutodetectInterfaces, setBeanClassLoader, setBeanFactory, setFrozen, setInterceptorNames, setProxyClassLoader, setProxyInterfaces, setSingleton, setTargetName |
| Methods from org.springframework.aop.framework.ProxyCreatorSupport: |
|---|
| addListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory |
| Methods from org.springframework.aop.framework.ProxyConfig: |
|---|
| copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.aop.framework.ProxyFactoryBean Detail: |
|---|
|
The default implementation builds a JDK proxy class for the given interfaces. |
getObject() for a proxy. |
|
The default implementation uses a |
|
|
Default is "true". Turn this flag off to create a CGLIB proxy for the full target class if no interfaces specified. |
|
|
|
The referenced beans should be of type Interceptor, Advisor or Advice The last entry in the list can be the name of any bean in the factory. If it's neither an Advice nor an Advisor, a new SingletonTargetSource is added to wrap it. Such a target bean cannot be used if the "target" or "targetSource" or "targetName" property is set, in which case the "interceptorNames" array must contain only Advice/Advisor bean names. NOTE: Specifying a target bean as final name in the "interceptorNames" list is deprecated and will be removed in a future Spring version. Use the "targetName" property instead. |
Default is the bean ClassLoader, i.e. the ClassLoader used by the containing BeanFactory for loading all bean classes. This can be overridden here for specific proxies. |
This is essentially equivalent to the "setInterfaces" method, but mirrors TransactionProxyFactoryBean's "setProxyInterfaces". |
|
You can also specify a target object or a TargetSource object directly, via the "target"/"targetSource" property, respectively. |