Package java.util.concurrent

Examples of java.util.concurrent.CyclicBarrier.await()


               for (Modification mod : mods)
                  localMods.put(getKey(mod), mod);

               super.applyModificationsSync(mods);
               try {
                  barrier.await(waitTimeout, waitUnit);
               } catch (TimeoutException e) {
                  assert false : "Timed out applying for modifications";
               } catch (Exception e) {
                  throw new CacheLoaderException("Barrier failed", e);
               }
View Full Code Here


         assert 0 == localMods.size();
         assert !store.containsKey(k1);
         assert !store.containsKey(k2);

         store.commit(tx);
         barrier.await(waitTimeout, waitUnit); // Wait for store
         barrier.await(waitTimeout, waitUnit); // Wait for remove
         assert store.load(k2).getValue().equals(v2);
         assert !store.containsKey(k1);
         assert 2 == localMods.size();
         assert new Remove(k1).equals(localMods.get(k1));
View Full Code Here

         assert !store.containsKey(k1);
         assert !store.containsKey(k2);

         store.commit(tx);
         barrier.await(waitTimeout, waitUnit); // Wait for store
         barrier.await(waitTimeout, waitUnit); // Wait for remove
         assert store.load(k2).getValue().equals(v2);
         assert !store.containsKey(k1);
         assert 2 == localMods.size();
         assert new Remove(k1).equals(localMods.get(k1));
      } finally {
View Full Code Here

            protected void applyModificationsSync(List<Modification> mods)
                  throws CacheLoaderException {
               super.applyModificationsSync(mods);
               try {
                  log.tracef("Wait to apply modifications: %s", mods);
                  barrier.await(waitTimeout, waitUnit);
               } catch (TimeoutException e) {
                  assert false : "Timed out applying for modifications";
               } catch (Exception e) {
                  throw new CacheLoaderException("Barrier failed", e);
               }
View Full Code Here

         assert 0 == storeCount.get();
         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         log.tracef("Wait for modifications to be queued: %s", mods);
         barrier.await(waitTimeout, waitUnit); // Wait for single store to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for single remove to be applied
         assert 1 == storeCount.get() : "Store count was " + storeCount.get();
         assert 1 == removeCount.get();
         assert 0 == clearCount.get();
View Full Code Here

         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         log.tracef("Wait for modifications to be queued: %s", mods);
         barrier.await(waitTimeout, waitUnit); // Wait for single store to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for single remove to be applied
         assert 1 == storeCount.get() : "Store count was " + storeCount.get();
         assert 1 == removeCount.get();
         assert 0 == clearCount.get();

         storeCount.set(0);
View Full Code Here

         Thread.sleep(200); //verify that work is not performed until commit
         assert 0 == storeCount.get();
         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         barrier.await(waitTimeout, waitUnit);
         assert 0 == storeCount.get() : "Store count was " + storeCount.get();
         assert 1 == removeCount.get();
         assert 1 == clearCount.get();

         storeCount.set(0);
View Full Code Here

         Thread.sleep(200);
         assert 0 == storeCount.get();
         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         barrier.await(waitTimeout, waitUnit); // Wait for store to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for first removal to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for second removal to be applied
         assert 1 == storeCount.get() : "Store count was " + storeCount.get();
         assert 2 == removeCount.get();
         assert 0 == clearCount.get();
View Full Code Here

         assert 0 == storeCount.get();
         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         barrier.await(waitTimeout, waitUnit); // Wait for store to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for first removal to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for second removal to be applied
         assert 1 == storeCount.get() : "Store count was " + storeCount.get();
         assert 2 == removeCount.get();
         assert 0 == clearCount.get();
View Full Code Here

         assert 0 == removeCount.get();
         assert 0 == clearCount.get();
         store.commit(tx);
         barrier.await(waitTimeout, waitUnit); // Wait for store to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for first removal to be applied
         barrier.await(waitTimeout, waitUnit); // Wait for second removal to be applied
         assert 1 == storeCount.get() : "Store count was " + storeCount.get();
         assert 2 == removeCount.get();
         assert 0 == clearCount.get();

         storeCount.set(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.