Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
2b88c474
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 搜索 >>
提交
2b88c474
编写于
3月 17, 2019
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish Javadoc for application event infrastructure
上级
e6d206b4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
20 deletion
+28
-20
spring-context/src/main/java/org/springframework/context/ApplicationEvent.java
...in/java/org/springframework/context/ApplicationEvent.java
+7
-4
spring-context/src/main/java/org/springframework/context/ApplicationEventPublisher.java
...rg/springframework/context/ApplicationEventPublisher.java
+3
-2
spring-context/src/main/java/org/springframework/context/ApplicationListener.java
...java/org/springframework/context/ApplicationListener.java
+10
-7
spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java
...gframework/context/event/ApplicationEventMulticaster.java
+8
-7
未找到文件。
spring-context/src/main/java/org/springframework/context/ApplicationEvent.java
浏览文件 @
2b88c474
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -24,6 +24,8 @@ import java.util.EventObject;
*
* @author Rod Johnson
* @author Juergen Hoeller
* @see org.springframework.context.ApplicationListener
* @see org.springframework.context.event.EventListener
*/
public
abstract
class
ApplicationEvent
extends
EventObject
{
...
...
@@ -35,8 +37,9 @@ public abstract class ApplicationEvent extends EventObject {
/**
* Create a new ApplicationEvent.
* @param source the object on which the event initially occurred (never {@code null})
* Create a new {@code ApplicationEvent}.
* @param source the object on which the event initially occurred or with
* which the event is associated (never {@code null})
*/
public
ApplicationEvent
(
Object
source
)
{
super
(
source
);
...
...
@@ -45,7 +48,7 @@ public abstract class ApplicationEvent extends EventObject {
/**
* Return the system time in milliseconds when the event
happen
ed.
* Return the system time in milliseconds when the event
occurr
ed.
*/
public
final
long
getTimestamp
()
{
return
this
.
timestamp
;
...
...
spring-context/src/main/java/org/springframework/context/ApplicationEventPublisher.java
浏览文件 @
2b88c474
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -18,7 +18,8 @@ package org.springframework.context;
/**
* Interface that encapsulates event publication functionality.
* Serves as super-interface for {@link ApplicationContext}.
*
* <p>Serves as a super-interface for {@link ApplicationContext}.
*
* @author Juergen Hoeller
* @author Stephane Nicoll
...
...
spring-context/src/main/java/org/springframework/context/ApplicationListener.java
浏览文件 @
2b88c474
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -20,18 +20,21 @@ import java.util.EventListener;
/**
* Interface to be implemented by application event listeners.
* Based on the standard {@code java.util.EventListener} interface
*
* <p>Based on the standard {@code java.util.EventListener} interface
* for the Observer design pattern.
*
* <p>As of Spring 3.0, an
ApplicationListener can generically declare the event typ
e
* th
at it is interested in. When registered with a Spring ApplicationContext, events
*
will be filtered accordingly, with the listener getting invoked for matching event
* objects only.
* <p>As of Spring 3.0, an
{@code ApplicationListener} can generically declar
e
* th
e event type that it is interested in. When registered with a Spring
*
{@code ApplicationContext}, events will be filtered accordingly, with the
*
listener getting invoked for matching event
objects only.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @param <E> the specific ApplicationEvent subclass to listen to
* @param <E> the specific {@code ApplicationEvent} subclass to listen to
* @see org.springframework.context.ApplicationEvent
* @see org.springframework.context.event.ApplicationEventMulticaster
* @see org.springframework.context.event.EventListener
*/
@FunctionalInterface
public
interface
ApplicationListener
<
E
extends
ApplicationEvent
>
extends
EventListener
{
...
...
spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java
浏览文件 @
2b88c474
/*
* Copyright 2002-201
7
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -23,15 +23,16 @@ import org.springframework.lang.Nullable;
/**
* Interface to be implemented by objects that can manage a number of
* {@link ApplicationListener} objects
,
and publish events to them.
* {@link ApplicationListener} objects and publish events to them.
*
* <p>An {@link org.springframework.context.ApplicationEventPublisher}, typically
* a Spring {@link org.springframework.context.ApplicationContext}, can use an
*
ApplicationEventMulticaster
as a delegate for actually publishing events.
*
{@code ApplicationEventMulticaster}
as a delegate for actually publishing events.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @author Stephane Nicoll
* @see ApplicationListener
*/
public
interface
ApplicationEventMulticaster
{
...
...
@@ -55,21 +56,21 @@ public interface ApplicationEventMulticaster {
/**
* Remove a listener bean from the notification list.
* @param listenerBeanName the name of the listener bean to
add
* @param listenerBeanName the name of the listener bean to
remove
*/
void
removeApplicationListenerBean
(
String
listenerBeanName
);
/**
* Remove all listeners registered with this multicaster.
* <p>After a remove call, the multicaster will perform no action
* on event notification until new listeners are
being
registered.
* on event notification until new listeners are registered.
*/
void
removeAllListeners
();
/**
* Multicast the given application event to appropriate listeners.
* <p>Consider using {@link #multicastEvent(ApplicationEvent, ResolvableType)}
* if possible as it provides
a
better support for generics-based events.
* if possible as it provides better support for generics-based events.
* @param event the event to multicast
*/
void
multicastEvent
(
ApplicationEvent
event
);
...
...
@@ -79,7 +80,7 @@ public interface ApplicationEventMulticaster {
* <p>If the {@code eventType} is {@code null}, a default type is built
* based on the {@code event} instance.
* @param event the event to multicast
* @param eventType the type of event (can be
null
)
* @param eventType the type of event (can be
{@code null}
)
* @since 4.2
*/
void
multicastEvent
(
ApplicationEvent
event
,
@Nullable
ResolvableType
eventType
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录