Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
ae288158
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,体验更适合开发者的 AI 搜索 >>
提交
ae288158
编写于
7月 25, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
75fc0f85
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
23 addition
and
17 deletion
+23
-17
spring-core/src/main/java/org/springframework/util/xml/AbstractXMLEventReader.java
.../org/springframework/util/xml/AbstractXMLEventReader.java
+8
-5
spring-core/src/main/java/org/springframework/util/xml/ListBasedXMLEventReader.java
...org/springframework/util/xml/ListBasedXMLEventReader.java
+8
-5
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java
...ork/transaction/interceptor/TransactionAspectSupport.java
+7
-7
未找到文件。
spring-core/src/main/java/org/springframework/util/xml/AbstractXMLEventReader.java
浏览文件 @
ae288158
...
...
@@ -27,6 +27,7 @@ import org.springframework.util.ClassUtils;
/**
* Abstract base class for {@code XMLEventReader}s.
*
* @author Arjen Poutsma
* @since 5.0
*/
...
...
@@ -34,6 +35,7 @@ abstract class AbstractXMLEventReader implements XMLEventReader {
private
boolean
closed
;
@Override
public
Object
next
()
{
try
{
...
...
@@ -113,12 +115,17 @@ abstract class AbstractXMLEventReader implements XMLEventReader {
throw
new
IllegalArgumentException
(
"Property not supported: ["
+
name
+
"]"
);
}
@Override
public
void
close
()
{
this
.
closed
=
true
;
}
/**
* Returns {@code true} if closed; {@code false} otherwise.
* @see #close()
*/
protected
boolean
isClosed
()
{
return
closed
;
return
this
.
closed
;
}
/**
...
...
@@ -133,8 +140,4 @@ abstract class AbstractXMLEventReader implements XMLEventReader {
}
}
@Override
public
void
close
()
{
closed
=
true
;
}
}
spring-core/src/main/java/org/springframework/util/xml/ListBasedXMLEventReader.java
浏览文件 @
ae288158
...
...
@@ -35,20 +35,22 @@ class ListBasedXMLEventReader extends AbstractXMLEventReader {
private
int
cursor
=
0
;
public
ListBasedXMLEventReader
(
List
<
XMLEvent
>
events
)
{
Assert
.
notNull
(
events
,
"'events' must not be null"
);
this
.
events
=
Collections
.
unmodifiableList
(
events
);
}
@Override
public
boolean
hasNext
()
{
return
cursor
!=
events
.
size
(
);
return
(
this
.
cursor
!=
this
.
events
.
size
()
);
}
@Override
public
XMLEvent
nextEvent
()
{
if
(
cursor
<
events
.
size
())
{
return
events
.
get
(
cursor
++);
if
(
this
.
cursor
<
this
.
events
.
size
())
{
return
this
.
events
.
get
(
this
.
cursor
++);
}
else
{
throw
new
NoSuchElementException
();
...
...
@@ -57,8 +59,8 @@ class ListBasedXMLEventReader extends AbstractXMLEventReader {
@Override
public
XMLEvent
peek
()
{
if
(
cursor
<
events
.
size
())
{
return
events
.
get
(
cursor
);
if
(
this
.
cursor
<
this
.
events
.
size
())
{
return
this
.
events
.
get
(
this
.
cursor
);
}
else
{
return
null
;
...
...
@@ -70,4 +72,5 @@ class ListBasedXMLEventReader extends AbstractXMLEventReader {
super
.
close
();
this
.
events
.
clear
();
}
}
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java
浏览文件 @
ae288158
...
...
@@ -17,6 +17,7 @@
package
org.springframework.transaction.interceptor
;
import
java.lang.reflect.Method
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
@@ -85,7 +86,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
new
NamedThreadLocal
<>(
"Current aspect-driven transaction"
);
private
final
ConcurrentHash
Map
<
Object
,
PlatformTransactionManager
>
transactionManagerCache
=
private
final
Map
<
Object
,
PlatformTransactionManager
>
transactionManagerCache
=
new
ConcurrentHashMap
<>();
/**
...
...
@@ -243,7 +244,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
public
void
afterPropertiesSet
()
{
if
(
getTransactionManager
()
==
null
&&
this
.
beanFactory
==
null
)
{
throw
new
IllegalStateException
(
"Setting the property 'transactionManager' or running in a
Listable
BeanFactory is required"
);
"Setting the property 'transactionManager' or running in a BeanFactory is required"
);
}
if
(
this
.
transactionAttributeSource
==
null
)
{
throw
new
IllegalStateException
(
...
...
@@ -449,17 +450,16 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
TransactionInfo
txInfo
=
new
TransactionInfo
(
tm
,
txAttr
,
joinpointIdentification
);
if
(
txAttr
!=
null
)
{
// We need a transaction for this method
// We need a transaction for this method
...
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
"Getting transaction for ["
+
txInfo
.
getJoinpointIdentification
()
+
"]"
);
}
// The transaction manager will flag an error if an incompatible tx already exists
// The transaction manager will flag an error if an incompatible tx already exists
.
txInfo
.
newTransactionStatus
(
status
);
}
else
{
// The TransactionInfo.hasTransaction() method will return
// false. We created it only to preserve the integrity of
// the ThreadLocal stack maintained in this class.
// The TransactionInfo.hasTransaction() method will return false. We created it only
// to preserve the integrity of the ThreadLocal stack maintained in this class.
if
(
logger
.
isTraceEnabled
())
logger
.
trace
(
"Don't need to create transaction for ["
+
joinpointIdentification
+
"]: This method isn't transactional."
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录