Package org.apache.jcs.engine

Examples of org.apache.jcs.engine.CacheElement


        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 mockLateral = new MockAuxCache();
        mockLateral.cacheType = AuxiliaryCache.LATERAL_CACHE;

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

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

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

        // VERIFY
View Full Code Here

        // Add items to cache

        for ( int i = 0; i < items; i++ )
        {
            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", region + " data " + i );
            ice.setElementAttributes( cache.getElementAttributes() );
            lru.update( ice );
        }

        // Test that initial items have been purged
View Full Code Here

        List inputItems = new LinkedList();
        int numToPut = 10;

        for ( int i = 0; i < numToPut; i++ )
        {
            ICacheElement element = new CacheElement( cacheName, String.valueOf( i ), new Long( i ) );
            inputItems.add( element );
            server.update( element, 9999 );
        }

        Thread.sleep( 100 );
View Full Code Here

        List inputItems = new LinkedList();
        int numToPut = 10;

        for ( int i = 0; i < numToPut; i++ )
        {
            ICacheElement element = new CacheElement( cacheName, String.valueOf( i ), new Long( i ) );
            inputItems.add( element );
            // update using the cluster listener id
            server.update( element, clusterListener.getListenerId() );
        }
View Full Code Here

        {
            // 24 KB
            int size = bytes * 1024;
            DiskTestObject tile = new DiskTestObject( new Integer( i ), new byte[size] );

            ICacheElement element = new CacheElement( cacheName, tile.id, tile );
            elements[i] = element;
        }
        return elements;
    }
View Full Code Here

            int bytes = random.nextInt( 20 );
            // 4-24 KB
            int size = ( bytes + 4 ) * 1024;
            DiskTestObject tile = new DiskTestObject( new Integer( i ), new byte[size] );

            ICacheElement element = new CacheElement( cacheName, tile.id, tile );
            elements[i] = element;
        }
        return elements;
    }
View Full Code Here

    {
        try
        {
            long start = System.currentTimeMillis();
            //if ( running ) {
            ICacheElement cb = new CacheElement( hashtableName, key, val );
            log.debug( "key = " + key );
            String result = sendCache( cb );
            sleep( 100 );
            running = false;
            long end = System.currentTimeMillis();
View Full Code Here

    /** Description of the Method */
    public void remove( String cacheName, Serializable key, long requesterId )
        throws IOException
    {
        CacheElement ce = new CacheElement( cacheName, key, null );
        LateralElementDescriptor led = new LateralElementDescriptor( ce );
        led.requesterId = requesterId;
        led.command = led.REMOVE;
        sender.send( led );
    }
View Full Code Here

    /** Description of the Method */
    public void removeAll( String cacheName, long requesterId )
        throws IOException
    {
        CacheElement ce = new CacheElement( cacheName, "ALL", null );
        LateralElementDescriptor led = new LateralElementDescriptor( ce );
        led.requesterId = requesterId;
        led.command = led.REMOVEALL;
        sender.send( led );
    }
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.