Examples of CacheLoaderConfig


Examples of org.jboss.cache.config.CacheLoaderConfig

   private void configureCacheLoaders(Element element)
   {
      if (element == null) return; //null cache loaders are allowed
      LoadersElementParser clElementParser = new LoadersElementParser(coreNamespace);
      CacheLoaderConfig cacheLoaderConfig = clElementParser.parseLoadersElement(element);
      config.setCacheLoaderConfig(cacheLoaderConfig);
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      }
      this.cacheWrapper_ = new JBossCacheWrapper(plainCache_);
     
      this.useTreeCacheMarshalling_ = plainCache_.getConfiguration().isUseRegionBasedMarshalling();
      boolean purge = true;
      CacheLoaderConfig clc = plainCache_.getConfiguration().getCacheLoaderConfig();
      if(clc != null)
      {
         usePassivation_ = (clc.isPassivation() && !clc.isShared());
         purge = false;
         for (IndividualCacheLoaderConfig iclc : clc.getIndividualCacheLoaderConfigs())
         {
            if (iclc.isPurgeOnStartup())
            {
               purge = true;
               break;
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      this.buddyReplConfig = config;
   }

   public void setCacheLoaderConfig(Element cacheLoaderConfig)
   {
      CacheLoaderConfig clc = null;
      if (cacheLoaderConfig != null)
      {
         try
         {
            clc = loadersElementParser.parseLoadersElement(cacheLoaderConfig);
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   public CacheLoaderConfig parseLoadersElement(Element element)
   {
      assertNotLegacyElement(element);
     
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      String passivation = getAttributeValue(element, "passivation");
      if (existsAttribute(passivation)) cacheLoaderConfig.setPassivation(getBoolean(passivation));
      String shared = getAttributeValue(element, "shared");
      if (existsAttribute(shared)) cacheLoaderConfig.setShared(getBoolean(shared));
      String preload = getPreloadString(getSingleElementInCoreNS("preload", element));
      if (preload != null) cacheLoaderConfig.setPreload(preload);

      NodeList cacheLoaderNodes = element.getElementsByTagName("loader");
      for (int i = 0; i < cacheLoaderNodes.getLength(); i++)
      {
         Element indivElement = (Element) cacheLoaderNodes.item(i);
         CacheLoaderConfig.IndividualCacheLoaderConfig iclc = parseIndividualCacheLoaderConfig(indivElement);
         cacheLoaderConfig.addIndividualCacheLoaderConfig(iclc);
      }
      return cacheLoaderConfig;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      this.plainCache_ = cache;
     
      this.cacheWrapper_ = new JBossCacheWrapper(plainCache_);
     
      this.useTreeCacheMarshalling_ = plainCache_.getConfiguration().isUseRegionBasedMarshalling();
      CacheLoaderConfig clc = plainCache_.getConfiguration().getCacheLoaderConfig();
      if(clc != null)
      {
         usePassivation_ = (clc.isPassivation() && !clc.isShared());
      }
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

                  "                      purgeOnStartup=\"false\">\n" +
                  "                <properties>bin=bin2</properties>\n" +
                  "         </loader>" +
                  "      </loaders>";
      LoadersElementParser parser = new LoadersElementParser();
      CacheLoaderConfig cacheLoaderConfig = parser.parseLoadersElement(XmlConfigHelper.stringToElementInCoreNS(xml));
      Configuration c = cache.getConfiguration();
      c.setCacheLoaderConfig(cacheLoaderConfig);
      cache.start();

      cache.put(fqn, key, value);
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   }

   private CacheLoaderConfig buildCacheLoaderConfig()
         throws IOException
   {
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      cacheLoaderConfig.setPassivation(false);
      cacheLoaderConfig.setPreload("/");
      cacheLoaderConfig.setShared(false);
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      iclc.setClassName("org.jboss.cache.loader.FileCacheLoader");
      Properties p = new Properties();
      p.put("location", tmpDir + cacheLoaderDir);
      iclc.setProperties(p);
      iclc.setAsync(false);
      iclc.setFetchPersistentState(true);
      iclc.setIgnoreModifications(false);
      cacheLoaderConfig.addIndividualCacheLoaderConfig(iclc);
      return cacheLoaderConfig;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   protected void configureCache() throws Exception
   {
      // use the shared variation of the DIMCL so that state is persisted in a static variable in memory rather than an
      // instance one.
      CacheSPI<Object, Object> cache = cacheTL.get();
      CacheLoaderConfig clc = getSingleCacheLoaderConfig("", DummySharedInMemoryCacheLoader.class.getName(), "debug=true", false, true, false);
      cache.getConfiguration().setCacheLoaderConfig(clc);
      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   }

   protected CacheLoaderConfig getCacheLoaderConfig(String jndi) throws Exception
   {
      String props = "cache.jdbc.datasource=" + jndi + "\ncache.jdbc.table.create=true\ncache.jdbc.table.drop=true";
      CacheLoaderConfig cacheLoaderConfig = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props, false, false, false);
      return cacheLoaderConfig;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   }

   protected CacheLoaderConfig getCacheLoaderConfig(String loc1, String loc2) throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      // clc 1
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummySharedInMemoryCacheLoader.class.getName());
      iclc.setAsync(false);
      iclc.setFetchPersistentState(true);
      iclc.setPurgeOnStartup(false);
      iclc.setIgnoreModifications(false);
      iclc.setProperties("bin=" + loc1);
      clc.addIndividualCacheLoaderConfig(iclc);

      IndividualCacheLoaderConfig iclc2 = iclc.clone();
      iclc2.setFetchPersistentState(false);
      iclc2.setProperties("bin=" + loc2);
      clc.addIndividualCacheLoaderConfig(iclc2);
      clc.setPassivation(false);
      clc.setShared(false);
      return clc;
   }
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.