AbstractSingletonProxyFactoryBean (Spring Framework 7.0.8 API)
JavaScript is disabled on your browser.
Class AbstractSingletonProxyFactoryBean
java.lang.Object<br>org.springframework.aop.framework.ProxyConfig<br>org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
All Implemented Interfaces:<br>Serializable, Aware, BeanClassLoaderAware, FactoryBeanObject>, InitializingBean
Direct Known Subclasses:<br>CacheProxyFactoryBean, TransactionProxyFactoryBean
public abstract class AbstractSingletonProxyFactoryBean<br>extends ProxyConfig<br>implements FactoryBeanObject>, BeanClassLoaderAware, InitializingBean
Convenient superclass for FactoryBean types that produce singleton-scoped<br>proxy objects.
Manages pre- and post-interceptors (references, rather than<br>interceptor names, as in ProxyFactoryBean) and provides<br>consistent interface management.
Since:<br>2.0<br>Author:<br>Juergen Hoeller<br>See Also:
Serialized Form
Field Summary
Fields inherited from interface FactoryBean
OBJECT_TYPE_ATTRIBUTE
Constructor Summary
Constructors
Constructor
Description
AbstractSingletonProxyFactoryBean()
Method Summary
All MethodsInstance MethodsAbstract MethodsConcrete Methods
Modifier and Type
Method
Description
void
afterPropertiesSet()
Invoked by the containing BeanFactory after it has set all bean properties<br>and satisfied BeanFactoryAware, ApplicationContextAware etc.
protected abstract Object
createMainInterceptor()
Create the "main" interceptor for this proxy factory bean.
protected TargetSource
createTargetSource(Object target)
Determine a TargetSource for the given target (or TargetSource).
Object
getObject()
Return an instance (possibly shared or independent) of the object<br>managed by this factory.
@Nullable Class
getObjectType()
Return the type of object that this FactoryBean creates,<br>or null if not known in advance.
final boolean
isSingleton()
Is the object managed by this factory a singleton? That is,<br>will FactoryBean.getObject() always return the same object<br>(a reference that can be cached)?
protected void
postProcessProxyFactory(ProxyFactory proxyFactory)
A hook for subclasses to post-process the ProxyFactory<br>before creating the proxy instance with it.
void
setAdvisorAdapterRegistry(AdvisorAdapterRegistry advisorAdapterRegistry)
Specify the AdvisorAdapterRegistry to use.
void
setBeanClassLoader(ClassLoader classLoader)
Callback that supplies the bean class loader to<br>a bean instance.
void
setPostInterceptors(Object[] postInterceptors)
Set additional interceptors (or advisors) to be applied after the<br>implicit transaction interceptor.
void
setPreInterceptors(Object[] preInterceptors)
Set additional interceptors (or advisors) to be applied before the<br>implicit transaction interceptor, for example, a PerformanceMonitorInterceptor.
void
setProxyClassLoader(ClassLoader classLoader)
Set the ClassLoader to generate the proxy class in.
void
setProxyInterfaces(Class[] proxyInterfaces)
Specify the set of interfaces being proxied.
void
setTarget(Object target)
Set the target object, that is, the bean to be wrapped with a transactional proxy.
Methods inherited from class ProxyConfig
copyDefault, copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Details
()"><br>AbstractSingletonProxyFactoryBean
public AbstractSingletonProxyFactoryBean()
Method Details
setTarget
public void setTarget(Object target)
Set the target object, that is, the bean to be wrapped with a transactional proxy.<br>The target may be any object, in which case a SingletonTargetSource will<br>be created. If it is a TargetSource, no wrapper TargetSource is created:<br>This enables the use of a pooling or prototype TargetSource etc.
See Also:
TargetSource
SingletonTargetSource
LazyInitTargetSource
PrototypeTargetSource
CommonsPool2TargetSource
setProxyInterfaces
public void setProxyInterfaces(Class[] proxyInterfaces)
Specify the set of interfaces being proxied.<br>If not specified (the default), the AOP infrastructure works<br>out which interfaces need proxying by analyzing the target,<br>proxying all the interfaces that the target object implements.
setPreInterceptors
public void setPreInterceptors(Object[] preInterceptors)
Set additional interceptors (or advisors) to be applied before the<br>implicit transaction interceptor, for example, a PerformanceMonitorInterceptor.<br>You may specify any AOP Alliance MethodInterceptors or other<br>Spring AOP Advices, as well as Spring AOP Advisors.
See Also:
PerformanceMonitorInterceptor
setPostInterceptors
public void setPostInterceptors(Object[] postInterceptors)
Set additional interceptors (or advisors) to be applied after the<br>implicit transaction interceptor.<br>You may specify any AOP Alliance MethodInterceptors or other<br>Spring AOP Advices, as well as...