private void loadAllWithAsyncLoader ( final CacheOperationCompletionListener _listener , final Set < K > _keysToLoad ) { final AtomicInteger _countDown = new AtomicInteger ( _keysToLoad . size ( ) ) ; EntryAction . ActionCompletedCallback cb = new EntryAction . ActionCompletedCallback ( ) { @ Override public void entryActionCompleted ( final EntryAction ea ) { int v = _countDown . decrementAndGet ( ) ; if ( v == 0 ) { _listener . onCompleted ( ) ; return ; } } } ; for ( K k : _keysToLoad ) { final K key = k ; executeAsync ( key , null , SPEC . GET , cb ) ; } }
Load the keys into the cache via the async path . The key set must always be non empty . The completion listener is called when all keys are loaded .