mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Make ApplicationAvailabilityBean threadsafe
See gh-30489
This commit is contained in:
parent
41ab46d0c7
commit
035a16278e
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package org.springframework.boot.availability;
|
package org.springframework.boot.availability;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
|||||||
public class ApplicationAvailabilityBean
|
public class ApplicationAvailabilityBean
|
||||||
implements ApplicationAvailability, ApplicationListener<AvailabilityChangeEvent<?>> {
|
implements ApplicationAvailability, ApplicationListener<AvailabilityChangeEvent<?>> {
|
||||||
|
|
||||||
private final Map<Class<? extends AvailabilityState>, AvailabilityChangeEvent<?>> events = new HashMap<>();
|
private final Map<Class<? extends AvailabilityState>, AvailabilityChangeEvent<?>> events = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final Log logger;
|
private final Log logger;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user