Examples of LruCache


Examples of com.sun.appserv.util.cache.LruCache

                                    new Integer(maxEntries),
                                    new Long(timeout),
                                    new Float(loadFactor)}));
            }

            LruCache c = new LruCache();
            c.init(maxEntries, timeout, loadFactor, (Properties) null);
            c.addCacheListener(
                    new CacheListener() {
                        public void trimEvent(Object key, Object value) {
                            cache.remove(key);
                            if (logger.isLoggable(Logger.FINER)) {
                                logger.finer(
View Full Code Here

Examples of com.sun.appserv.util.cache.LruCache

            readyStore = new BaseCache();
            cacheSize = DEFAULT_CACHE_SIZE;
            readyStore.init(cacheSize, loadFactor, null);
        } else {
            cacheSize = (cacheSize <= 0) ? DEFAULT_CACHE_SIZE : cacheSize;
            LruCache lru = new LruCache(DEFAULT_CACHE_SIZE);
            if (numberOfVictimsToSelect >= 0) {
                loadFactor = (float) (1.0 - (1.0 *
                                             numberOfVictimsToSelect/cacheSize));
            }
            lru.init(cacheSize, idleTimeout, loadFactor, null);
            readyStore = lru;
            readyStore.addCacheListener(this);
        }
       
        if (idleTimeout > 0) {
View Full Code Here

Examples of net.sf.saxon.sort.LRUCache

    public static boolean isValidURI(CharSequence value) {

        // TODO: XSD 1.1 allows any string to be used as an instance of xs:anyURI

        LRUCache cache = caches.get();
        if (cache == null) {
            cache = new LRUCache(10);
            caches.set(cache);
        }

        if (cache.get(value) != null) {
            return true;
        }

        String sv = Whitespace.trim(value);

        // Allow zero-length strings (RFC2396 is ambivalent on this point)
        if (sv.length() == 0) {
            return true;
        }

        // Allow a string if the java.net.URI class accepts it
        try {
            new URI(sv);
            cache.put(value, value);
            return true;
        } catch (URISyntaxException e) {
            // keep trying
            // Note: it's expensive to throw exceptions on a success path, so we keep a cache.
        }

        // Allow a string if it can be escaped into a form that java.net.URI accepts
        sv = EscapeURI.iriToUri(sv).toString();
        try {
            new URI(sv);
            cache.put(value, value);
            return true;
        } catch (URISyntaxException e) {
            return false;
        }
    }
View Full Code Here

Examples of net.sf.swarmcache.LRUCache

    private final ObjectCache cache;

    public SwarmCache(int size)
    {

        LRUCache lruCache = new LRUCache();

        lruCache.setSize(size);

        this.cache = lruCache;
    }
View Full Code Here

Examples of org.activemq.util.LRUCache

     * @param maximumNumberOfProducersToTrack
     *                   number of producers expected in the system
     */
    public ActiveMQMessageAudit(int windowSize, final int maximumNumberOfProducersToTrack) {
        this.windowSize = windowSize;
        map = new LRUCache(maximumNumberOfProducersToTrack);
    }
View Full Code Here

Examples of org.apache.abdera.protocol.client.cache.LRUCache

 
  /**
   * Initializes the client HTTP cache
   */
  public static Cache initCache(Abdera abdera) {
    return new LRUCache(abdera);
  }
View Full Code Here

Examples of org.apache.abdera.protocol.client.cache.LRUCache

   * Initializes the client HTTP cache
   */
  public Cache initCache(CacheFactory factory) {
    Cache cache = null;
    if (factory != null) cache = factory.getCache(abdera);
    return (cache != null) ? cache : new LRUCache(abdera);
  }
View Full Code Here

Examples of org.apache.abdera.protocol.client.cache.LRUCache

    /**
     * Initializes the client HTTP cache
     */
    public static Cache initCache(Abdera abdera) {
        return new LRUCache(abdera);
    }
View Full Code Here

Examples of org.apache.abdera.protocol.client.cache.lru.LRUCache

  }
 
  public Cache initCache(CacheFactory factory) {
    Cache cache = null;
    if (factory != null) cache = factory.getCache(abdera);
    return (cache != null) ? cache : new LRUCache(abdera);
  }
View Full Code Here

Examples of org.apache.abdera.protocol.client.cache.lru.LRUCache

  }
 
  public Cache initCache(CacheFactory factory) {
    Cache cache = null;
    if (factory != null) cache = factory.getCache(abdera);
    return (cache != null) ? cache : new LRUCache(abdera);
  }
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.