com.atlassian.confluence.spring.transaction.interceptor
Class TargetClassLoaderTransactionProxyFactoryBean
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
org.springframework.transaction.interceptor.TransactionProxyFactoryBean
com.atlassian.confluence.spring.transaction.interceptor.TargetClassLoaderTransactionProxyFactoryBean
- All Implemented Interfaces:
- java.io.Serializable, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
public class TargetClassLoaderTransactionProxyFactoryBean
- extends org.springframework.transaction.interceptor.TransactionProxyFactoryBean
Proxy factory bean that extends TransactionProxyFactoryBean
to use the class loader that the class of the
target object was loaded from. This can be used as a drop-in replacement for TransactionProxyFactoryBean
in situations where the proxy interface is not visible in the current context class loader. In particular, this is
useful for creating transaction-wrapped beans in plugin descriptors.
- Since:
- 2.9
- See Also:
- CONF-7311: java.lang.ClassNotFoundException when plugin
contains a transactionized Spring component,
Serialized Form
Method Summary |
protected java.lang.Object |
getProxy(org.springframework.aop.framework.AopProxy proxy)
Returns the proxy object to expose. |
void |
setTarget(java.lang.Object target)
Set the bean to be wrapped with a transactional proxy. |
Methods inherited from class org.springframework.transaction.interceptor.TransactionProxyFactoryBean |
createMainInterceptor, setBeanFactory, setPointcut, setTransactionAttributes, setTransactionAttributeSource, setTransactionManager |
Methods inherited from class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean |
afterPropertiesSet, createTargetSource, getObject, getObjectType, isSingleton, setAdvisorAdapterRegistry, setBeanClassLoader, setPostInterceptors, setPreInterceptors, setProxyClassLoader, setProxyInterfaces |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.beans.factory.FactoryBean |
getObject, getObjectType, isSingleton |
TargetClassLoaderTransactionProxyFactoryBean
public TargetClassLoaderTransactionProxyFactoryBean()
setTarget
public void setTarget(java.lang.Object target)
- Set the bean to be wrapped with a transactional proxy.
The target may be any object, in which case a SingletonTargetSource will be created. If it is a TargetSource, no
wrapper TargetSource is created: This enables the use of a pooling or prototype TargetSource etc.
- Overrides:
setTarget
in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
- Parameters:
target
- the object that will be wrapped with a transactional argument. Must not be null
.
- Throws:
java.lang.IllegalArgumentException
- if the target
parameter is null
getProxy
protected java.lang.Object getProxy(org.springframework.aop.framework.AopProxy proxy)
- Returns the proxy object to expose.
This implementation uses the class loader of the target object, to allow plugins to use transaction-wrapped
beans.
- Overrides:
getProxy
in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
- Parameters:
proxy
- the prepared AopProxy
instance to get the proxy from
- Returns:
- the proxy object to expose
Copyright © 2003-2013 Atlassian. All Rights Reserved.