Examples of CacheLoader


Examples of org.infinispan.loaders.spi.CacheLoader

   @SuppressWarnings("unchecked")
   public <T extends CacheLoader> List<T> getCacheLoaders(Class<T> loaderClass) {
      Set<T> matchingLoaders = new LinkedHashSet<T>();

      for (CacheStore cs : stores.keySet()) {
         CacheLoader ucs = undelegateCacheLoader(cs);
         if (loaderClass.isInstance(ucs)) matchingLoaders.add((T) ucs);
      }

      for (CacheLoader cl : loaders.keySet()) {
         if (loaderClass.isInstance(cl)) matchingLoaders.add((T) cl);
View Full Code Here

Examples of org.infinispan.persistence.spi.CacheLoader

      return TestCacheManagerFactory.createCacheManager(builder);
   }

   public void testFilteredKeyLoad() throws CacheLoaderException {
      CacheLoader loader = TestingUtil.getFirstLoader(cache);
      AssertJUnit.assertNotNull(loader);
      AssertJUnit.assertTrue(loader instanceof LuceneCacheLoader);
      LuceneCacheLoader cacheLoader = (LuceneCacheLoader) loader;
      PersistenceUtil.count(cacheLoader, null);
   }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

   public void clearCacheLoader() throws Exception
   {
      for (CacheManager mgr: getCacheManagers())
      {
         CacheSPI cache = (CacheSPI) mgr.getCache(getCacheConfigName(), false);
         CacheLoader cl = cache.getCacheLoaderManager().getCacheLoader();
         cl.remove(Fqn.ROOT);
      }
   }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

         throws Exception
   {
      CacheLoaderManager loaderManager = ((CacheSPI) cache).getCacheLoaderManager();
      if (loaderManager != null && loaderManager.getCacheLoader() != null)
      {
         CacheLoader cl = loaderManager.getCacheLoader();
         assert !cl.exists(fqn) : "found node for " + fqn + " on cache loader of cache " + cache.getLocalAddress();
      }
   }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

   }

   public void testPassivationLocal() throws Exception
   {
      CacheSPI cache = createLocalCache();
      CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();

      // clean up
      cache.removeNode(fqn);
      loader.remove(fqn);

      assertNull(loader.get(fqn));

      DummyTransactionManager mgr = DummyTransactionManager.getInstance();

      // put something in the cache
      mgr.begin();
      cache.put(fqn, key, value);
      mgr.commit();

      // should be nothing in the loader
      assertEquals(value, cache.get(fqn, key));
      assertNull(loader.get(fqn));

      // evict from cache
      mgr.begin();
      cache.evict(fqn);
      mgr.commit();

      mgr.begin();
      // should now be passivated in the loader
      // don't do a cache.get() first as this will activate this node from the loader again!
      // assertNull( cache.get( fqn ) );
      assertEquals(value, loader.get(fqn).get(key));

      // now do a cache.get()...
      assertEquals(value, cache.get(fqn, key));

      // and the object should now be removed from the loader
      assertNull(loader.get(fqn));
      mgr.commit();

      // clean up
      mgr.begin();
      cache.removeNode(fqn);
      loader.remove(fqn);
      mgr.commit();

   }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

      // remove the node - this will trigger NodeRemoved and NodeRemove(pre/post)
      cache.removeNode(key);

      // clean up before stopping  the cache
      CacheLoader cl = cache.getCacheLoaderManager().getCacheLoader();
      cl.remove(Fqn.fromString(EUROPE_NODE));

      // stop the cache
      cache.stop();
      m_server.removeNotificationListener(mgmt, listener);
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

      // Pause to give caches time to see each other
      TestingUtil.blockUntilViewsReceived(new CacheSPI[]{cache1, cache2}, 60000);

      if (asyncLoader) TestingUtil.sleepThread(100);

      CacheLoader loader = cache2.getCacheLoaderManager().getCacheLoader();

      long start = System.currentTimeMillis();
      while (asyncLoader && System.currentTimeMillis() - start < 10000)
      {
         try
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

{

   public void testLoaderIndependently() throws Exception
   {
      CacheSPI cache = createCacheWithLoader();
      CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();

      // test the cache loader independently first ...
      loader.remove(fqn);
      assert loader.get(fqn) == null;
      loader.put(fqn, key, value);
      assertEquals(value, loader.get(fqn).get(key));
      // clean up
      loader.remove(fqn);
      assertNull(loader.get(fqn));
   }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

      if (clm == null)
      {
         LOG.error("The CacheLoaderManager cannot be found");
         return;
      }
      CacheLoader currentCL = clm.getCacheLoader();
      if (currentCL == null)
      {
         LOG.error("The CacheLoader cannot be found");
         return;
      }
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

      if (clm == null)
      {
         LOG.error("The CacheLoaderManager cannot be found");
         return;
      }
      CacheLoader currentCL = clm.getCacheLoader();
      if (currentCL == null)
      {
         LOG.error("The CacheLoader cannot be found");
         return;
      }
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.