Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
2b371a7c
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b371a7c
编写于
7月 26, 2011
作者:
C
Chris Beams
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deprecate TransactionProxyFactoryBean
上级
c85ebd9a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
30 deletion
+45
-30
org.springframework.aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
...work/aop/framework/AbstractSingletonProxyFactoryBean.java
+4
-3
org.springframework.context/src/main/java/org/springframework/cache/interceptor/CacheProxyFactoryBean.java
...ingframework/cache/interceptor/CacheProxyFactoryBean.java
+3
-4
org.springframework.context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java
...springframework/context/support/TestProxyFactoryBean.java
+1
-3
org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.java
.../transaction/interceptor/TransactionProxyFactoryBean.java
+37
-20
未找到文件。
org.springframework.aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
浏览文件 @
2b371a7c
/*
/*
* Copyright 2002-20
09
the original author or authors.
* Copyright 2002-20
11
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -37,12 +37,13 @@ import org.springframework.util.ClassUtils;
...
@@ -37,12 +37,13 @@ import org.springframework.util.ClassUtils;
* @author Juergen Hoeller
* @author Juergen Hoeller
* @since 2.0
* @since 2.0
*/
*/
@SuppressWarnings
(
"serial"
)
public
abstract
class
AbstractSingletonProxyFactoryBean
extends
ProxyConfig
public
abstract
class
AbstractSingletonProxyFactoryBean
extends
ProxyConfig
implements
FactoryBean
<
Object
>,
BeanClassLoaderAware
,
InitializingBean
{
implements
FactoryBean
<
Object
>,
BeanClassLoaderAware
,
InitializingBean
{
private
Object
target
;
private
Object
target
;
private
Class
[]
proxyInterfaces
;
private
Class
<?>
[]
proxyInterfaces
;
private
Object
[]
preInterceptors
;
private
Object
[]
preInterceptors
;
...
@@ -77,7 +78,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
...
@@ -77,7 +78,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
* out which interfaces need proxying by analyzing the target,
* out which interfaces need proxying by analyzing the target,
* proxying all the interfaces that the target object implements.
* proxying all the interfaces that the target object implements.
*/
*/
public
void
setProxyInterfaces
(
Class
[]
proxyInterfaces
)
{
public
void
setProxyInterfaces
(
Class
<?>
[]
proxyInterfaces
)
{
this
.
proxyInterfaces
=
proxyInterfaces
;
this
.
proxyInterfaces
=
proxyInterfaces
;
}
}
...
...
org.springframework.context/src/main/java/org/springframework/cache/interceptor/CacheProxyFactoryBean.java
浏览文件 @
2b371a7c
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
package
org.springframework.cache.interceptor
;
package
org.springframework.cache.interceptor
;
import
org.springframework.aop.Pointcut
;
import
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
;
import
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
;
/**
/**
...
@@ -26,17 +25,17 @@ import org.springframework.aop.framework.AbstractSingletonProxyFactoryBean;
...
@@ -26,17 +25,17 @@ import org.springframework.aop.framework.AbstractSingletonProxyFactoryBean;
* with a separate {@link CachingInterceptor} definition.
* with a separate {@link CachingInterceptor} definition.
*
*
* <p>This class is intended to cover the <i>typical</i> case of declarative
* <p>This class is intended to cover the <i>typical</i> case of declarative
*
transaction demarcation: namely, wrapping a singleton target object with a
*
caching: namely, wrapping a singleton target object with a caching proxy,
*
caching proxy,
proxying all the interfaces that the target implements.
* proxying all the interfaces that the target implements.
*
*
* @author Costin Leau
* @author Costin Leau
* @see org.springframework.aop.framework.ProxyFactoryBean
* @see org.springframework.aop.framework.ProxyFactoryBean
* @see CachingInterceptor
* @see CachingInterceptor
*/
*/
@SuppressWarnings
(
"serial"
)
public
class
CacheProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
{
public
class
CacheProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
{
private
final
CacheInterceptor
cachingInterceptor
=
new
CacheInterceptor
();
private
final
CacheInterceptor
cachingInterceptor
=
new
CacheInterceptor
();
private
Pointcut
pointcut
;
@Override
@Override
protected
Object
createMainInterceptor
()
{
protected
Object
createMainInterceptor
()
{
...
...
org.springframework.context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java
浏览文件 @
2b371a7c
/*
/*
* Copyright 2002-20
09
the original author or authors.
* Copyright 2002-20
11
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -17,10 +17,8 @@
...
@@ -17,10 +17,8 @@
package
org.springframework.context.support
;
package
org.springframework.context.support
;
import
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
;
import
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.FactoryBean
;
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
public
class
TestProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
implements
BeanFactoryAware
{
public
class
TestProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
implements
BeanFactoryAware
{
...
...
org.springframework.transaction/src/main/java/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.java
浏览文件 @
2b371a7c
/*
/*
* Copyright 2002-20
09
the original author or authors.
* Copyright 2002-20
11
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -33,9 +33,18 @@ import org.springframework.transaction.PlatformTransactionManager;
...
@@ -33,9 +33,18 @@ import org.springframework.transaction.PlatformTransactionManager;
* {@link org.springframework.aop.framework.ProxyFactoryBean}
* {@link org.springframework.aop.framework.ProxyFactoryBean}
* with a separate {@link TransactionInterceptor} definition.
* with a separate {@link TransactionInterceptor} definition.
*
*
* <p>This class is intended to cover the <i>typical</i> case of declarative
* <p><strong>HISTORICAL NOTE:</strong>This class was originally intended to cover the
* typical case of declarative
* transaction demarcation: namely, wrapping a singleton target object with a
* transaction demarcation: namely, wrapping a singleton target object with a
* transactional proxy, proxying all the interfaces that the target implements.
* transactional proxy, proxying all the interfaces that the target implements. However,
* in Spring versions 2.0 and beyond, the functionality provided here is superseded
* by the more convenient {@code tx:} XML namespace. See the <a href="http://bit.ly/qUwvwz">
* declarative transaction management</a> section of the Spring reference documentation to
* understand the modern options for managing transactions in Spring applications.
* <strong>While this class has been deprecated starting with Spring 3.1, its use remains
* valid and supported</strong>. The deprecation serves as a strong reminder to users that
* simpler and superior approaches are available. What follows is the original
* (pre-deprecation) documentation.
*
*
* <p>There are three main properties that need to be specified:
* <p>There are three main properties that need to be specified:
* <ul>
* <ul>
...
@@ -71,36 +80,44 @@ import org.springframework.transaction.PlatformTransactionManager;
...
@@ -71,36 +80,44 @@ import org.springframework.transaction.PlatformTransactionManager;
* This reduces the per-bean definition effort to a minimum.
* This reduces the per-bean definition effort to a minimum.
*
*
* <pre code="class">
* <pre code="class">
* <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
* {@code
* abstract="true">
* <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
* <property name="transactionManager" ref="transactionManager"/>
* abstract="true">
* <property name="transactionAttributes">
* <property name="transactionManager" ref="transactionManager"/>
* <props>
* <property name="transactionAttributes">
* <prop key="insert*">PROPAGATION_REQUIRED</prop>
* <props>
* <prop key="update*">PROPAGATION_REQUIRED</prop>
* <prop key="insert*">PROPAGATION_REQUIRED</prop>
* <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
* <prop key="update*">PROPAGATION_REQUIRED</prop>
* </props>
* <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
* </property>
* </props>
* </bean>
* </property>
* </bean>
*
*
*
<bean id="myProxy" parent="baseTransactionProxy">
*
<bean id="myProxy" parent="baseTransactionProxy">
*
<property name="target" ref="myTarget"/>
*
<property name="target" ref="myTarget"/>
*
</bean>
*
</bean>
*
*
*
<bean id="yourProxy" parent="baseTransactionProxy">
*
<bean id="yourProxy" parent="baseTransactionProxy">
*
<property name="target" ref="yourTarget"/>
*
<property name="target" ref="yourTarget"/>
*
</bean>
</pre>
*
</bean>}
</pre>
*
*
* @author Juergen Hoeller
* @author Juergen Hoeller
* @author Dmitriy Kopylenko
* @author Dmitriy Kopylenko
* @author Rod Johnson
* @author Rod Johnson
* @author Chris Beams
* @since 21.08.2003
* @since 21.08.2003
* @see #setTransactionManager
* @see #setTransactionManager
* @see #setTarget
* @see #setTarget
* @see #setTransactionAttributes
* @see #setTransactionAttributes
* @see TransactionInterceptor
* @see TransactionInterceptor
* @see org.springframework.aop.framework.ProxyFactoryBean
* @see org.springframework.aop.framework.ProxyFactoryBean
* @deprecated as of Spring 3.1 in favor of the {@code tx:} XML namespace as well as the
* {@link org.springframework.transaction.annotation.Transactional @Transactional} and
* {@link org.springframework.transaction.annotation.EnableTransactionManagement @EnableTransactionManagement}
* annotations
*/
*/
@Deprecated
@SuppressWarnings
(
"serial"
)
public
class
TransactionProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
public
class
TransactionProxyFactoryBean
extends
AbstractSingletonProxyFactoryBean
implements
BeanFactoryAware
{
implements
BeanFactoryAware
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录