Package com.volantis.synergetics.cache

Examples of com.volantis.synergetics.cache.GenericCache


            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


            boolean isCached = configuration.isTemplateCacheRequired();
            if (isCached) {
                TransformCacheKey key = new TransformCacheKey(isCompilable,
                        absoluteURI);
                GenericCache cache = (GenericCache)
                        ((DefaultTransformConfiguration) configuration)
                                .getTemplateCache();
                synchronized (cache) {
                    templates = (Templates) cache.get(key);
                    if (templates == null) {
                        templates = createTemplates(absoluteURI, isCompilable);
                        cache.put(key, templates);
                    }
                }
            } else {
                templates = createTemplates(absoluteURI, isCompilable);
            }
View Full Code Here

        doInContextTest(pipelineContext,
                "CompilableNestedTransformationsTestCase.input.xml",
                "NestedTransformationsTestCase.expected.xml");

        // Check for something in the cache
        GenericCache cache = (GenericCache) config.getTemplateCache();
        assertFalse("Should be something in the cache", cache.isEmpty());

    }
View Full Code Here

                !config.isTemplateCacheRequired());

        config.setTemplateCacheRequired(true);
        assertTrue("Should now use a cache", config.isTemplateCacheRequired());

        GenericCache cache = (GenericCache)
                ((DefaultTransformConfiguration)config).getTemplateCache();
        assertNotNull("Should have a cache", cache);
        String strategy = cache.getStrategy();
        assertNull("No strategy specified", strategy);
        // GenericCache sets this to 0 even though our cache construction
        // specified -1
        int max = cache.getMaxEntries();
        assertEquals("No limit on entries", 0, max);
        int timeout = cache.getTimeout();
        assertEquals("No timeout on entries", -1, timeout);

        // Test repeated requests do not kill an existing cache
        GenericCache secondCache = (GenericCache)
                ((DefaultTransformConfiguration)config).getTemplateCache();
        assertNotNull("Should have a cache", secondCache);
        assertEquals("Caches should be the same", cache, secondCache);
    }
View Full Code Here

    }

    private GenericCache createDeviceCache(
            PolicyCacheConfiguration cacheConfiguration) {

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

            String strategy = cacheConfiguration.getStrategy();
View Full Code Here

    }

    private void initializeDeviceManager(LocalRepository repository,
                                         DeviceRepositoryLocation location) {

        GenericCache cache;
        // --------------------------------------------------------------------
        // Device Repository Manager
        // --------------------------------------------------------------------

        final DeviceRepositoryAccessorFactory accessorFactory =
View Full Code Here

TOP

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

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.