@Override void getNotificationDescriptions(ListIterator<PathElement> iterator, Map<String, NotificationEntry> providers, boolean inherited) { Map<String, NotificationEntry> temp = new HashMap<String, NotificationEntry>(); target.getNotificationDescriptions(iterator, temp, inherited); for (Map.Entry<String, NotificationEntry> entry : providers.entrySet()) { providers.put(entry.getKey(), new NotificationEntry(entry.getValue().getDescriptionProvider(), entry.getValue().isInherited())); } }
@Override void getNotificationDescriptions(ListIterator<PathElement> iterator, Map<String, NotificationEntry> providers, boolean inherited) { Map<String, NotificationEntry> temp = new HashMap<String, NotificationEntry>(); target.getNotificationDescriptions(iterator, temp, inherited); for (Map.Entry<String, NotificationEntry> entry : providers.entrySet()) { providers.put(entry.getKey(), new NotificationEntry(entry.getValue().getDescriptionProvider(), entry.getValue().isInherited())); } }
@Override void getNotificationDescriptions(ListIterator<PathElement> iterator, Map<String, NotificationEntry> providers, boolean inherited) { Map<String, NotificationEntry> temp = new HashMap<String, NotificationEntry>(); target.getNotificationDescriptions(iterator, temp, inherited); for (Map.Entry<String, NotificationEntry> entry : providers.entrySet()) { providers.put(entry.getKey(), new NotificationEntry(entry.getValue().getDescriptionProvider(), entry.getValue().isInherited())); } }
@Override public void registerNotification(NotificationDefinition notification, boolean inherited) { checkPermission(); String type = notification.getType(); NotificationEntry entry = new NotificationEntry(notification.getDescriptionProvider(), inherited); writeLock.lock(); try { if (notifications == null) { notifications = Collections.singletonMap(type, entry); } else { if (notifications.containsKey(type)) { throw alreadyRegistered(NOTIFICATION, type); } if (notifications.size() == 1) { notifications = new HashMap<>(notifications); } notifications.put(type, entry); } } finally { writeLock.unlock(); } }
@Override public void registerNotification(NotificationDefinition notification, boolean inherited) { checkPermission(); String type = notification.getType(); NotificationEntry entry = new NotificationEntry(notification.getDescriptionProvider(), inherited); writeLock.lock(); try { if (notifications == null) { notifications = Collections.singletonMap(type, entry); } else { if (notifications.containsKey(type)) { throw alreadyRegistered(NOTIFICATION, type); } if (notifications.size() == 1) { notifications = new HashMap<>(notifications); } notifications.put(type, entry); } } finally { writeLock.unlock(); } }
@Override public void registerNotification(NotificationDefinition notification, boolean inherited) { NotificationEntry entry = new NotificationEntry(notification.getDescriptionProvider(), inherited); checkPermission(); if (notificationsUpdater.putIfAbsent(this, notification.getType(), entry) != null) { throw alreadyRegistered(NOTIFICATION, notification.getType()); } }