Examples of LRUCache


Examples of org.apache.camel.util.LRUCache

    protected BeanInfo createBeanInfo(Class<?> declaringClass) {
        return new BeanInfo(camelContext, declaringClass);
    }

    protected static Map createLruCache(int size) {
        return new LRUCache(size);
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

    /**
     * Creates a new MemoryMessageIdRepository with a memory based respository. <b>Warning</b> this
     * method should only really be used for testing as it will involve keeping all message IDs in RAM.
     */
    public static MessageIdRepository memoryMessageIdRepository(int cacheSize) {
        return memoryMessageIdRepository(new LRUCache(cacheSize));
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

     * @return the capacity
     */
    public int getCapacity() {
        int capacity = -1;
        if (consumers instanceof LRUCache) {
            LRUCache cache = (LRUCache) consumers;
            capacity = cache.getMaxCacheSize();
        }
        return capacity;
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

     * @return the hits
     */
    public long getHits() {
        long hits = -1;
        if (consumers instanceof LRUCache) {
            LRUCache cache = (LRUCache) consumers;
            hits = cache.getHits();
        }
        return hits;
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

     * @return the misses
     */
    public long getMisses() {
        long misses = -1;
        if (consumers instanceof LRUCache) {
            LRUCache cache = (LRUCache) consumers;
            misses = cache.getMisses();
        }
        return misses;
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

    /**
     * Resets the cache statistics
     */
    public void resetCacheStatistics() {
        if (consumers instanceof LRUCache) {
            LRUCache cache = (LRUCache) consumers;
            cache.resetStatistics();
        }
    }
View Full Code Here

Examples of org.apache.camel.util.LRUCache

     * @return the capacity
     */
    public int getCapacity() {
        int capacity = -1;
        if (producers instanceof LRUCache) {
            LRUCache cache = (LRUCache) producers;
            capacity = cache.getMaxCacheSize();
        }
        return capacity;
    }
View Full Code Here

Examples of org.apache.ibatis.cache.decorators.LruCache

public class LruCacheTest {

  @Test
  public void shouldRemoveLeastRecentlyUsedItemInBeyondFiveEntries() {
    LruCache cache = new LruCache(new PerpetualCache("default"));
    cache.setSize(5);
    for (int i = 0; i < 5; i++) {
      cache.putObject(i, i);
    }
    assertEquals(0, cache.getObject(0));
    cache.putObject(5, 5);
    assertNull(cache.getObject(1));
    assertEquals(5, cache.getSize());
  }
View Full Code Here

Examples of org.apache.solr.search.LRUCache

    HashMap<String, String> argMap = new HashMap<String, String>();
    argMap.put("size", size);
    argMap.put("name", "solbaseCache");
   
    cache = new LRUCache();
    cache.init(argMap, null, null);
    cache.setState(State.LIVE);
    // register mbean here
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName objName;
View Full Code Here

Examples of org.apache.ws.util.LRUCache

   public synchronized void startReaping(  )
   {
      if ( !m_started )
      {
         // create our LRU map that will maintain those resources that do not support WS-RL
         m_noTerminationTimeSupport = new LRUCache(  );
         m_noTerminationTimeSupport.setMaxCapacity( 50 ); // TODO: make this configurable

         // create our reaper thread pool that will provide the threads used to actually check for and destroy expired resources
         m_reaperThreadPool = new PooledExecutor(  );
         m_reaperThreadPool.setThreadFactory( new NamedThread.ConcurrentThreadFactory( "resource-reaper", true ) );
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.