Examples of CacheConfiguration


Examples of ch.entwine.weblounge.cache.impl.CacheConfiguration

  @Path("/")
  public Response getStatistics(@Context HttpServletRequest request) {

    // Get the site's cache
    Site site = getSite(request);
    CacheConfiguration cache = getCache(site);

    StringBuilder stats = new StringBuilder();
    stats.append("<cache id=\"").append(cache.getIdentifier()).append("\">");

    // Status
    stats.append("<enabled>").append(cache.isEnabled()).append("</enabled>");

    stats.append("</cache>");

    Response response = Response.ok(stats.toString()).build();
    return response;
View Full Code Here

Examples of com.volantis.mcs.runtime.configuration.CacheConfiguration

                CacheValue value = values[i];
                if (value != null) {
                    ++nonNullInputSize;
                }
                if (cacheList.hasNext()) {
                    CacheConfiguration cacheConfiguration =
                        (CacheConfiguration) cacheList.next();
                    checkValue(values[i], cacheConfiguration);
                    ++cacheSize;
                }
            }
View Full Code Here

Examples of com.volantis.mcs.runtime.configuration.CacheConfiguration

    private void createCaches(
            final CacheProcessConfiguration cacheProcessConfiguration,
            final Iterator cacheConfigurations) {

        while (cacheConfigurations.hasNext()) {
            CacheConfiguration
                    cacheConfiguration =
                    (CacheConfiguration) cacheConfigurations.next();
            cacheProcessConfiguration.createCache(
                cacheConfiguration.getName(),
                cacheConfiguration.getMaxEntries(),
                cacheConfiguration.getMaxAge());
        }
    }
View Full Code Here

Examples of com.whirlycott.cache.CacheConfiguration

            return (Map) this.caches.get(cacheName);
        }
       
        try {
            log.debug(cacheName + LOG_MESSAGE_NOT_FOUND_IN_CACHE);
            final CacheConfiguration config = (CacheConfiguration)CacheManager.getConfiguration().get(cacheName);
            final Map map = new WhirlyCacheMap(this.cacheManager.getCache(cacheName), config);
            this.caches.put(cacheName, map);
            return map;
        } catch (CacheException ce) {
            log.error(ce, ce);
View Full Code Here

Examples of javax.cache.CacheConfiguration

        return result;
    }

    @SuppressWarnings("unchecked")
    void runCacheExpiry() {
        CacheConfiguration cacheConfiguration = getConfiguration();

        CacheConfiguration.Duration modifiedExpiry =
                cacheConfiguration.getExpiry(CacheConfiguration.ExpiryType.MODIFIED);
        long modifiedExpiryDuration =
                modifiedExpiry == null ?
                DEFAULT_CACHE_EXPIRY_MILLIS :
                modifiedExpiry.getTimeUnit().toMillis(modifiedExpiry.getDurationAmount());

        CacheConfiguration.Duration accessedExpiry =
                cacheConfiguration.getExpiry(CacheConfiguration.ExpiryType.ACCESSED);
        long accessedExpiryDuration =
                accessedExpiry == null ?
                DEFAULT_CACHE_EXPIRY_MILLIS :
                accessedExpiry.getTimeUnit().toMillis(accessedExpiry.getDurationAmount());
View Full Code Here

Examples of net.sf.ehcache.config.CacheConfiguration

        if (configFileURL != null) {
            cacheManager = EHCacheManagerHolder.getCacheManager(bus, configFileURL);
        } else {
            cacheManager = EHCacheManagerHolder.getCacheManager(bus, getDefaultConfigFileURL());
        }
        CacheConfiguration cc = EHCacheManagerHolder.getCacheConfiguration(key, cacheManager);
       
        Ehcache newCache = new Cache(cc);
        cache = cacheManager.addCacheIfAbsent(newCache);
    }
View Full Code Here

Examples of net.sf.ehcache.config.CacheConfiguration

    private final MetricRegistry registry = new MetricRegistry();
    private Ehcache cache;

    @Before
    public void setUp() throws Exception {
        final Cache c = new Cache(new CacheConfiguration("test", 100));
        MANAGER.addCache(c);
        this.cache = InstrumentedEhcache.instrument(registry, c);
    }
View Full Code Here

Examples of net.sf.ehcache.config.CacheConfiguration

        readTransactions = new ConcurrentLinkedQueue<Transaction<K, V>>();

        writeLock = new ReentrantLock();

        // Initialize the caches
        CacheConfiguration cacheConfiguration = new CacheConfiguration();
        cacheConfiguration.setName( "pages" );
        cacheConfiguration.setEternal( true );
        cacheConfiguration.setOverflowToDisk( false );
        cacheConfiguration.setCacheLoaderTimeoutMillis( 0 );
        cacheConfiguration.setMaxElementsInMemory( cacheSize );
        cacheConfiguration.setMemoryStoreEvictionPolicy( "LRU" );

        cache = new Cache( cacheConfiguration );
        cache.initialise();

        // Initialize the txnManager thread
View Full Code Here

Examples of net.sf.ehcache.config.CacheConfiguration

            }
        }

        if ( !cacheExists )
        {
            CacheConfiguration cacheConfiguration =
                new CacheConfiguration().name( getName() ).memoryStoreEvictionPolicy(
                    getMemoryStoreEvictionPolicy() ).eternal( isEternal() ).timeToLiveSeconds(
                    getTimeToLiveSeconds() ).timeToIdleSeconds(
                    getTimeToIdleSeconds() ).diskExpiryThreadIntervalSeconds(
                    getDiskExpiryThreadIntervalSeconds() ).overflowToOffHeap(
                    isOverflowToOffHeap() ).maxEntriesLocalDisk( getMaxElementsOnDisk() ).diskPersistent(
                    isDiskPersistent() ).overflowToDisk( overflowToDisk );

            if ( getMaxElementsInMemory() > 0 )
            {
                cacheConfiguration = cacheConfiguration.maxEntriesLocalHeap( getMaxElementsInMemory() );
            }

            if ( getMaxBytesLocalHeap() > 0 )
            {
                cacheConfiguration = cacheConfiguration.maxBytesLocalHeap( getMaxBytesLocalHeap(), MemoryUnit.BYTES );
            }
            if ( getMaxBytesLocalOffHeap() > 0 )
            {
                cacheConfiguration =
                    cacheConfiguration.maxBytesLocalOffHeap( getMaxBytesLocalOffHeap(), MemoryUnit.BYTES );
            }

            ehcache = new Cache( cacheConfiguration );

            cacheManager.addCache( ehcache );
View Full Code Here

Examples of net.sf.ehcache.config.CacheConfiguration

            b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
        }

        cacheManager = EHCacheManagerHolder.getCacheManager(bus, configFileURL);
        // Cannot overflow to disk as SecurityToken Elements can't be serialized
        CacheConfiguration cc = EHCacheManagerHolder.getCacheConfiguration(key, cacheManager)
            .overflowToDisk(false); //tokens not writable
       
        Ehcache newCache = new Cache(cc);
        cache = cacheManager.addCacheIfAbsent(newCache);
       
        // Set the TimeToLive value from the CacheConfiguration
        ttl = cc.getTimeToLiveSeconds();
    }
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.