public synchronized void remoteClientRegistrations ( RESTRequest request ) { Iterator < Entry < NotificationTargetInformation , ClientNotificationListener > > clientListeners = listeners . entrySet ( ) . iterator ( ) ; try { while ( clientListeners . hasNext ( ) ) { Entry < NotificationTargetInformation , ClientNotificationListener > clientListener = clientListeners . next ( ) ; NotificationTargetInformation nti = clientListener . getKey ( ) ; ClientNotificationListener listener = clientListener . getValue ( ) ; // Check whether the producer of the notification is local or remote. if ( nti . getRoutingInformation ( ) == null ) { // Remove the notification from the MBeanServer ObjectName objName = RESTHelper . objectNameConverter ( nti . getNameAsString ( ) , false , null ) ; if ( MBeanServerHelper . isRegistered ( objName ) ) { try { MBeanServerHelper . removeClientNotification ( objName , listener ) ; } catch ( RESTHandlerJsonException exception ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Received exception while cleaning up: " + exception ) ; } } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The MBean " + objName + " is not registered with the MBean server." ) ; } } } else { // Remove the notification listener from the Target-Client Manager through EventAdmin MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper . getMBeanRoutedNotificationHelper ( ) ; helper . removeRoutedNotificationListener ( nti , listener ) ; } } } finally { //Clear the map listeners . clear ( ) ; } }
Remove all the client notifications