Package org.jboss.cache.loader

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


         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

   }

   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

      // 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

      // 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

{

   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

      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

      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

      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

      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

Related Classes of org.jboss.cache.loader.CacheLoader

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.