Package com.volantis.synergetics.cache

Examples of com.volantis.synergetics.cache.GenericCacheConfiguration


     */
    private void configureCache(DeviceRepositoryAccessor accessor,
            DeviceRepositoryConfiguration config) {

        if (config != null) {
            GenericCacheConfiguration genericConfiguration =
                    new GenericCacheConfiguration();

            genericConfiguration.setStrategy(DEFAULT_STRATEGY);
            genericConfiguration.setMaxEntries(config.getMaxEntries());
            genericConfiguration.setTimeout(config.getMaxAge());
            genericConfiguration.setRequestReferenceCaching(false);

            GenericCache cache =
                GenericCacheFactory.createCache(null, genericConfiguration);
            accessor.setDeviceCache(cache);
        }
View Full Code Here


    private GenericCache createDeviceCache(
            PolicyCacheConfiguration cacheConfiguration) {

        GenericCache cache = null;
        if (cacheConfiguration != null) {
            GenericCacheConfiguration genericConfiguration =
                    new GenericCacheConfiguration();

            String strategy = cacheConfiguration.getStrategy();
            if (strategy != null) {
                genericConfiguration.setStrategy(strategy);
            }

            Integer maxEntries = cacheConfiguration.getMaxEntries();
            if (maxEntries != null) {
                genericConfiguration.setMaxEntries(maxEntries.intValue());
            }

            Integer timeout = cacheConfiguration.getTimeout();
            if (timeout != null) {
                genericConfiguration.setTimeout(timeout.intValue());
            }

            cache = GenericCacheFactory.createCache(null,
                    genericConfiguration);
        }
View Full Code Here

TOP

Related Classes of com.volantis.synergetics.cache.GenericCacheConfiguration

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.