Package org.infinispan.loaders.modifications

Examples of org.infinispan.loaders.modifications.Clear


      return true;
   }

   @Override
   public void clear() {
      Clear clear = new Clear();
      enqueue(clear, clear);
   }
View Full Code Here


      cacheMap.clear();

      mods = new ArrayList<Modification>();
      mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
      mods.add(new Clear());
      mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));

      prepare(mods, tx, true);
      assert !cacheMap.containsKey("k1");
      assert !cacheMap.containsKey("k2");
View Full Code Here

      cacheMap.clear();

      mods = new ArrayList<Modification>();
      mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
      mods.add(new Clear());
      mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));

      prepare(mods, tx, false);

      Thread gets2 = new Thread(
View Full Code Here

      assert cacheMap.containsKey("old");

      mods = new ArrayList<Modification>();
      mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
      mods.add(new Clear());
      mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));

      prepare(mods, tx, false);

      rollback(tx);
View Full Code Here

      cs.clear();

      mods = new ArrayList<Modification>();
      mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
      mods.add(new Clear());
      mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));

      cs.prepare(mods, tx, false);
      cs.commit(tx);
View Full Code Here

      assert cs.containsKey("old");

      mods = new ArrayList<Modification>();
      mods.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      mods.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2")));
      mods.add(new Clear());
      mods.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));

      cs.prepare(mods, tx, false);
      cs.rollback(tx);
View Full Code Here

   }

   @Test
   public void testDoWorkOnClear() throws Exception {
      CacheStore cs = mock(CacheStore.class);
      Clear clear = mock(Clear.class);
      when(clear.getType()).thenReturn(Modification.Type.CLEAR);
      cs.clear();

      ModificationsTransactionWorker worker =
            new ModificationsTransactionWorker(cs,
                                               Collections.singletonList(clear));
View Full Code Here

      }

      @Override
      public Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable {
         if (isProperWriterForClear(ctx)) {
            modifications.add(new Clear());
         }
         return null;
      }
View Full Code Here

      List<Modification> list = new LinkedList<Modification>();
      list.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      list.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2", lifespan)));
      list.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));
      list.add(new Remove("k3"));
      list.add(new Clear());
      list.add(new Store(TestInternalCacheEntryFactory.create("k4", "v4")));
      list.add(new Store(TestInternalCacheEntryFactory.create("k5", "v5", lifespan)));
      list.add(new Store(TestInternalCacheEntryFactory.create("k6", "v6")));
      list.add(new Remove("k6"));
      GlobalTransaction t = gtf.newGlobalTransaction(null, false);
View Full Code Here

      List<Modification> list = new LinkedList<Modification>();
      list.add(new Store(TestInternalCacheEntryFactory.create("k1", "v1")));
      list.add(new Store(TestInternalCacheEntryFactory.create("k2", "v2", lifespan)));
      list.add(new Store(TestInternalCacheEntryFactory.create("k3", "v3")));
      list.add(new Remove("k3"));
      list.add(new Clear());
      list.add(new Store(TestInternalCacheEntryFactory.create("k4", "v4")));
      list.add(new Store(TestInternalCacheEntryFactory.create("k5", "v5", lifespan)));
      list.add(new Store(TestInternalCacheEntryFactory.create("k6", "v6")));
      list.add(new Remove("k6"));
      GlobalTransaction tx = gtf.newGlobalTransaction(null, false);
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.modifications.Clear

Copyright © 2018 www.massapicom. 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.