Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
078f23d6
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,发现更多精彩内容 >>
提交
078f23d6
编写于
8月 18, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
b93dd954
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
32 deletion
+28
-32
spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
...ramework/context/annotation/ConfigurationClassParser.java
+9
-12
spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java
...in/java/org/springframework/messaging/MessageHeaders.java
+5
-5
spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java
...org/springframework/messaging/support/GenericMessage.java
+13
-14
spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java
...ingframework/messaging/support/MessageHeaderAccessor.java
+1
-1
未找到文件。
spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
浏览文件 @
078f23d6
...
...
@@ -256,17 +256,14 @@ class ConfigurationClassParser {
// Process any @ComponentScan annotations
AnnotationAttributes
componentScan
=
AnnotationConfigUtils
.
attributesFor
(
sourceClass
.
getMetadata
(),
ComponentScan
.
class
);
if
(
componentScan
!=
null
)
{
// the config class is annotated with @ComponentScan -> perform the scan immediately
if
(!
this
.
conditionEvaluator
.
shouldSkip
(
sourceClass
.
getMetadata
(),
ConfigurationPhase
.
REGISTER_BEAN
))
{
Set
<
BeanDefinitionHolder
>
scannedBeanDefinitions
=
this
.
componentScanParser
.
parse
(
componentScan
,
sourceClass
.
getMetadata
().
getClassName
());
// check the set of scanned definitions for any further config classes and parse recursively if necessary
for
(
BeanDefinitionHolder
holder
:
scannedBeanDefinitions
)
{
if
(
ConfigurationClassUtils
.
checkConfigurationClassCandidate
(
holder
.
getBeanDefinition
(),
this
.
metadataReaderFactory
))
{
parse
(
holder
.
getBeanDefinition
().
getBeanClassName
(),
holder
.
getBeanName
());
}
if
(
componentScan
!=
null
&&
!
this
.
conditionEvaluator
.
shouldSkip
(
sourceClass
.
getMetadata
(),
ConfigurationPhase
.
REGISTER_BEAN
))
{
// The config class is annotated with @ComponentScan -> perform the scan immediately
Set
<
BeanDefinitionHolder
>
scannedBeanDefinitions
=
this
.
componentScanParser
.
parse
(
componentScan
,
sourceClass
.
getMetadata
().
getClassName
());
// Check the set of scanned definitions for any further config classes and parse recursively if necessary
for
(
BeanDefinitionHolder
holder
:
scannedBeanDefinitions
)
{
if
(
ConfigurationClassUtils
.
checkConfigurationClassCandidate
(
holder
.
getBeanDefinition
(),
this
.
metadataReaderFactory
))
{
parse
(
holder
.
getBeanDefinition
().
getBeanClassName
(),
holder
.
getBeanName
());
}
}
}
...
...
@@ -301,7 +298,7 @@ class ConfigurationClassParser {
}
}
// No superclass
,
processing is complete
// No superclass
->
processing is complete
return
null
;
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java
浏览文件 @
078f23d6
...
...
@@ -149,19 +149,19 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
}
public
UUID
getId
()
{
return
this
.
get
(
ID
,
UUID
.
class
);
return
get
(
ID
,
UUID
.
class
);
}
public
Long
getTimestamp
()
{
return
this
.
get
(
TIMESTAMP
,
Long
.
class
);
return
get
(
TIMESTAMP
,
Long
.
class
);
}
public
Object
getReplyChannel
()
{
return
this
.
get
(
REPLY_CHANNEL
);
return
get
(
REPLY_CHANNEL
);
}
public
Object
getErrorChannel
()
{
return
this
.
get
(
ERROR_CHANNEL
);
return
get
(
ERROR_CHANNEL
);
}
@SuppressWarnings
(
"unchecked"
)
...
...
@@ -195,7 +195,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
}
// Map implementation
//
Delegating
Map implementation
public
boolean
containsKey
(
Object
key
)
{
return
this
.
headers
.
containsKey
(
key
);
...
...
spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java
浏览文件 @
078f23d6
...
...
@@ -22,7 +22,6 @@ import java.util.Map;
import
org.springframework.messaging.Message
;
import
org.springframework.messaging.MessageHeaders
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
/**
* An implementation of {@link Message} with a generic payload.
...
...
@@ -68,8 +67,8 @@ public class GenericMessage<T> implements Message<T>, Serializable {
* @param headers message headers
*/
public
GenericMessage
(
T
payload
,
MessageHeaders
headers
)
{
Assert
.
notNull
(
payload
,
"
'p
ayload must not be null"
);
Assert
.
notNull
(
headers
,
"
'headers'
must not be null"
);
Assert
.
notNull
(
payload
,
"
P
ayload must not be null"
);
Assert
.
notNull
(
headers
,
"
MessageHeaders
must not be null"
);
this
.
payload
=
payload
;
this
.
headers
=
headers
;
}
...
...
@@ -84,31 +83,31 @@ public class GenericMessage<T> implements Message<T>, Serializable {
}
public
boolean
equals
(
Object
o
bj
)
{
if
(
this
==
o
bj
)
{
public
boolean
equals
(
Object
o
ther
)
{
if
(
this
==
o
ther
)
{
return
true
;
}
if
(
obj
!=
null
&&
obj
instanceof
GenericMessage
<?>)
{
GenericMessage
<?>
other
=
(
GenericMessage
<?>)
obj
;
return
(
ObjectUtils
.
nullSafeEquals
(
this
.
headers
.
getId
(),
other
.
headers
.
getId
())
&&
this
.
headers
.
equals
(
other
.
headers
)
&&
this
.
payload
.
equals
(
other
.
payload
));
if
(!(
other
instanceof
GenericMessage
))
{
return
false
;
}
return
false
;
GenericMessage
<?>
otherMessage
=
(
GenericMessage
<?>)
other
;
return
(
this
.
payload
.
equals
(
otherMessage
.
payload
)
&&
this
.
headers
.
equals
(
otherMessage
.
headers
));
}
public
int
hashCode
()
{
return
this
.
headers
.
hashCode
()
*
23
+
ObjectUtils
.
nullSafeHashCode
(
this
.
payload
);
return
(
this
.
payload
.
hashCode
()
*
23
+
this
.
headers
.
hashCode
()
);
}
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
(
getClass
().
getSimpleName
());
sb
.
append
(
" [payload="
);
if
(
this
.
payload
instanceof
byte
[])
{
sb
.
append
(
"
[payload byte["
).
append
(((
byte
[])
this
.
payload
).
length
).
append
(
"]
]"
);
sb
.
append
(
"
byte["
).
append
(((
byte
[])
this
.
payload
).
length
).
append
(
"
]"
);
}
else
{
sb
.
append
(
"[payload="
).
append
(
this
.
payload
).
append
(
"]"
);
sb
.
append
(
this
.
payload
);
}
sb
.
append
(
"
[
headers="
).
append
(
this
.
headers
).
append
(
"]"
);
sb
.
append
(
"
,
headers="
).
append
(
this
.
headers
).
append
(
"]"
);
return
sb
.
toString
();
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java
浏览文件 @
078f23d6
...
...
@@ -540,7 +540,7 @@ public class MessageHeaderAccessor {
@Override
public
String
toString
()
{
return
getClass
().
getSimpleName
()
+
"[headers="
+
this
.
headers
+
"]"
;
return
getClass
().
getSimpleName
()
+
"
[headers="
+
this
.
headers
+
"]"
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录