Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.function.Supplier;

/**
* Unified event notify center.
Expand All @@ -43,7 +44,7 @@ public class NotifyCenter {

private DefaultSharePublisher sharePublisher;

private static EventPublisher eventPublisher = new DefaultPublisher();
private static final Supplier<EventPublisher> publisherSupplier = DefaultPublisher::new;

private static BiFunction<Class<? extends AbstractEvent>, Integer, EventPublisher> publisherFactory;

Expand All @@ -52,7 +53,7 @@ public class NotifyCenter {
static {
publisherFactory = (cls, buffer) -> {
try {
EventPublisher publisher = eventPublisher;
EventPublisher publisher = publisherSupplier.get();
publisher.init(cls, buffer);
return publisher;
} catch (Throwable ex) {
Expand Down