Package org.jboss.cache.loader

Examples of org.jboss.cache.loader.CacheLoaderManager


         {
            LOG.info("No cache loader has been defined, thus no need to encapsulate any cache loader.");
         }
         return;
      }
      CacheLoaderManager clm =
         ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(CacheLoaderManager.class);
      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;
      }

      ControllerCacheLoader ccl = new ControllerCacheLoader(currentCL);
     
      List<IndividualCacheLoaderConfig> newConfig = new ArrayList<IndividualCacheLoaderConfig>(1);
      // create CacheLoaderConfig
      IndividualCacheLoaderConfig cclConfig = new IndividualCacheLoaderConfig();
      // set CacheLoader
      cclConfig.setCacheLoader(ccl);
      // set parameters
      cclConfig.setFetchPersistentState(clm.isFetchPersistentState());
      cclConfig.setAsync(false);
      cclConfig.setIgnoreModifications(false);
      CacheLoaderConfig.IndividualCacheLoaderConfig first = config.getFirstCacheLoaderConfig();
      cclConfig.setPurgeOnStartup(first != null && first.isPurgeOnStartup());
      newConfig.add(cclConfig);
View Full Code Here


         {
            LOG.info("No cache loader has been defined, thus no need to encapsulate any cache loader.");
         }
         return null;
      }
      CacheLoaderManager clm =
         ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(CacheLoaderManager.class);
      if (clm == null)
      {
         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

   }

   protected void integratePersistentState(ObjectInputStream in) throws Exception
   {

      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");
View Full Code Here

   {
      // can't give state for regions currently being activated/inactivated
      boolean canProvideState = (!regionManager.isInactive(fqn) && cache.peek(fqn, false) != null);

      boolean fetchTransientState = configuration.isFetchInMemoryState();
      CacheLoaderManager cacheLoaderManager = cache.getCacheLoaderManager();
      boolean fetchPersistentState = cacheLoaderManager != null && cacheLoaderManager.isFetchPersistentState();

      if (canProvideState && (fetchPersistentState || fetchTransientState))
      {
         marshaller.objectToObjectStream(true, out);
         StateTransferGenerator generator = getStateTransferGenerator();
View Full Code Here

   private void initialiseCacheLoaderManager() throws Exception
   {
      if (cacheLoaderManager == null)
      {
         cacheLoaderManager = new CacheLoaderManager();
      }
      if (cacheLoaderConfig != null)
      {
         // use the newer XML based config.
         cacheLoaderManager.setConfig(cacheLoaderConfig, this);
View Full Code Here

            break;
         case TreeCache.LOCAL:
            //Nothing...
      }

      CacheLoaderManager cacheLoaderMgr = cache.getCacheLoaderManager();

      if (cacheLoaderMgr != null && cacheLoaderMgr.getCacheLoader() != null)
      {
         if (cacheLoaderMgr.isPassivation())
         {
            activation_interceptor = createInterceptor("org.jboss.cache.interceptors.ActivationInterceptor", cache);
            passivation_interceptor = createInterceptor("org.jboss.cache.interceptors.PassivationInterceptor", cache);
         }
         else
         {
            cache_loader_interceptor = createInterceptor("org.jboss.cache.interceptors.CacheLoaderInterceptor", cache);
            cache_store_interceptor = createInterceptor("org.jboss.cache.interceptors.CacheStoreInterceptor", cache);
         }
      }

      // load the cache management interceptor first
      if (cache.getUseInterceptorMbeans())
      {
         if (first == null)
            first = cacheMgmtInterceptor;
         else
            addInterceptor(first, cacheMgmtInterceptor);
      }

      // load the tx interceptor
      if (first == null)
         first = txInterceptor;
      else
         addInterceptor(first, txInterceptor);

//      if (first == null)
//         first = lock_interceptor;
//      else
//         addInterceptor(first, lock_interceptor);

      // create the stack from the bottom up
      if (activation_interceptor != null)
      {
         if (!cacheLoaderMgr.isFetchPersistentState())
         {
            if (first == null)
               first = passivation_interceptor;
            else
               addInterceptor(first, passivation_interceptor);
         }
      }

      if (cache_loader_interceptor != null)
      {
         if (!cacheLoaderMgr.isFetchPersistentState())
         {
            if (first == null)
               first = cache_store_interceptor;
            else
               addInterceptor(first, cache_store_interceptor);
         }
      }

      if (repl_interceptor != null)
      {
         if (first == null)
            first = repl_interceptor;
         else
            addInterceptor(first, repl_interceptor);
      }

      if (unlock_interceptor != null)
      {
         if (first == null)
            first = unlock_interceptor;
         else
            addInterceptor(first, unlock_interceptor);
      }

      if (activation_interceptor != null)
      {
         if (!cacheLoaderMgr.isFetchPersistentState())
         {
            if (first == null)
               first = activation_interceptor;
            else
               addInterceptor(first, activation_interceptor);
         }
         else
         {
            if (first == null)
               first = activation_interceptor;
            else
               addInterceptor(first, activation_interceptor);
            if (first == null)
               first = passivation_interceptor;
            else
               addInterceptor(first, passivation_interceptor);
         }
      }

      if (cache_loader_interceptor != null)
      {
         if (!cacheLoaderMgr.isFetchPersistentState())
         {
            if (first == null)
               first = cache_loader_interceptor;
            else
               addInterceptor(first, cache_loader_interceptor);
View Full Code Here

      Interceptor txInterceptor = null, replicationInterceptor = null, lockInterceptor = null, validationInterceptor = null;
      Interceptor createIfNotExistsInterceptor = null, nodeInterceptor = null, invokerInterceptor = null, activationInterceptor = null;
      Interceptor passivationInterceptor = null, cacheLoaderInterceptor = null, cacheStoreInterceptor = null, first = null;
      Interceptor cacheMgmtInterceptor = null, evictionInterceptor = null, dataGravitatorInterceptor = null;

      CacheLoaderManager cacheLoaderManager = cache.getCacheLoaderManager();
      if (cacheLoaderManager != null && cacheLoaderManager.getCacheLoader() != null)
      {
         if (cacheLoaderManager.isPassivation())
         {
            activationInterceptor = createInterceptor("org.jboss.cache.interceptors.ActivationInterceptor", cache);
            passivationInterceptor = createInterceptor("org.jboss.cache.interceptors.PassivationInterceptor", cache);
         }
         else
         {
            cacheLoaderInterceptor = createInterceptor("org.jboss.cache.interceptors.CacheLoaderInterceptor", cache);
            cacheStoreInterceptor = createInterceptor("org.jboss.cache.interceptors.CacheStoreInterceptor", cache);
         }
      }

      txInterceptor = createInterceptor("org.jboss.cache.interceptors.TxInterceptor", cache);

//      if (cache.getBuddyManager() != null && cache.getBuddyManager().isEnableDataGravitation()) dataGravitatorInterceptor = createInterceptor("org.jboss.cache.interceptors.DataGravitatorInterceptor", cache);
      if (cache.getBuddyManager() != null)
         dataGravitatorInterceptor = createInterceptor("org.jboss.cache.interceptors.DataGravitatorInterceptor", cache);

      switch (cache.getCacheModeInternal())
      {
         case TreeCache.REPL_SYNC:
         case TreeCache.REPL_ASYNC:
            replicationInterceptor = createInterceptor("org.jboss.cache.interceptors.OptimisticReplicationInterceptor", cache);
//                if (!cache.isNodeLockingOptimistic()) cache.setReplicationHandler((Replicatable) replicationInterceptor);
            break;
         case TreeCache.INVALIDATION_SYNC:
         case TreeCache.INVALIDATION_ASYNC:
            replicationInterceptor = createInterceptor("org.jboss.cache.interceptors.InvalidationInterceptor", cache);
            break;
         case TreeCache.LOCAL:
            //Nothing...
      }

      lockInterceptor = createInterceptor("org.jboss.cache.interceptors.OptimisticLockingInterceptor", cache);

      validationInterceptor = createInterceptor("org.jboss.cache.interceptors.OptimisticValidatorInterceptor", cache);

      createIfNotExistsInterceptor = createInterceptor("org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor", cache);

      nodeInterceptor = createInterceptor("org.jboss.cache.interceptors.OptimisticNodeInterceptor", cache);

      invokerInterceptor = createInterceptor("org.jboss.cache.interceptors.CallInterceptor", cache);

      if (cache.isUsingEviction())
      {
         evictionInterceptor = createInterceptor(cache.getEvictionInterceptorClass(), cache);
      }

      if (cache.getUseInterceptorMbeans())
      {
         cacheMgmtInterceptor = createInterceptor("org.jboss.cache.interceptors.CacheMgmtInterceptor", cache);
         if (first == null)
         {
            first = cacheMgmtInterceptor;
         }
         else
         {
            addInterceptor(first, cacheMgmtInterceptor);
         }
      }

      if (txInterceptor != null)
      {
         if (first == null)
         {
            first = txInterceptor;
         }
         else
         {
            addInterceptor(first, txInterceptor);
         }
      }

      if (first == null)
      {
         first = replicationInterceptor;
      }
      else
      {
         addInterceptor(first, replicationInterceptor);
      }

      if (passivationInterceptor != null && !cacheLoaderManager.isFetchPersistentState())
      {
         if (first == null)
            first = passivationInterceptor;
         else
            addInterceptor(first, passivationInterceptor);
      }

      // add the cache store interceptor here
      if (cacheStoreInterceptor != null && !cacheLoaderManager.isFetchPersistentState())
      {
         if (first == null)
            first = cacheStoreInterceptor;
         else
            addInterceptor(first, cacheStoreInterceptor);
      }

      // cache loader interceptor is only invoked if we are ready to write to the actual tree cache
      if (activationInterceptor != null)
      {
         if (first == null)
            first = activationInterceptor;
         else
            addInterceptor(first, activationInterceptor);

         if (cacheLoaderManager.isFetchPersistentState())
         {
            if (first == null)
               first = passivationInterceptor;
            else
               addInterceptor(first, passivationInterceptor);
         }
      }

      if (cacheLoaderInterceptor != null)
      {
         if (first == null)
            first = cacheLoaderInterceptor;
         else
            addInterceptor(first, cacheLoaderInterceptor);

         if (cacheLoaderManager.isFetchPersistentState())
         {
            if (first == null)
               first = cacheStoreInterceptor;
            else
               addInterceptor(first, cacheStoreInterceptor);
View Full Code Here

         {
            LOG.info("No cache loader has been defined, thus no need to encapsulate any cache loader.");
         }
         return;
      }
      CacheLoaderManager clm =
         ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(CacheLoaderManager.class);
      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;
      }

      ControllerCacheLoader ccl = new ControllerCacheLoader(currentCL);
      List<IndividualCacheLoaderConfig> newConfig = new ArrayList<IndividualCacheLoaderConfig>(1);
      // create CacheLoaderConfig
      IndividualCacheLoaderConfig cclConfig = new IndividualCacheLoaderConfig();
      // set CacheLoader
      cclConfig.setCacheLoader(ccl);
      // set parameters
      cclConfig.setFetchPersistentState(clm.isFetchPersistentState());
      cclConfig.setAsync(false);
      cclConfig.setIgnoreModifications(false);
      CacheLoaderConfig.IndividualCacheLoaderConfig first = config.getFirstCacheLoaderConfig();
      cclConfig.setPurgeOnStartup(first != null && first.isPurgeOnStartup());
      newConfig.add(cclConfig);
View Full Code Here

      }
   }

   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");
View Full Code Here

   }

   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");
View Full Code Here

TOP

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

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.