Package org.apache.jcs.engine.memory

Examples of org.apache.jcs.engine.memory.MemoryCache


    }

    public int getByteCount( CompositeCache cache )
        throws Exception
    {
        MemoryCache memCache = cache.getMemoryCache();

        Iterator iter = memCache.getIterator();

        CountingOnlyOutputStream counter = new CountingOnlyOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( counter );

        while ( iter.hasNext() )
View Full Code Here


    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#free()
     */
    public void free() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        Object[] keys = memoryCache.getKeyArray();
        if ( keys != null && keys.length > 0 ) {
            final Object key = keys[0];
            try {
                memoryCache.remove((Serializable)key);
            } catch (Exception ignore) {               
            }
        }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#keys()
     */
    public Enumeration keys() {
        // TODO Find a better way
        final MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        final Object[] keys = memoryCache.getKeyArray();
        return new IteratorEnumeration(Arrays.asList(keys).iterator());
        //return new IteratorEnumeration(this.jcs.getGroupKeys("").iterator());
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#size()
     */
    public int size() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        return memoryCache.getSize();
        //return this.jcs.getSize();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#free()
     */
    public void free() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        Object[] keys = memoryCache.getKeyArray();
        if ( keys != null && keys.length > 0 ) {
            final Object key = keys[0];
            try {
                memoryCache.remove((Serializable)key);
            } catch (Exception ignore) {               
            }
        }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#keys()
     */
    public Enumeration keys() {
        // TODO Find a better way
        final MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        final Object[] keys = memoryCache.getKeyArray();
        return new IteratorEnumeration(Arrays.asList(keys).iterator());
        //return new IteratorEnumeration(this.jcs.getGroupKeys("").iterator());
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#size()
     */
    public int size() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        return memoryCache.getSize();
        //return this.jcs.getSize();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#free()
     */
    public void free() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        Object[] keys = memoryCache.getKeyArray();
        if ( keys != null && keys.length > 0 ) {
            final Object key = keys[0];
            try {
                memoryCache.remove((Serializable)key);
            } catch (Exception ignore) {               
            }
        }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#keys()
     */
    public Enumeration keys() {
        // TODO Find a better way
        final MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        final Object[] keys = memoryCache.getKeyArray();
        return new IteratorEnumeration(Arrays.asList(keys).iterator());
        //return new IteratorEnumeration(this.jcs.getGroupKeys("").iterator());
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.excalibur.store.Store#size()
     */
    public int size() {
        // TODO Find a better way
        MemoryCache memoryCache = this.cacheManager.getCache(region).getMemoryCache();
        return memoryCache.getSize();
        //return this.jcs.getSize();
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.memory.MemoryCache

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.