Package org.apache.commons.cache

Examples of org.apache.commons.cache.SimpleCache


        int maxObjects = 1000;
        try {
            maxObjects = Integer.parseInt(SystemProperties.get("adito.jdbcSystemDatabase.replacementsCache", "10000"));
        } catch (Exception e) {
        }
        replacementsCache = new SimpleCache(new MemoryStash(maxObjects));
    }
View Full Code Here


    db.init("policyDatabase", dbName, jdbcUser, jdbcPassword, null);
    DBUpgrader upgrader = new DBUpgrader(ContextHolder.getContext()
        .getVersion(), db, ContextHolder.getContext().getDBDirectory(),
        upgradeDir);
    upgrader.upgrade();
    policyCache = new SimpleCache(new MemoryStash(CACHE_MAXOBJS.intValue()));
    CoreServlet.getServlet().addCoreListener(new CoreListener() {
      public void coreEvent(CoreEvent evt) {
        if (evt.getId() == CoreEventConstants.USER_CREATED
            || evt.getId() == CoreEventConstants.USER_EDITED
            || evt.getId() == CoreEventConstants.USER_REMOVED
View Full Code Here

        DBUpgrader upgrader = new DBUpgrader(ContextHolder.getContext().getVersion(), db, ContextHolder.getContext()
                        .getDBDirectory(), upgradeDir);
        upgrader.upgrade();

        int maxObjs = CACHE_MAXOBJS.intValue();
        propertyCache = new SimpleCache(new MemoryStash(maxObjs));
        loadAttributeDefinitions();
    }
View Full Code Here

        // eviction can't be used in testing as the policy creates a thread
        // which is only stopped on JVM exit, hence breaking the tests
        boolean isTestMode = "true".equals(SystemProperties.get("adito.testing", "false"));
        EvictionPolicy evictionPolicy = isTestMode ? null : new LRUEvictionPolicy();
       
        SimpleCache cache = new SimpleCache(stash, evictionPolicy, null, new GroupMapImpl());
        cache.registerStorageListener(getStorageListener(messageBundle, cacheFullText));
        return cache;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.cache.SimpleCache

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.