Examples of DefaultCacheFactory


Examples of org.gradle.cache.DefaultCacheFactory

        protected ClassLoaderFactory createClassLoaderFactory() {
            return new DefaultClassLoaderFactory(get(ClassPathRegistry.class));
        }

        protected CacheFactory createCacheFactory() {
            return new AutoCloseCacheFactory(new DefaultCacheFactory());
        }
View Full Code Here

Examples of org.gradle.cache.DefaultCacheFactory

    protected ClassPathRegistry createClassPathRegistry() {
        return new DefaultClassPathRegistry();
    }

    protected CacheFactory createCacheFactory() {
        return new AutoCloseCacheFactory(new DefaultCacheFactory());
    }
View Full Code Here

Examples of org.infinispan.factories.DefaultCacheFactory

      if (!cacheName.equals(DEFAULT_CACHE_NAME)) {
         Configuration overrides = configurationOverrides.get(cacheName);
         if (overrides != null) c.applyOverrides(overrides);
      }

      Cache cache = new DefaultCacheFactory().createCache(c, globalComponentRegistry, cacheName);
      Cache other = caches.putIfAbsent(cacheName, cache);
      if (other == null) {
         cache.start();
         return cache;
      } else {
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

      this.providerFactory = providerFactory;
   }

   public void start()
   {
      CacheFactory factory = new DefaultCacheFactory();
      ExpirationAlgorithmConfig exp = new ExpirationAlgorithmConfig();
      exp.setMaxNodes(maxSize);

      EvictionRegionConfig evictionRegionConfig = new EvictionRegionConfig(RegionManagerImpl.DEFAULT_REGION);
      evictionRegionConfig.setEvictionAlgorithmConfig(exp);

      EvictionConfig evictConfig = new EvictionConfig();
      evictConfig.setDefaultEvictionRegionConfig(evictionRegionConfig);
      evictConfig.setWakeupInterval(wakeupInterval);


      Configuration config = new Configuration();
      config.setCacheMode(Configuration.CacheMode.LOCAL);
      config.setEvictionConfig(evictConfig);

      cache = factory.createCache(config, true);

      ServerCacheHitInterceptor hit = new ServerCacheHitInterceptor(this);
      ServerCacheInterceptor interceptor = new ServerCacheInterceptor(this);

      getProviderFactory().getServerPreProcessInterceptorRegistry().register(hit);
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

   * @param mySessionFactory
   */
  private void registerAllJBossTreeCacheMBeans() {
      try {
        log.info("start to register all JBoss Treecache MBeans...");
        CacheFactory factory = new DefaultCacheFactory();
        Cache cache = factory.createCache("treecache.xml");
        ObjectName cacheObjectName = new ObjectName("jboss.cache:service=Cache");
        JmxRegistrationManager jmxRegistrationManager = new JmxRegistrationManager(server, cache, cacheObjectName );
        jmxRegistrationManager.registerAllMBeans();
        log.info("registered all JBoss Treecache MBeans");
      } catch (MalformedObjectNameException e) {
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

   {
      log.debug("Starting JBoss Cache");

      try
      {
         CacheFactory factory = new DefaultCacheFactory();
         cache = factory.createCache(getConfigurationAsStream());

         cache.create();
         cache.start();
      }
      catch (Exception e)
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

               {
                  log.warn("Unable to open config file for display", e);
               }
               configFileContents.repaint();

               cache = new DefaultCacheFactory().createCache(cacheConfigFile);
               isUsingBuddyReplication = cache.getConfiguration().getBuddyReplicationConfig() != null && cache.getConfiguration().getBuddyReplicationConfig().isEnabled();
            }
            else
            {
               cache.start();
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

      return c;
   }

   public void testSimpleStateTransfer() throws Exception
   {
      first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
      first.put("/a/b/c", "key", "value");
      first.put("/a/b/d", "key", "value");
      first.put("/a/b/e", "key", "value");
      second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));
      assert second.get("/a/b/c","key").equals("value");
      assert second.get("/a/b/d","key").equals("value");
      assert second.get("/a/b/e","key").equals("value");
      JDBCCacheLoader cacheLoader = (JDBCCacheLoader) second.getCacheLoaderManager().getCacheLoader();
      assert cacheLoader.exists(Fqn.fromString("/a"));
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

   public void testMoreState() throws Exception
   {
      long startTime = System.currentTimeMillis();

      first = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(0));
      long cacheStartTime = System.currentTimeMillis() - startTime;
      System.out.println("cacheStartTime = " + cacheStartTime);
      for (int i = 0; i < 5012; i++)
      {
         first.put("a/b/"+i, "k","v");
         if (i%1000 == 0) System.out.println(i + " operations executed so far");
      }
      startTime = System.currentTimeMillis();
      second = (CacheSPI) new DefaultCacheFactory().createCache(getConfiguration(2));

      long stateTranferTime = System.currentTimeMillis() - startTime - cacheStartTime;
      for (int i = 0; i < 5012; i+=100)
      {
         second.get("a/b/"+ i, "k").equals("v");
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

   @Test(enabled = false)
   public static void main(String[] args)
   {
      Configuration localConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_SYNC);
      localConfig.setExposeManagementStatistics(true);
      CacheFactory cacheFactory = new DefaultCacheFactory();
      Cache cache = cacheFactory.createCache(localConfig);
      JmxRegistrationManager regManager = new JmxRegistrationManager(cache);
      while (true){}
   }
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.