Package org.springframework.cache

Examples of org.springframework.cache.Cache.evict()


    cm.setAllowNullValues(true);
    Cache cache1y = cm.getCache("c1");

    cache1y.put("key3", null);
    assertNull(cache1y.get("key3").get());
    cache1y.evict("key3");
    assertNull(cache1y.get("key3"));
  }

}
View Full Code Here


    Cache target = new ConcurrentMapCache("testCache");
    Cache cache = new TransactionAwareCacheDecorator(target);
    Object key = new Object();
    cache.put(key, "123");

    cache.evict(key);
    assertNull(target.get(key));
  }

  @Test
  public void evictTransactional() {
View Full Code Here

    cache.put(key, "123");


    TransactionStatus status = txManager.getTransaction(new DefaultTransactionAttribute(
        TransactionDefinition.PROPAGATION_REQUIRED));
    cache.evict(key);
    assertEquals("123", target.get(key, String.class));
    txManager.commit(status);

    assertNull(target.get(key));
  }
View Full Code Here

    cm.setAllowNullValues(true);
    Cache cache1y = cm.getCache("c1");

    cache1y.put("key3", null);
    assertNull(cache1y.get("key3").get());
    cache1y.evict("key3");
    assertNull(cache1y.get("key3"));
  }

  @Test
  public void changeCacheSpecificationRecreateCache() {
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.