Package org.apache.jcs.engine

Examples of org.apache.jcs.engine.ElementAttributes


    ICompositeCacheAttributes cacheAttributes = new CompositeCacheAttributes();
    cacheAttributes.setCacheName(CACHE_NAME);
    cacheAttributes.setMaxObjects(10);
    cacheAttributes
        .setMemoryCacheName("org.apache.jcs.engine.memory.lru.LRUMemoryCache");
    ElementAttributes elementAttributes = new ElementAttributes();
    Object[] constructorArgs = new Object[] { CACHE_NAME, cacheAttributes,
        elementAttributes };

    // set up the methods to mock.
    Class targetClass = CompositeCache.class;
View Full Code Here


                        {
                            p( "usage: put numbertoput" );
                        }
                        else
                        {
                            IElementAttributes attrp = new ElementAttributes();
                            long n_start = System.currentTimeMillis();
                            for ( int n = 0; n < num; n++ )
                            {
                                attrp.copy();
                            }
                            long n_end = System.currentTimeMillis();
                            p( "---cloned attr " + num + " in " + String.valueOf( n_end - n_start ) + " millis ---" );
                        }
                    }
View Full Code Here

                        {
                            p( "usage: put numbertoput" );
                        }
                        else
                        {
                            IElementAttributes attrp = new ElementAttributes();
                            long n_start = System.currentTimeMillis();
                            for ( int n = 0; n < num; n++ )
                            {
                                attrp.copy();
                            }
                            long n_end = System.currentTimeMillis();
                            p( "---cloned attr " + num + " in " + String.valueOf( n_end - n_start ) + " millis ---" );
                        }
                    }
View Full Code Here

        String cacheName = "testCacheName";
        String mockMemoryCacheClassName = "org.apache.jcs.engine.memory.MemoryCacheMockImpl";
        ICompositeCacheAttributes cattr = new CompositeCacheAttributes();
        cattr.setMemoryCacheName( mockMemoryCacheClassName );

        IElementAttributes attr = new ElementAttributes();

        CompositeCache cache = new CompositeCache( cacheName, cattr, attr );

        AuxiliaryCacheMockImpl diskMock = new AuxiliaryCacheMockImpl();
        diskMock.cacheType = ICache.DISK_CACHE;
View Full Code Here

        String cacheName = "testCacheName";
        String mockMemoryCacheClassName = "org.apache.jcs.engine.memory.MemoryCacheMockImpl";
        ICompositeCacheAttributes cattr = new CompositeCacheAttributes();
        cattr.setMemoryCacheName( mockMemoryCacheClassName );

        IElementAttributes attr = new ElementAttributes();

        CompositeCache cache = new CompositeCache( cacheName, cattr, attr );

        AuxiliaryCacheMockImpl diskMock = new AuxiliaryCacheMockImpl();
        diskMock.cacheType = ICache.REMOTE_CACHE;
View Full Code Here

        disk.doRemoveAll();

        int cnt = 999;
        for ( int i = 0; i < cnt; i++ )
        {
            IElementAttributes eAttr = new ElementAttributes();
            eAttr.setIsSpool( true );
            ICacheElement element = new CacheElement( "testSimplePutAndGet", "key:" + i, "data:" + i );
            element.setElementAttributes( eAttr );
            disk.doUpdate( element );
        }
View Full Code Here

        disk.doRemoveAll();

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

        disk.doRemoveAll();

        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 );
        }
View Full Code Here

        {
            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 );
        }
View Full Code Here

    public CompositeCache getCache( String cacheName )
    {
        if ( cache == null )
        {
            System.out.println( "Creating mock cache" );
            CompositeCache newCache = new CompositeCache( cacheName, new CompositeCacheAttributes(), new ElementAttributes() );
            this.setCache( newCache );
        }
        return cache;
    }
View Full Code Here

TOP

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

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.