Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
55c35152
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,发现更多精彩内容 >>
提交
55c35152
编写于
7月 07, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
40822746
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
47 deletion
+40
-47
spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
...ramework/jdbc/support/SQLExceptionSubclassTranslator.java
+14
-15
spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerEndpoint.java
...ringframework/jms/config/AbstractJmsListenerEndpoint.java
+26
-32
未找到文件。
spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
浏览文件 @
55c35152
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,9 +45,8 @@ import org.springframework.jdbc.BadSqlGrammarException;
* {@link SQLExceptionTranslator} implementation which analyzes the specific
* {@link java.sql.SQLException} subclass thrown by the JDBC driver.
*
* <p>This is only available with JDBC 4.0 and later drivers when using Java 6 or later.
* Falls back to a standard {@link SQLStateSQLExceptionTranslator} if the JDBC driver
* does not actually expose JDBC 4 compliant {@code SQLException} subclasses.
* <p>Falls back to a standard {@link SQLStateSQLExceptionTranslator} if the JDBC
* driver does not actually expose JDBC 4 compliant {@code SQLException} subclasses.
*
* @author Thomas Risberg
* @author Juergen Hoeller
...
...
@@ -65,22 +64,22 @@ public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLException
@Override
protected
DataAccessException
doTranslate
(
String
task
,
String
sql
,
SQLException
ex
)
{
if
(
ex
instanceof
SQLTransientException
)
{
if
(
ex
instanceof
SQLTransactionRollbackException
)
{
return
new
ConcurrencyFailureException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
if
(
ex
instanceof
SQLTransientConnectionException
)
{
return
new
TransientDataAccessResourceException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
if
(
ex
instanceof
SQLTimeoutException
)
{
else
if
(
ex
instanceof
SQLTransactionRollbackException
)
{
return
new
ConcurrencyFailureException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
else
if
(
ex
instanceof
SQLTimeoutException
)
{
return
new
QueryTimeoutException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
}
else
if
(
ex
instanceof
SQLNonTransientException
)
{
if
(
ex
instanceof
SQL
Data
Exception
)
{
return
new
Data
IntegrityViolation
Exception
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
if
(
ex
instanceof
SQL
NonTransientConnection
Exception
)
{
return
new
Data
AccessResourceFailure
Exception
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
else
if
(
ex
instanceof
SQL
FeatureNotSupported
Exception
)
{
return
new
InvalidDataAccessApiUsage
Exception
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
else
if
(
ex
instanceof
SQL
Data
Exception
)
{
return
new
DataIntegrityViolation
Exception
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
else
if
(
ex
instanceof
SQLIntegrityConstraintViolationException
)
{
return
new
DataIntegrityViolationException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
...
...
@@ -88,12 +87,12 @@ public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLException
else
if
(
ex
instanceof
SQLInvalidAuthorizationSpecException
)
{
return
new
PermissionDeniedDataAccessException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
else
if
(
ex
instanceof
SQLNonTransientConnectionException
)
{
return
new
DataAccessResourceFailureException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
else
if
(
ex
instanceof
SQLSyntaxErrorException
)
{
return
new
BadSqlGrammarException
(
task
,
sql
,
ex
);
}
else
if
(
ex
instanceof
SQLFeatureNotSupportedException
)
{
return
new
InvalidDataAccessApiUsageException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
}
}
else
if
(
ex
instanceof
SQLRecoverableException
)
{
return
new
RecoverableDataAccessException
(
buildMessage
(
task
,
sql
,
ex
),
ex
);
...
...
spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerEndpoint.java
浏览文件 @
55c35152
...
...
@@ -43,20 +43,13 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
private
String
selector
;
@Override
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* Return the name of the destination for this endpoint.
*/
public
String
getDestination
()
{
return
destination
;
@Override
public
String
getId
()
{
return
this
.
id
;
}
/**
...
...
@@ -67,10 +60,10 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
}
/**
* Return the name
for the durable subscription, if any
.
* Return the name
of the destination for this endpoint
.
*/
public
String
get
Subscrip
tion
()
{
return
subscrip
tion
;
public
String
get
Destina
tion
()
{
return
this
.
destina
tion
;
}
/**
...
...
@@ -81,32 +74,40 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
}
/**
* Return the JMS message selector expression, if any.
* <p>See the JMS specification for a detailed definition of selector expressions.
* Return the name for the durable subscription, if any.
*/
public
String
getS
elector
()
{
return
selector
;
public
String
getS
ubscription
()
{
return
this
.
subscription
;
}
/**
* Set the JMS message selector expression.
* <p>See the JMS specification for a detailed definition of selector expressions.
*/
public
void
setSelector
(
String
selector
)
{
this
.
selector
=
selector
;
}
/**
* Return the JMS message selector expression, if any.
*/
public
String
getSelector
()
{
return
this
.
selector
;
}
@Override
public
void
setupMessageContainer
(
MessageListenerContainer
container
)
{
if
(
container
instanceof
AbstractMessageListenerContainer
)
{
// JMS
if
(
container
instanceof
AbstractMessageListenerContainer
)
{
// JMS
setupJmsMessageContainer
((
AbstractMessageListenerContainer
)
container
);
}
else
if
(
container
instanceof
JmsMessageEndpointManager
)
{
// JCA
else
if
(
container
instanceof
JmsMessageEndpointManager
)
{
// JCA
setupJcaMessageContainer
((
JmsMessageEndpointManager
)
container
);
}
else
{
throw
new
IllegalArgumentException
(
"Could not configure endpoint with the specified container '"
+
container
+
"' Only JMS ("
+
AbstractMessageListenerContainer
.
class
.
getName
()
+
" subclass) or JCA ("
+
JmsMessageEndpointManager
.
class
.
getName
()
+
") are supported."
);
throw
new
IllegalArgumentException
(
"Could not configure endpoint with the specified container '"
+
container
+
"' Only JMS ("
+
AbstractMessageListenerContainer
.
class
.
getName
()
+
" subclass) or JCA ("
+
JmsMessageEndpointManager
.
class
.
getName
()
+
") are supported."
);
}
}
...
...
@@ -160,16 +161,9 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
*/
protected
StringBuilder
getEndpointDescription
()
{
StringBuilder
result
=
new
StringBuilder
();
return
result
.
append
(
getClass
().
getSimpleName
())
.
append
(
"["
)
.
append
(
this
.
id
)
.
append
(
"] destination="
)
.
append
(
this
.
destination
)
.
append
(
"' | subscription='"
)
.
append
(
this
.
subscription
)
.
append
(
" | selector='"
)
.
append
(
this
.
selector
)
.
append
(
"'"
);
return
result
.
append
(
getClass
().
getSimpleName
()).
append
(
"["
).
append
(
this
.
id
).
append
(
"] destination="
).
append
(
this
.
destination
).
append
(
"' | subscription='"
).
append
(
this
.
subscription
).
append
(
" | selector='"
).
append
(
this
.
selector
).
append
(
"'"
);
}
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录