Package org.apache.jcs.engine.control

Examples of org.apache.jcs.engine.control.CompositeCacheManager


     * @throws Exception
     */
    public void testHitInT1ThenT2BelowMax()
        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( "/TestARCCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( "testGetKeyArray" );

        ARCMemoryCache arc = new ARCMemoryCache();
        arc.initialize( cache );

        int max = cache.getCacheAttributes().getMaxObjects();
View Full Code Here


     * @throws Exception
     */
    public void testHitInT1AtMax()
        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( "/TestARCCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( "testGetKeyArray" );

        ARCMemoryCache arc = new ARCMemoryCache();
        arc.initialize( cache );

        int max = cache.getCacheAttributes().getMaxObjects();
View Full Code Here

     * @throws Exception
     */
    public void SKIPtestHitInT1OverMax()
        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( "/TestARCCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( "testGetKeyArray" );

        ARCMemoryCache arc = new ARCMemoryCache();
        arc.initialize( cache );

        int max = cache.getCacheAttributes().getMaxObjects();
View Full Code Here

     * @throws Exception
     */
    public void testPutInT1ToMax()
        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( "/TestARCCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( "testGetKeyArray" );

        ARCMemoryCache arc = new ARCMemoryCache();
        arc.initialize( cache );

        int max = cache.getCacheAttributes().getMaxObjects();
View Full Code Here

     * @throws Exception
     */
    public void testGetKeyArray()
        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
        cacheMgr.configure( "/TestMRUCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( "testGetKeyArray" );

        MRUMemoryCache mru = new MRUMemoryCache();
        mru.initialize( cache );

        int max = cache.getCacheAttributes().getMaxObjects();
View Full Code Here

     *            The anem of the configuration file.
     * @return The cache hub configured with this configuration file.
     */
    private CompositeCacheManager createCacheManager( String prop )
    {
        CompositeCacheManager hub = CompositeCacheManager.getUnconfiguredInstance();

        if ( prop == null )
        {
            hub.configure( "/remote.cache.ccf" );
        }
        else
        {
            hub.configure( prop );
        }
        return hub;
    }
View Full Code Here

    {
        if ( log.isDebugEnabled() )
        {
            log.debug( "handleDispose> cacheName=" + cacheName );
        }
        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
        cm.freeCache( cacheName, true );
    }
View Full Code Here

    public void testSystemPropertyMissingInValueDelimeter()
        throws Exception
    {
        System.getProperties().setProperty( "MY_SYSTEM_PROPERTY_DISK_DIR", "system_set" );

        CompositeCacheManager mgr = CompositeCacheManager.getUnconfiguredInstance();
        mgr.configure( "/TestSystemProperties.ccf" );

        JCS cache = JCS.getInstance( "missing" );
        // TODO check against the actual default def
        assertEquals( "We should have used the default property for the memory size", 100, cache.getCacheAttributes()
            .getMaxObjects() );
View Full Code Here

        dsConfig_ead.setMetsVersion("ead");
        dsConfig_ead.setDaoType("edu.indiana.dlib.metsnav.dao.PersistentMetsFileDAO");
        config_ead = new CollectionConfig();
        config_ead.setDataSource(dsConfig_ead);

        CompositeCacheManager cacheMgr = null;
        System.out.println(path);
        root = path.substring(0, path.indexOf("/build/"));
        String jcsConfigFile = root + "/web/WEB-INF/cache.ccf";
        if (jcsConfigFile == null) {
            cacheMgr = CompositeCacheManager.getInstance();
        } else {
            cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
            Properties props = new Properties();
            FileInputStream is = new FileInputStream(jcsConfigFile);
            props.load(is);
            cacheMgr.configure(props);
        }
    }
View Full Code Here

        super(mgr, maxCacheSize);
        init();
    }

    public void init() throws CacheException {           //TODO get these props from jcs.properties or server.properties
        CompositeCacheManager ccm = CompositeCacheManager.getUnconfiguredInstance();
        Properties props = new Properties();
        //props.load(/* load properties from some location defined by your app */);
        props.put("jcs.default","");
        props.put("jcs.default.cacheattributes","org.apache.jcs.engine.CompositeCacheAttributes");
        props.put("jcs.default.cacheattributes.MemoryCacheName","org.apache.jcs.engine.memory.lru.LRUMemoryCache");
        props.put("jcs.default.cacheattributes.MaxObjects",mMaxCacheSize);
        ccm.configure(props);

        termCache = JCS.getInstance("termCache");
        IElementAttributes attributes = termCache.getDefaultElementAttributes();
        //attributes.setIsEternal( true );
        attributes.setSize(5000);
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.control.CompositeCacheManager

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.