Package net.sf.ehcache.config

Examples of net.sf.ehcache.config.PersistenceConfiguration


                        .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
                        .eternal(false)
                        .timeToLiveSeconds(60)
                        .timeToIdleSeconds(30)
//                        .diskExpiryThreadIntervalSeconds(0)
                        .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.LOCALTEMPSWAP)));
        manager.addCache(testCache);

        return manager;
    }
View Full Code Here


        {
            cacheConfig.clearOnFlush( clearOnFlush );
        }

        // Persistence Configuration
        PersistenceConfiguration persistenceConfig = new PersistenceConfiguration();
        Strategy strategy = conf.persistenceStrategy().get();
        if( strategy == null )
        {
            persistenceConfig.strategy( Strategy.NONE );
        }
        else
        {
            persistenceConfig.strategy( strategy );
        }
        cacheConfig.persistence( persistenceConfig );

        return cacheConfig;
    }
View Full Code Here

    private static int cacheNo = 0;

    public static Ehcache getEhcache() {
        CacheManager mgr = CacheManager.getInstance();
        CacheConfiguration conf = new CacheConfiguration("cache-" + cacheNo++, 0)
                .persistence(new PersistenceConfiguration()
                        .strategy(PersistenceConfiguration.Strategy.NONE));
        conf.setTimeToIdleSeconds(10);

        Cache cache = new Cache(conf);
        mgr.addCache(cache);
View Full Code Here

    config.setEternal(this.eternal);
    config.setTimeToLiveSeconds(this.timeToLive);
    config.setTimeToIdleSeconds(this.timeToIdle);
   
    PersistenceConfiguration pc = new PersistenceConfiguration();
    if(this.diskPersistent)  
      pc.strategy(PersistenceConfiguration.Strategy.LOCALRESTARTABLE);
    else if(this.overflowToDisk)
      pc.strategy(PersistenceConfiguration.Strategy.LOCALTEMPSWAP);
    else
      pc.strategy(PersistenceConfiguration.Strategy.NONE);

    config.setDiskExpiryThreadIntervalSeconds(this.diskExpiryThreadIntervalSeconds);
    config.setMaxElementsOnDisk(this.maxElementsOnDisk);

    if (this.terracottaClustered) {
View Full Code Here

TOP

Related Classes of net.sf.ehcache.config.PersistenceConfiguration

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.