Examples of EAExoCache


Examples of org.exoplatform.services.cache.impl.jboss.ea.EAExoCacheCreator.EAExoCache

      testPolicy("test-ea-with-old-config");
   }

   private void testPolicy(String cacheName) throws Exception
   {
      EAExoCache cache = (EAExoCache)service_.getCacheInstance(cacheName);
      cache.put("a", "a");
      cache.put("b", "a");
      cache.put("c", "a");
      cache.put("d", "a");
      Thread.sleep(1000);
      assertEquals(4, cache.getCacheSize());
      cache.put("e", "a");
      assertEquals(5, cache.getCacheSize());
      cache.put("f", "a");
      assertEquals(6, cache.getCacheSize());
      Thread.sleep(1100);
      assertEquals(2, cache.getCacheSize());
      Thread.sleep(1000);
      assertEquals(0, cache.getCacheSize());
      cache.setMaxSize(3);
      cache.setLiveTime(400);
      cache.setExpirationTimeout(500);
      cache.put("a", "a");
      cache.put("b", "a");
      cache.put("c", "a");
      cache.put("d", "a");
      assertEquals(4, cache.getCacheSize());
      cache.put("e", "a");
      assertEquals(5, cache.getCacheSize());
      cache.put("f", "a");
      Thread.sleep(600);
      assertEquals(0, cache.getCacheSize());
   }
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.