Examples of buildCache()


Examples of com.volantis.cache.CacheBuilder.buildCache()

            cacheBuilder.setMaxCount(maxEntries);
            final SystemClock clock = SystemClock.getDefaultInstance();
            cacheBuilder.setClock(clock);
            cacheBuilder.setExpirationChecker(
                new URLContentValidationChecker());
            cache = cacheBuilder.buildCache();
        } else {
            cache = null;
        }
        cacheInitialized = true;
    }
View Full Code Here

Examples of com.volantis.cache.CacheBuilder.buildCache()

            final CacheBuilder cacheBuilder =
                CacheFactory.getDefaultInstance().createCacheBuilder();
            cacheBuilder.setMaxCount(maxCount);
            cacheBuilder.setClock(clock);
            cacheBuilder.setExpirationChecker(new URLContentValidationChecker());
            cache = cacheBuilder.buildCache();
        }

        final URLContentManagerConfiguration config =
            new URLContentManagerConfiguration();
        config.setDefaultTimeout(timeout);
View Full Code Here

Examples of com.volantis.cache.CacheBuilder.buildCache()

        CacheableObjectProvider objectProvider = new TestCacheableObjectProvider();

        CacheBuilder builder = new CacheBuilderImpl();
        builder.setObjectProvider(objectProvider);
        builder.setMaxCount(8);
        Cache cache = builder.buildCache();

        GroupBuilder groupBuilder = new GroupBuilderImpl();
        groupBuilder.setMaxCount(4);
        Group root = cache.getRootGroup();
        root.addRemovalListener(listenerRootMock);
View Full Code Here

Examples of com.volantis.cache.CacheBuilder.buildCache()

        Cache cache;
        synchronized (caches) {
            CacheBuilder cacheBuilder = CACHE_FACTORY.createCacheBuilder();
            cacheBuilder.setMaxCount(maxCount);
            cacheBuilder.setExpirationChecker(EXPIRATION_CHECKER);
            cache = cacheBuilder.buildCache();
            caches.put(name, cache);
        }

        final Period ttl;
        if ("unlimited".equals(maxAge)) {
View Full Code Here

Examples of com.volantis.cache.CacheBuilder.buildCache()

        CacheBuilder builder = factory.createCacheBuilder();
        builder.setMaxCount(totalSize);
        builder.setExpirationChecker(new PolicyExpirationChecker());
        builder.setClock(clock);
        cache = builder.buildCache();

        Group root = getRootGroup();

        GroupBuilder groupBuilder;
View Full Code Here

Examples of com.volantis.cache.impl.CacheBuilderImpl.buildCache()

        CacheableObjectProvider objectProvider = new TestCacheableObjectProvider();

        CacheBuilder builder = new CacheBuilderImpl();
        builder.setObjectProvider(objectProvider);
        builder.setMaxCount(8);
        Cache cache = builder.buildCache();

        GroupBuilder groupBuilder = new GroupBuilderImpl();
        groupBuilder.setMaxCount(4);
        Group root = cache.getRootGroup();
        root.addRemovalListener(listenerRootMock);
View Full Code Here

Examples of com.volantis.cache.impl.CacheBuilderImpl.buildCache()

    public void testAsyncUpdate() throws Exception {

        CacheBuilder builder = new CacheBuilderImpl();
        builder.setMaxCount(10);

        Cache cache = builder.buildCache();

        AsyncResult async = cache.asyncQuery("key", Period.inMilliSeconds(50));
        Object value;
        if (async.isReady()) {
            value = async.getValue();
View Full Code Here

Examples of com.volantis.cache.impl.CacheBuilderImpl.buildCache()

        throws Exception {

        CacheBuilder builder = new CacheBuilderImpl();
        builder.setMaxCount(10);

        Cache cache = builder.buildCache();
        Period period = Period.inMilliSeconds(5000);

        Runnable runnable = new FinalizeRunnable(cache, period);

        Thread[] threads = new Thread[2];
View Full Code Here

Examples of com.volantis.cache.impl.CacheBuilderImpl.buildCache()

     */
    public void testMaxCountNotSet() throws Exception {

        CacheBuilder builder = new CacheBuilderImpl();
        try {
            builder.buildCache();
            fail("Did not detect maxCount was not set.");
        } catch (IllegalStateException expected) {
            assertEquals("maxCount must be set", expected.getMessage());
        }
    }
View Full Code Here

Examples of edu.brown.markov.MarkovGraph.buildCache()

                        try {
                            json_graph = new JSONObject(Encoder.hexDecodeToString(json_procs.getString(proc_key)));
                            MarkovGraph markov = new MarkovGraph(catalog_proc);
                            markov.fromJSON(json_graph, catalog_db);
                            MarkovGraphsContainer.this.put(id, markov);
                            markov.buildCache();
                        } catch (Throwable ex) {
                            throw new RuntimeException("Failed to load MarkovGraph " + id + " for " + catalog_proc.getName(), ex);
                        }
                    }
                });
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.