refactor: 修改成员变量访问权限

This commit is contained in:
椰子 2021-07-16 10:37:26 +08:00
parent 9570df8b14
commit 90a8102ee3

View File

@ -13,11 +13,11 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public abstract class AbstractNotifierManager implements NotifierManager {
private final Map<String, Map<String, NotifierProvider>> providers = new ConcurrentHashMap<>();
protected final Map<String, Map<String, NotifierProvider>> providers = new ConcurrentHashMap<>();
private final Map<String, Notifier> notifiers = new ConcurrentHashMap<>();
protected final Map<String, Notifier> notifiers = new ConcurrentHashMap<>();
private final NotifyConfigManager configManager;
protected final NotifyConfigManager configManager;
// private EventBus eventBus;
@ -47,12 +47,12 @@ public abstract class AbstractNotifierManager implements NotifierManager {
if (null == provider) {
throw new UnsupportedOperationException("不支持的服务商: " + properties.getProvider());
}
Notifier notifier1 = provider.createNotifier(properties);
Notifier notifier2 = notifiers.put(properties.getId(), notifier1);
if (null != notifier2) {
notifier2.close();
Notifier notifierNew = provider.createNotifier(properties);
Notifier notifierOld = notifiers.put(properties.getId(), notifierNew);
if (null != notifierOld) {
notifierOld.close();
}
return notifier1;
return notifierNew;
}
@Override