Improve JSON-RPC subscribeReceive method with subscription id

This commit is contained in:
AsamK 2022-01-30 16:35:11 +01:00
parent e5a8cdb056
commit be0993c5d8
9 changed files with 158 additions and 43 deletions

View file

@ -10,6 +10,8 @@ public interface MultiAccountManager extends AutoCloseable {
List<String> getAccountNumbers();
List<Manager> getManagers();
void addOnManagerAddedHandler(Consumer<Manager> handler);
void addOnManagerRemovedHandler(Consumer<Manager> handler);

View file

@ -49,6 +49,13 @@ public class MultiAccountManagerImpl implements MultiAccountManager {
}
}
@Override
public List<Manager> getManagers() {
synchronized (managers) {
return new ArrayList<>(managers);
}
}
void addManager(final Manager m) {
synchronized (managers) {
if (managers.contains(m)) {