private void removeListenersOfAllPendingCachedRequests ( ) throws InterruptedException { synchronized ( mapPendingRequestToRequestListener ) { if ( ! mapPendingRequestToRequestListener . isEmpty ( ) ) { for ( final CachedSpiceRequest < ? > cachedSpiceRequest : mapPendingRequestToRequestListener . keySet ( ) ) { final Set < RequestListener < ? > > setRequestListeners = mapPendingRequestToRequestListener . get ( cachedSpiceRequest ) ; if ( setRequestListeners != null ) { Ln . d ( "Removing listeners of pending request : " + cachedSpiceRequest . toString ( ) + " : " + setRequestListeners . size ( ) ) ; spiceService . dontNotifyRequestListenersForRequest ( cachedSpiceRequest , setRequestListeners ) ; } } mapPendingRequestToRequestListener . clear ( ) ; } } Ln . v ( "Cleared listeners of all pending requests" ) ; }
Asynchronously ask service to remove all listeners of pending requests .