Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
01522394
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 搜索 >>
提交
01522394
编写于
12月 30, 2009
作者:
M
Micha Kiener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SPR-6423, conversation object
上级
bc998249
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
71 addition
and
1 deletion
+71
-1
org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java
...pringframework/conversation/manager/ConversationImpl.java
+49
-1
org.springframework.context/src/main/java/org/springframework/conversation/manager/MutableConversation.java
...ngframework/conversation/manager/MutableConversation.java
+22
-0
未找到文件。
org.springframework.context/src/main/java/org/springframework/conversation/manager/ConversationImpl.java
浏览文件 @
01522394
...
...
@@ -21,6 +21,8 @@ import java.util.List;
import
org.springframework.beans.factory.config.DestructionAwareAttributeMap
;
import
org.springframework.conversation.Conversation
;
import
org.springframework.conversation.ConversationActivationType
;
import
org.springframework.conversation.ConversationDeactivationType
;
import
org.springframework.conversation.ConversationEndingType
;
import
org.springframework.conversation.ConversationListener
;
import
org.springframework.conversation.JoinMode
;
...
...
@@ -159,6 +161,10 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu
}
/**
* Is just delegated to
* {@link ConversationManager#finalEndConversation(Conversation, ConversationEndingType)}
* .
*
* @see org.springframework.conversation.manager.MutableConversation#finalEnd(org.springframework.conversation.ConversationEndingType)
*/
public
void
finalEnd
(
ConversationEndingType
endingType
)
{
...
...
@@ -175,8 +181,18 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu
return
;
}
// set the ended flag and flush the state
ended
=
true
;
// invoke listeners, if any
List
<
ConversationListener
>
list
=
getListeners
();
if
(
list
!=
null
)
{
for
(
ConversationListener
listener
:
list
)
{
listener
.
conversationEnded
(
this
,
endingType
);
}
}
// flush the state of this conversation AFTER the listeners have been
// invoked as there could be some state still needed
clear
();
}
...
...
@@ -334,6 +350,38 @@ public class ConversationImpl extends DestructionAwareAttributeMap implements Mu
}
}
/**
* @see org.springframework.conversation.manager.MutableConversation#activated(org.springframework.conversation.ConversationActivationType,
* org.springframework.conversation.Conversation)
*/
public
void
activated
(
ConversationActivationType
activationType
,
Conversation
oldCurrentConversation
)
{
touch
();
List
<
ConversationListener
>
list
=
getListeners
();
if
(
list
==
null
)
{
return
;
}
for
(
ConversationListener
listener
:
list
)
{
listener
.
conversationActivated
(
this
,
oldCurrentConversation
,
activationType
);
}
}
/**
* @see org.springframework.conversation.manager.MutableConversation#deactivated(org.springframework.conversation.ConversationDeactivationType,
* org.springframework.conversation.Conversation)
*/
public
void
deactivated
(
ConversationDeactivationType
deactivationType
,
Conversation
newCurrentConversation
)
{
touch
();
List
<
ConversationListener
>
list
=
getListeners
();
if
(
list
==
null
)
{
return
;
}
for
(
ConversationListener
listener
:
list
)
{
listener
.
conversationDeactivated
(
this
,
newCurrentConversation
,
deactivationType
);
}
}
/**
* @see org.springframework.conversation.manager.MutableConversation#getListeners()
*/
...
...
org.springframework.context/src/main/java/org/springframework/conversation/manager/MutableConversation.java
浏览文件 @
01522394
...
...
@@ -16,6 +16,8 @@
package
org.springframework.conversation.manager
;
import
org.springframework.conversation.Conversation
;
import
org.springframework.conversation.ConversationActivationType
;
import
org.springframework.conversation.ConversationDeactivationType
;
import
org.springframework.conversation.ConversationEndingType
;
/**
...
...
@@ -127,4 +129,24 @@ public interface MutableConversation extends Conversation {
* scope and beans are being accessed or added to it.
*/
void
touch
();
/**
* Invoked by the conversation manager if this conversation was made active.
* The type qualifies how the this conversation was actually made active.
* This method must invoke any listeners registered to this conversation.
*
* @param activationType the type qualifying the activation
* @param oldCurrentConversation the old current conversation, if available,
* <code>null</code> otherwise
*/
void
activated
(
ConversationActivationType
activationType
,
Conversation
oldCurrentConversation
);
/**
* Invoked by the conversation manager if this conversation was deactivated.
* The type qualifies how the this conversation was deactivated.
*
* @param deactivationType the type qualifying the deactivation
* @param newCurrentConversation the conversation made the current one
*/
void
deactivated
(
ConversationDeactivationType
deactivationType
,
Conversation
newCurrentConversation
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录