Package com.volantis.cache.impl

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


    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

        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

     */
    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

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.