Examples of MemoryCache


Examples of gov.nasa.worldwind.cache.MemoryCache

         throw new Exception("wwd == null");

      if (!wwd.getMemoryCacheSet().containsCache(BUFFERED_IMAGE_CACHE_NAME))
      {
         long size = Configuration.getLongValue(BUFFERED_IMAGE_CACHE_SIZE, DEFAULT_BUFFERED_IMAGE_CACHE_SIZE);
         MemoryCache cache = new BasicMemoryCache((long) (0.85 * size), size);
         wwd.getMemoryCacheSet().addCache(BUFFERED_IMAGE_CACHE_NAME, cache);
      }


      this.initializeSlideShow();
View Full Code Here

Examples of gov.nasa.worldwind.cache.MemoryCache

      WorldWind wwd = WorldWind.getInstance();

      if (wwd == null)
         throw new Exception("wwd == null");

      MemoryCache cache = wwd.getMemoryCache(BUFFERED_IMAGE_CACHE_NAME);

      boolean addToCache = (sizeInBytes < cache.getCapacity());

      // If the image is too large for the cache, then do not add it to the cache.
      if (addToCache)
      {
         cache.add(source, image, sizeInBytes);
      }

      return addToCache;
   }
View Full Code Here

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

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

    /* (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

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

    /* (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

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

    /* (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

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

    /* (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

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

    /* (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

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

    /* (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

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

    /* (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
TOP
Copyright © 2018 www.massapi.com. 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.