Examples of CacheLoader


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

Examples of org.jboss.cache.loader.CacheLoader

      {
         LOG.error("The CacheLoaderManager cannot be found");
         return null;
      }

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

Examples of org.jboss.cache.loader.CacheLoader

   }

   protected void integratePersistentState(ObjectInputStream in, Fqn targetFqn) throws Exception
   {
      CacheLoaderManager loaderManager = cache.getCacheLoaderManager();
      CacheLoader loader = loaderManager == null ? null : loaderManager.getCacheLoader();
      if (loader == null)
      {
         if (trace)
         {
            log.trace("cache loader is null, will not attempt to integrate persistent state");
         }
      }
      else
      {

         if (trace)
         {
            log.trace("integrating persistent state using " + loader.getClass().getName());
         }

         boolean persistentSet = false;
         try
         {
            if (targetFqn.isRoot())
            {
               loader.storeEntireState(in);
            }
            else
            {
               loader.storeState(targetFqn, in);
            }
            persistentSet = true;
         }
         catch (ClassCastException cce)
         {
            log.error("Failed integrating persistent state. One of cacheloaders is not"
                  + " adhering to state stream format. See JBCACHE-738.");
            throw cce;
         }
         finally
         {
            if (!persistentSet)
            {
               log.warn("persistent state integration failed, removing all nodes from loader");
               loader.remove(targetFqn);
            }
            else
            {
               if (trace)
               {
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

   protected void integratePersistentState(ObjectInputStream in, Fqn targetFqn) throws Exception
   {
      if (trace) log.trace("Reading persistent state from stream");
      CacheLoaderManager loaderManager = cache.getCacheLoaderManager();
      CacheLoader loader = loaderManager == null ? null : loaderManager.getCacheLoader();
      if (loader == null)
      {
         if (log.isTraceEnabled())
         {
            log.trace("cache loader is null, will not attempt to integrate persistent state");
         }
      }
      else
      {

         if (log.isTraceEnabled())
         {
            log.trace("integrating persistent state using " + loader.getClass().getName());
         }

         boolean persistentSet = false;
         try
         {
            if (targetFqn.isRoot())
            {
               loader.storeEntireState(in);
            }
            else
            {
               loader.storeState(targetFqn, in);
            }
            persistentSet = true;
         }
         catch (ClassCastException cce)
         {
            log.error("Failed integrating persistent state. One of cacheloaders is not"
                  + " adhering to state stream format. See JBCACHE-738.");
            throw cce;
         }
         finally
         {
            if (!persistentSet)
            {
               log.warn("persistent state integration failed, removing all nodes from loader");
               loader.remove(targetFqn);
            }
            else
            {
               if (log.isTraceEnabled())
               {
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

            //we have to write two markers for transient and associated
            delimitStream(out);
            delimitStream(out);
         }

         CacheLoader cacheLoader = cache.getCacheLoaderManager() == null ? null : cache.getCacheLoaderManager().getCacheLoader();
         if (cacheLoader != null && generatePersistent)
         {
            if (log.isTraceEnabled())
            {
               log.trace("writing persistent state for " + fqn + ",using " + cache.getCacheLoaderManager().getCacheLoader().getClass());
            }

            if (fqn.isRoot())
            {
               cacheLoader.loadEntireState(out);
            }
            else
            {
               cacheLoader.loadState(fqn, out);
            }

            if (log.isTraceEnabled())
            {
               log.trace("persistent state succesfully written");
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

            //we have to write two markers for transient and associated
            delimitStream(out);
            delimitStream(out);
         }

         CacheLoader cacheLoader = cache.getCacheLoaderManager() == null ? null : cache.getCacheLoaderManager().getCacheLoader();
         if (cacheLoader != null && generatePersistent)
         {
            if (log.isTraceEnabled())
            {
               log.trace("writing persistent state for " + fqn + ",using " + cache.getCacheLoaderManager().getCacheLoader().getClass());
            }

            if (fqn.isRoot())
            {
               cacheLoader.loadEntireState(out);
            }
            else
            {
               cacheLoader.loadState(fqn, out);
            }

            if (log.isTraceEnabled())
            {
               log.trace("persistent state succesfully written");
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

   }

   protected void integratePersistentState(ObjectInputStream in, Fqn targetFqn) throws Exception
   {
      CacheLoaderManager loaderManager = cache.getCacheLoaderManager();
      CacheLoader loader = loaderManager == null ? null : loaderManager.getCacheLoader();
      if (loader == null)
      {
         if (trace)
         {
            log.trace("cache loader is null, will not attempt to integrate persistent state");
         }
      }
      else
      {

         if (trace)
         {
            log.trace("integrating persistent state using " + loader.getClass().getName());
         }

         boolean persistentSet = false;
         try
         {
            if (targetFqn.isRoot())
            {
               loader.storeEntireState(in);
            }
            else
            {
               loader.storeState(targetFqn, in);
            }
            persistentSet = true;
         }
         catch (ClassCastException cce)
         {
            log.error("Failed integrating persistent state. One of cacheloaders is not"
                  + " adhering to state stream format. See JBCACHE-738.");
            throw cce;
         }
         finally
         {
            if (!persistentSet)
            {
               log.warn("persistent state integration failed, removing all nodes from loader");
               loader.remove(targetFqn);
            }
            else
            {
               if (trace)
               {
View Full Code Here

Examples of org.jboss.cache.loader.CacheLoader

               }

               CacheLoaderManager clm = c.getCacheLoaderManager();
               if (clm != null)
               {
                  CacheLoader cl = c.getCacheLoaderManager().getCacheLoader();
                  try
                  {
                     if (cl != null) cl.remove(Fqn.ROOT);
                  }
                  catch (Exception e)
                  {
                     // unable to clean cache loader
                     e.printStackTrace();
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
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.