public synchronized void remoteServerRegistrations ( RESTRequest request ) { Iterator < Entry < NotificationTargetInformation , List < ServerNotification > > > serverNotificationsIter = serverNotifications . entrySet ( ) . iterator ( ) ; while ( serverNotificationsIter . hasNext ( ) ) { Entry < NotificationTargetInformation , List < ServerNotification > > entry = serverNotificationsIter . next ( ) ; NotificationTargetInformation nti = entry . getKey ( ) ; // Check whether the producer of the notification is local or remote. if ( nti . getRoutingInformation ( ) == null ) { //Traverse the list for that ObjectName ObjectName objName = RESTHelper . objectNameConverter ( nti . getNameAsString ( ) , false , null ) ; if ( MBeanServerHelper . isRegistered ( objName ) ) { for ( ServerNotification notification : entry . getValue ( ) ) { MBeanServerHelper . removeServerNotification ( objName , notification . listener , ( NotificationFilter ) getObject ( notification . filter , null , null ) , getObject ( notification . handback , null , null ) , null ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The MBean is not registered with the MBean server." ) ; } } } else { // Remove the notification listener from the Target-Client Manager through EventAdmin MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper . getMBeanRoutedNotificationHelper ( ) ; for ( ServerNotification notification : entry . getValue ( ) ) { helper . removeRoutedServerNotificationListener ( nti , notification . listener , ( NotificationFilter ) getObject ( notification . filter , null , null ) , getObject ( notification . handback , null , null ) , null ) ; } } } //Clear the map serverNotifications . clear ( ) ; //We don't have any more server notifications, so we can clear our library clearObjectLibrary ( ) ; }
Remove all the server notifications