public void addClientNotificationListener(RESTRequest request, NotificationRegistration notificationRegistration, JSONConverter converter) {
        String objectNameStr = notificationRegistration.objectName.getCanonicalName();

        NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);

        // Get the listener
        ClientNotificationListener listener = listeners.get(nti);
        if (listener == null) {
            listener = new ClientNotificationListener(this);
            ClientNotificationListener mapListener = listeners.putIfAbsent(nti, listener);

            if (mapListener != null) {
                listener = mapListener;
            }
        }

        // Grab the wrapper filter which will be registered in the MBeanServer
        NotificationFilter filter = listener.getClientWrapperFilter();

        // Check whether the producer of the notification is local or remote.
        if (nti.getRoutingInformation() == null) {
            // Add the notification in the MBeanServer        
            MBeanServerHelper.addClientNotification(notificationRegistration.objectName,
                                                    listener,
                                                    filter,
                                                    null,
                                                    converter);
        } else {
            // Add the notification listener to the Target-Client Manager through EventAdmin
            MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
            helper.addRoutedNotificationListener(nti, listener, converter);
        }

        // Add the filters to the listener
        listener.addClientNotification(notificationRegistration.filters);
    }
public void addClientNotificationListener ( RESTRequest request , NotificationRegistration notificationRegistration , JSONConverter converter ) { String objectNameStr = notificationRegistration . objectName . getCanonicalName ( ) ; NotificationTargetInformation nti = toNotificationTargetInformation ( request , objectNameStr ) ; ClientNotificationListener listener = listeners . get ( nti ) ; if ( listener == null ) { listener = new ClientNotificationListener ( this ) ; ClientNotificationListener mapListener = listeners . putIfAbsent ( nti , listener ) ; if ( mapListener != null ) { listener = mapListener ; } } NotificationFilter filter = listener . getClientWrapperFilter ( ) ; if ( nti . getRoutingInformation ( ) == null ) { MBeanServerHelper . addClientNotification ( notificationRegistration . objectName , listener , filter , null , converter ) ; } else { MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper . getMBeanRoutedNotificationHelper ( ) ; helper . addRoutedNotificationListener ( nti , listener , converter ) ; } listener . addClientNotification ( notificationRegistration . filters ) ; }
Fetch or create a new listener for the given object name