FactoryBean implementation for use to source AOP proxies from a Spring BeanFactory.
Interceptors and Advisors are identified by a list of bean names in the current
bean factory. These beans should be of type Interceptor or Advisor. The last entry
in the list can be the name of any bean in the factory. If it's neither an
Interceptor nor an Advisor, a new SingletonTargetSource is added to wrap it. If it;s
a TargetSource, it is used as this proxy factory's TargetSource. It's normally preferred
to use the "targetSource" property to set the TargetSource. It is not possible to use
both the targetSource property and an interceptor name: this is treated as a
configuration error.
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 Ordered interface. An interceptor name list may not conclude
with a global "xxx*" pattern, as global interceptors cannot invoke targets.
Creates a J2SE proxy when proxy interfaces are given, 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.
Interceptors and Advisors are identified by a list of bean names in the current bean factory. These beans should be of type Interceptor or Advisor. The last entry in the list can be the name of any bean in the factory. If it's neither an Interceptor nor an Advisor, a new SingletonTargetSource is added to wrap it. If it;s a TargetSource, it is used as this proxy factory's TargetSource. It's normally preferred to use the "targetSource" property to set the TargetSource. It is not possible to use both the targetSource property and an interceptor name: this is treated as a configuration error.
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 Ordered interface. An interceptor name list may not conclude with a global "xxx*" pattern, as global interceptors cannot invoke targets.
Creates a J2SE proxy when proxy interfaces are given, 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.