Package org.apache.jcs.engine

Examples of org.apache.jcs.engine.CacheElement


        int cnt = 25;
        for ( int i = 0; i < cnt; i++ )
        {
            IElementAttributes eAttr = new ElementAttributes();
            eAttr.setIsSpool( true );
            ICacheElement element = new CacheElement( "testRemove_PartialKey", i + ":key", "data:" + i );
            element.setElementAttributes( eAttr );
            disk.doUpdate( element );
        }

        // verif each
        for ( int i = 0; i < cnt; i++ )
View Full Code Here


        int cnt = 25;
        for ( int i = 0; i < cnt; i++ )
        {
            GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );

            CacheElement element = new CacheElement( cacheName, groupAttrName, "data:" + i );

            IElementAttributes eAttr = new ElementAttributes();
            eAttr.setIsSpool( true );
            element.setElementAttributes( eAttr );

            disk.doUpdate( element );
        }

        // verify each
View Full Code Here

        String regionName = "testSinglePut";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        System.out.println( server.getStats() );
        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );

        // DO WORK
        ICacheElement result = cache.get( "key" );

        // VERIFY
        assertEquals( "Wrong element.", element.getVal(), result.getVal() );
    }
View Full Code Here

        String regionName = "testPutRemove";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        System.out.println( server.getStats() );
        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );

        // DO WORK
        ICacheElement result = cache.get( "key" );

        // VERIFY
        assertEquals( "Wrong element.", element.getVal(), result.getVal() );

        // DO WORK
        cache.remove( "key" );
        SleepUtil.sleepAtLeast( 50 );
        ICacheElement resultAfterRemote = cache.get( "key" );
View Full Code Here

        RemoteCacheListenerMockImpl listener = new RemoteCacheListenerMockImpl();
        server.addCacheListener( regionName, listener );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        try
View Full Code Here

        // DO WORK
        int numPutsPrior = server.getPutCount();
        int numToPut = 100;
        for ( int i = 0; i < numToPut; i++ )
        {
            ICacheElement element = new CacheElement( regionName, "key" + 1, "value" + i );
            cache.update( element );
        }
        SleepUtil.sleepAtLeast( 500 );

        // VERIFY
View Full Code Here

        MockAuxCache mock = new MockAuxCache();
        mock.cacheType = AuxiliaryCache.DISK_CACHE;

        cache.setAuxCaches( new AuxiliaryCache[] { mock } );

        ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" );

        // DO WORK
        cache.spoolToDisk( inputElement );

        // VERIFY
View Full Code Here

        MockAuxCache mock = new MockAuxCache();
        mock.cacheType = AuxiliaryCache.DISK_CACHE;

        cache.setAuxCaches( new AuxiliaryCache[] { mock } );

        ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" );

        // DO WORK
        cache.spoolToDisk( inputElement );

        // VERIFY
View Full Code Here

        MockAuxCache mock = new MockAuxCache();
        mock.cacheType = AuxiliaryCache.DISK_CACHE;

        cache.setAuxCaches( new AuxiliaryCache[] { mock } );

        ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" );

        // DO WORK
        cache.updateAuxiliaries( inputElement, true );

        // VERIFY
View Full Code Here

        MockAuxCache mock = new MockAuxCache();
        mock.cacheType = AuxiliaryCache.DISK_CACHE;

        cache.setAuxCaches( new AuxiliaryCache[] { mock } );

        ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" );

        // DO WORK
        cache.updateAuxiliaries( inputElement, false );

        // VERIFY
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.CacheElement

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.