Skip to content

Commit 2b88c47

Browse files
committed
Polish Javadoc for application event infrastructure
1 parent e6d206b commit 2b88c47

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

spring-context/src/main/java/org/springframework/context/ApplicationEvent.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@
2424
*
2525
* @author Rod Johnson
2626
* @author Juergen Hoeller
27+
* @see org.springframework.context.ApplicationListener
28+
* @see org.springframework.context.event.EventListener
2729
*/
2830
public abstract class ApplicationEvent extends EventObject {
2931

@@ -35,8 +37,9 @@ public abstract class ApplicationEvent extends EventObject {
3537

3638

3739
/**
38-
* Create a new ApplicationEvent.
39-
* @param source the object on which the event initially occurred (never {@code null})
40+
* Create a new {@code ApplicationEvent}.
41+
* @param source the object on which the event initially occurred or with
42+
* which the event is associated (never {@code null})
4043
*/
4144
public ApplicationEvent(Object source) {
4245
super(source);
@@ -45,7 +48,7 @@ public ApplicationEvent(Object source) {
4548

4649

4750
/**
48-
* Return the system time in milliseconds when the event happened.
51+
* Return the system time in milliseconds when the event occurred.
4952
*/
5053
public final long getTimestamp() {
5154
return this.timestamp;

spring-context/src/main/java/org/springframework/context/ApplicationEventPublisher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,8 @@
1818

1919
/**
2020
* Interface that encapsulates event publication functionality.
21-
* Serves as super-interface for {@link ApplicationContext}.
21+
*
22+
* <p>Serves as a super-interface for {@link ApplicationContext}.
2223
*
2324
* @author Juergen Hoeller
2425
* @author Stephane Nicoll

spring-context/src/main/java/org/springframework/context/ApplicationListener.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,18 +20,21 @@
2020

2121
/**
2222
* Interface to be implemented by application event listeners.
23-
* Based on the standard {@code java.util.EventListener} interface
23+
*
24+
* <p>Based on the standard {@code java.util.EventListener} interface
2425
* for the Observer design pattern.
2526
*
26-
* <p>As of Spring 3.0, an ApplicationListener can generically declare the event type
27-
* that it is interested in. When registered with a Spring ApplicationContext, events
28-
* will be filtered accordingly, with the listener getting invoked for matching event
29-
* objects only.
27+
* <p>As of Spring 3.0, an {@code ApplicationListener} can generically declare
28+
* the event type that it is interested in. When registered with a Spring
29+
* {@code ApplicationContext}, events will be filtered accordingly, with the
30+
* listener getting invoked for matching event objects only.
3031
*
3132
* @author Rod Johnson
3233
* @author Juergen Hoeller
33-
* @param <E> the specific ApplicationEvent subclass to listen to
34+
* @param <E> the specific {@code ApplicationEvent} subclass to listen to
35+
* @see org.springframework.context.ApplicationEvent
3436
* @see org.springframework.context.event.ApplicationEventMulticaster
37+
* @see org.springframework.context.event.EventListener
3538
*/
3639
@FunctionalInterface
3740
public interface ApplicationListener<E extends ApplicationEvent> extends EventListener {

spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,15 +23,16 @@
2323

2424
/**
2525
* Interface to be implemented by objects that can manage a number of
26-
* {@link ApplicationListener} objects, and publish events to them.
26+
* {@link ApplicationListener} objects and publish events to them.
2727
*
2828
* <p>An {@link org.springframework.context.ApplicationEventPublisher}, typically
2929
* a Spring {@link org.springframework.context.ApplicationContext}, can use an
30-
* ApplicationEventMulticaster as a delegate for actually publishing events.
30+
* {@code ApplicationEventMulticaster} as a delegate for actually publishing events.
3131
*
3232
* @author Rod Johnson
3333
* @author Juergen Hoeller
3434
* @author Stephane Nicoll
35+
* @see ApplicationListener
3536
*/
3637
public interface ApplicationEventMulticaster {
3738

@@ -55,21 +56,21 @@ public interface ApplicationEventMulticaster {
5556

5657
/**
5758
* Remove a listener bean from the notification list.
58-
* @param listenerBeanName the name of the listener bean to add
59+
* @param listenerBeanName the name of the listener bean to remove
5960
*/
6061
void removeApplicationListenerBean(String listenerBeanName);
6162

6263
/**
6364
* Remove all listeners registered with this multicaster.
6465
* <p>After a remove call, the multicaster will perform no action
65-
* on event notification until new listeners are being registered.
66+
* on event notification until new listeners are registered.
6667
*/
6768
void removeAllListeners();
6869

6970
/**
7071
* Multicast the given application event to appropriate listeners.
7172
* <p>Consider using {@link #multicastEvent(ApplicationEvent, ResolvableType)}
72-
* if possible as it provides a better support for generics-based events.
73+
* if possible as it provides better support for generics-based events.
7374
* @param event the event to multicast
7475
*/
7576
void multicastEvent(ApplicationEvent event);
@@ -79,7 +80,7 @@ public interface ApplicationEventMulticaster {
7980
* <p>If the {@code eventType} is {@code null}, a default type is built
8081
* based on the {@code event} instance.
8182
* @param event the event to multicast
82-
* @param eventType the type of event (can be null)
83+
* @param eventType the type of event (can be {@code null})
8384
* @since 4.2
8485
*/
8586
void multicastEvent(ApplicationEvent event, @Nullable ResolvableType eventType);

0 commit comments

Comments
 (0)