Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
473ed1a6
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 搜索 >>
提交
473ed1a6
编写于
10月 04, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
cc02269c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
36 deletion
+33
-36
spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java
.../springframework/mail/javamail/InternetAddressEditor.java
+1
-2
spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMailMessage.java
...va/org/springframework/mail/javamail/MimeMailMessage.java
+1
-2
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java
...k/messaging/simp/broker/AbstractBrokerMessageHandler.java
+19
-22
spring-messaging/src/main/java/org/springframework/messaging/support/ChannelInterceptor.java
...springframework/messaging/support/ChannelInterceptor.java
+3
-3
spring-messaging/src/main/java/org/springframework/messaging/support/InterceptableChannel.java
...ringframework/messaging/support/InterceptableChannel.java
+2
-1
spring-messaging/src/test/java/org/springframework/messaging/support/ChannelInterceptorTests.java
...gframework/messaging/support/ChannelInterceptorTests.java
+7
-6
未找到文件。
spring-context-support/src/main/java/org/springframework/mail/javamail/InternetAddressEditor.java
浏览文件 @
473ed1a6
/*
* 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.
...
...
@@ -17,7 +17,6 @@
package
org.springframework.mail.javamail
;
import
java.beans.PropertyEditorSupport
;
import
javax.mail.internet.AddressException
;
import
javax.mail.internet.InternetAddress
;
...
...
spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMailMessage.java
浏览文件 @
473ed1a6
/*
* 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.
...
...
@@ -17,7 +17,6 @@
package
org.springframework.mail.javamail
;
import
java.util.Date
;
import
javax.mail.MessagingException
;
import
javax.mail.internet.MimeMessage
;
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java
浏览文件 @
473ed1a6
...
...
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
...
...
@@ -38,7 +38,6 @@ import org.springframework.messaging.support.InterceptableChannel;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
/**
* Abstract base class for a {@link MessageHandler} that broker messages to
* registered subscribers.
...
...
@@ -51,7 +50,6 @@ public abstract class AbstractBrokerMessageHandler
protected
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
final
SubscribableChannel
clientInboundChannel
;
private
final
MessageChannel
clientOutboundChannel
;
...
...
@@ -74,7 +72,7 @@ public abstract class AbstractBrokerMessageHandler
private
final
Object
lifecycleMonitor
=
new
Object
();
private
ChannelInterceptor
unsentDisconnectInterceptor
=
new
UnsentDisconnectChannelInterceptor
();
private
final
ChannelInterceptor
unsentDisconnectInterceptor
=
new
UnsentDisconnectChannelInterceptor
();
/**
...
...
@@ -151,18 +149,6 @@ public abstract class AbstractBrokerMessageHandler
return
Integer
.
MAX_VALUE
;
}
/**
* Check whether this message handler is currently running.
* <p>Note that even when this message handler is running the
* {@link #isBrokerAvailable()} flag may still independently alternate between
* being on and off depending on the concrete sub-class implementation.
*/
@Override
public
final
boolean
isRunning
()
{
synchronized
(
this
.
lifecycleMonitor
)
{
return
this
.
running
;
}
}
@Override
public
void
start
()
{
...
...
@@ -177,9 +163,7 @@ public abstract class AbstractBrokerMessageHandler
}
startInternal
();
this
.
running
=
true
;
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"Started."
);
}
logger
.
info
(
"Started."
);
}
}
...
...
@@ -199,9 +183,7 @@ public abstract class AbstractBrokerMessageHandler
((
InterceptableChannel
)
this
.
clientInboundChannel
).
removeInterceptor
(
this
.
unsentDisconnectInterceptor
);
}
this
.
running
=
false
;
if
(
logger
.
isDebugEnabled
())
{
logger
.
info
(
"Stopped."
);
}
logger
.
info
(
"Stopped."
);
}
}
...
...
@@ -216,6 +198,19 @@ public abstract class AbstractBrokerMessageHandler
}
}
/**
* Check whether this message handler is currently running.
* <p>Note that even when this message handler is running the
* {@link #isBrokerAvailable()} flag may still independently alternate between
* being on and off depending on the concrete sub-class implementation.
*/
@Override
public
final
boolean
isRunning
()
{
synchronized
(
this
.
lifecycleMonitor
)
{
return
this
.
running
;
}
}
/**
* Whether the message broker is currently available and able to process messages.
* <p>Note that this is in addition to the {@link #isRunning()} flag, which
...
...
@@ -245,6 +240,7 @@ public abstract class AbstractBrokerMessageHandler
protected
abstract
void
handleMessageInternal
(
Message
<?>
message
);
protected
boolean
checkDestinationPrefix
(
String
destination
)
{
if
((
destination
==
null
)
||
CollectionUtils
.
isEmpty
(
this
.
destinationPrefixes
))
{
return
true
;
...
...
@@ -294,4 +290,5 @@ public abstract class AbstractBrokerMessageHandler
}
}
}
}
spring-messaging/src/main/java/org/springframework/messaging/support/ChannelInterceptor.java
浏览文件 @
473ed1a6
...
...
@@ -47,8 +47,8 @@ public interface ChannelInterceptor {
/**
* Invoked after the completion of a send regardless of any exception that
* have been raised thus allowing for proper resource cleanup.
* <p>Note that this will be invoked only if
preSend successfully completed
* and returned a Message, i.e. it did not return {@code null}.
* <p>Note that this will be invoked only if
{@link #preSend} successfully
*
completed
and returned a Message, i.e. it did not return {@code null}.
* @since 4.1
*/
void
afterSendCompletion
(
Message
<?>
message
,
MessageChannel
channel
,
boolean
sent
,
Exception
ex
);
...
...
@@ -70,7 +70,7 @@ public interface ChannelInterceptor {
/**
* Invoked after the completion of a receive regardless of any exception that
* have been raised thus allowing for proper resource cleanup.
* <p>Note that this will be invoked only if
preReceive
successfully
* <p>Note that this will be invoked only if
{@link #preReceive}
successfully
* completed and returned {@code true}.
* @since 4.1
*/
...
...
spring-messaging/src/main/java/org/springframework/messaging/support/InterceptableChannel.java
浏览文件 @
473ed1a6
...
...
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.messaging.support
;
import
java.util.List
;
...
...
spring-messaging/src/test/java/org/springframework/messaging/support/ChannelInterceptorTests.java
浏览文件 @
473ed1a6
...
...
@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
...
...
@@ -33,6 +33,7 @@ import static org.mockito.Mockito.mock;
/**
* Test fixture for the use of {@link ChannelInterceptor}s.
*
* @author Rossen Stoyanchev
*/
public
class
ChannelInterceptorTests
{
...
...
@@ -184,8 +185,7 @@ public class ChannelInterceptorTests {
private
static
class
TestMessageHandler
implements
MessageHandler
{
private
List
<
Message
<?>>
messages
=
new
ArrayList
<
Message
<?>>();
private
final
List
<
Message
<?>>
messages
=
new
ArrayList
<
Message
<?>>();
public
List
<
Message
<?>>
getMessages
()
{
return
this
.
messages
;
...
...
@@ -193,17 +193,17 @@ public class ChannelInterceptorTests {
@Override
public
void
handleMessage
(
Message
<?>
message
)
throws
MessagingException
{
this
.
getMessages
()
.
add
(
message
);
this
.
messages
.
add
(
message
);
}
}
private
abstract
static
class
AbstractTestInterceptor
extends
ChannelInterceptorAdapter
{
private
AtomicInteger
counter
=
new
AtomicInteger
();
private
volatile
boolean
afterCompletionInvoked
;
public
AtomicInteger
getCounter
()
{
return
this
.
counter
;
}
...
...
@@ -225,13 +225,13 @@ public class ChannelInterceptorTests {
}
}
private
static
class
PreSendInterceptor
extends
AbstractTestInterceptor
{
private
Message
<?>
messageToReturn
;
private
RuntimeException
exceptionToRaise
;
public
void
setMessageToReturn
(
Message
<?>
messageToReturn
)
{
this
.
messageToReturn
=
messageToReturn
;
}
...
...
@@ -250,6 +250,7 @@ public class ChannelInterceptorTests {
}
}
private
static
class
NullReturningPreSendInterceptor
extends
AbstractTestInterceptor
{
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录