Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
fdd1f836
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,发现更多精彩内容 >>
提交
fdd1f836
编写于
2月 27, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
(cherry picked from commit
37835910
)
上级
ab2c7218
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
35 deletion
+38
-35
spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java
...mework/cache/annotation/AbstractCachingConfiguration.java
+8
-8
spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java
...ramework/context/annotation/MBeanExportConfiguration.java
+7
-7
spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java
...ork/scheduling/annotation/AbstractAsyncConfiguration.java
+4
-3
spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java
...mework/jms/listener/AbstractMessageListenerContainer.java
+5
-7
spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java
...nnotation/AbstractTransactionManagementConfiguration.java
+11
-9
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.java
...vlet/config/annotation/DelegatingWebMvcConfiguration.java
+3
-1
未找到文件。
spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java
浏览文件 @
fdd1f836
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -17,7 +17,6 @@
package
org.springframework.cache.annotation
;
import
java.util.Collection
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.CacheManager
;
...
...
@@ -28,12 +27,11 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.ImportAware
;
import
org.springframework.core.annotation.AnnotationAttributes
;
import
org.springframework.core.type.AnnotationMetadata
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
/**
* Abstract base {@code @Configuration} class providing common structure
for enabling
* Spring's annotation-driven cache management capability.
* Abstract base {@code @Configuration} class providing common structure
*
for enabling
Spring's annotation-driven cache management capability.
*
* @author Chris Beams
* @author Stephane Nicoll
...
...
@@ -53,13 +51,15 @@ public abstract class AbstractCachingConfiguration<C extends CachingConfigurer>
protected
CacheErrorHandler
errorHandler
;
@Override
public
void
setImportMetadata
(
AnnotationMetadata
importMetadata
)
{
this
.
enableCaching
=
AnnotationAttributes
.
fromMap
(
importMetadata
.
getAnnotationAttributes
(
EnableCaching
.
class
.
getName
(),
false
));
Assert
.
notNull
(
this
.
enableCaching
,
"@EnableCaching is not present on importing class "
+
importMetadata
.
getClassName
());
if
(
this
.
enableCaching
==
null
)
{
throw
new
IllegalArgumentException
(
"@EnableCaching is not present on importing class "
+
importMetadata
.
getClassName
());
}
}
@Autowired
(
required
=
false
)
...
...
spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java
浏览文件 @
fdd1f836
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -51,7 +51,7 @@ public class MBeanExportConfiguration implements ImportAware, EnvironmentAware,
private
static
final
String
MBEAN_EXPORTER_BEAN_NAME
=
"mbeanExporter"
;
private
AnnotationAttributes
attributes
;
private
AnnotationAttributes
enableMBeanExport
;
private
Environment
environment
;
...
...
@@ -61,8 +61,8 @@ public class MBeanExportConfiguration implements ImportAware, EnvironmentAware,
@Override
public
void
setImportMetadata
(
AnnotationMetadata
importMetadata
)
{
Map
<
String
,
Object
>
map
=
importMetadata
.
getAnnotationAttributes
(
EnableMBeanExport
.
class
.
getName
());
this
.
attributes
=
AnnotationAttributes
.
fromMap
(
map
);
if
(
this
.
attributes
==
null
)
{
this
.
enableMBeanExport
=
AnnotationAttributes
.
fromMap
(
map
);
if
(
this
.
enableMBeanExport
==
null
)
{
throw
new
IllegalArgumentException
(
"@EnableMBeanExport is not present on importing class "
+
importMetadata
.
getClassName
());
}
...
...
@@ -90,7 +90,7 @@ public class MBeanExportConfiguration implements ImportAware, EnvironmentAware,
}
private
void
setupDomain
(
AnnotationMBeanExporter
exporter
)
{
String
defaultDomain
=
this
.
attributes
.
getString
(
"defaultDomain"
);
String
defaultDomain
=
this
.
enableMBeanExport
.
getString
(
"defaultDomain"
);
if
(
defaultDomain
!=
null
&&
this
.
environment
!=
null
)
{
defaultDomain
=
this
.
environment
.
resolvePlaceholders
(
defaultDomain
);
}
...
...
@@ -100,7 +100,7 @@ public class MBeanExportConfiguration implements ImportAware, EnvironmentAware,
}
private
void
setupServer
(
AnnotationMBeanExporter
exporter
)
{
String
server
=
this
.
attributes
.
getString
(
"server"
);
String
server
=
this
.
enableMBeanExport
.
getString
(
"server"
);
if
(
server
!=
null
&&
this
.
environment
!=
null
)
{
server
=
this
.
environment
.
resolvePlaceholders
(
server
);
}
...
...
@@ -116,7 +116,7 @@ public class MBeanExportConfiguration implements ImportAware, EnvironmentAware,
}
private
void
setupRegistrationPolicy
(
AnnotationMBeanExporter
exporter
)
{
RegistrationPolicy
registrationPolicy
=
this
.
attributes
.
getEnum
(
"registration"
);
RegistrationPolicy
registrationPolicy
=
this
.
enableMBeanExport
.
getEnum
(
"registration"
);
exporter
.
setRegistrationPolicy
(
registrationPolicy
);
}
...
...
spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java
浏览文件 @
fdd1f836
...
...
@@ -25,7 +25,6 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.ImportAware
;
import
org.springframework.core.annotation.AnnotationAttributes
;
import
org.springframework.core.type.AnnotationMetadata
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
/**
...
...
@@ -51,8 +50,10 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
public
void
setImportMetadata
(
AnnotationMetadata
importMetadata
)
{
this
.
enableAsync
=
AnnotationAttributes
.
fromMap
(
importMetadata
.
getAnnotationAttributes
(
EnableAsync
.
class
.
getName
(),
false
));
Assert
.
notNull
(
this
.
enableAsync
,
"@EnableAsync is not present on importing class "
+
importMetadata
.
getClassName
());
if
(
this
.
enableAsync
==
null
)
{
throw
new
IllegalArgumentException
(
"@EnableAsync is not present on importing class "
+
importMetadata
.
getClassName
());
}
}
/**
...
...
spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java
浏览文件 @
fdd1f836
...
...
@@ -114,13 +114,11 @@ import org.springframework.util.ReflectionUtils;
* runtime processing overhead.
* </ul>
*
* <p>Note that even if
* {@link org.springframework.jms.connection.JmsTransactionManager} used to
* only provide fully synchronized Spring transactions based
* on local JMS transactions, "sessionTransacted" offers now the same feature and
* is the recommended option when transactions are not managed externally. In
* other words, set the transaction manager only if you are using JTA , or
* synchronizing transactions.
* <p>Note that the "sessionTransacted" flag is strongly recommended over
* {@link org.springframework.jms.connection.JmsTransactionManager}, provided
* that transactions do not need to be managed externally. As a consequence,
* set the transaction manager only if you are using JTA or if you need to
* synchronize with custom external transaction arrangements.
*
* @author Juergen Hoeller
* @author Stephane Nicoll
...
...
spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java
浏览文件 @
fdd1f836
...
...
@@ -29,7 +29,6 @@ import org.springframework.core.type.AnnotationMetadata;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.config.TransactionManagementConfigUtils
;
import
org.springframework.transaction.event.TransactionalEventListenerFactory
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
/**
...
...
@@ -52,18 +51,14 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
protected
PlatformTransactionManager
txManager
;
@Bean
(
name
=
TransactionManagementConfigUtils
.
TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME
)
@Role
(
BeanDefinition
.
ROLE_INFRASTRUCTURE
)
public
TransactionalEventListenerFactory
transactionalEventListenerFactory
()
{
return
new
TransactionalEventListenerFactory
();
}
@Override
public
void
setImportMetadata
(
AnnotationMetadata
importMetadata
)
{
this
.
enableTx
=
AnnotationAttributes
.
fromMap
(
importMetadata
.
getAnnotationAttributes
(
EnableTransactionManagement
.
class
.
getName
(),
false
));
Assert
.
notNull
(
this
.
enableTx
,
"@EnableTransactionManagement is not present on importing class "
+
importMetadata
.
getClassName
());
if
(
this
.
enableTx
==
null
)
{
throw
new
IllegalArgumentException
(
"@EnableTransactionManagement is not present on importing class "
+
importMetadata
.
getClassName
());
}
}
@Autowired
(
required
=
false
)
...
...
@@ -78,4 +73,11 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
this
.
txManager
=
configurer
.
annotationDrivenTransactionManager
();
}
@Bean
(
name
=
TransactionManagementConfigUtils
.
TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME
)
@Role
(
BeanDefinition
.
ROLE_INFRASTRUCTURE
)
public
TransactionalEventListenerFactory
transactionalEventListenerFactory
()
{
return
new
TransactionalEventListenerFactory
();
}
}
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.java
浏览文件 @
fdd1f836
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -42,6 +42,7 @@ public class DelegatingWebMvcConfiguration extends WebMvcConfigurationSupport {
private
final
WebMvcConfigurerComposite
configurers
=
new
WebMvcConfigurerComposite
();
@Autowired
(
required
=
false
)
public
void
setConfigurers
(
List
<
WebMvcConfigurer
>
configurers
)
{
if
(
configurers
==
null
||
configurers
.
isEmpty
())
{
...
...
@@ -50,6 +51,7 @@ public class DelegatingWebMvcConfiguration extends WebMvcConfigurationSupport {
this
.
configurers
.
addWebMvcConfigurers
(
configurers
);
}
@Override
protected
void
addInterceptors
(
InterceptorRegistry
registry
)
{
this
.
configurers
.
addInterceptors
(
registry
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录