org.camunda.bpm.engine.impl.juel
Class Cache

java.lang.Object
  extended by org.camunda.bpm.engine.impl.juel.Cache
All Implemented Interfaces:
TreeCache

public final class Cache
extends Object
implements TreeCache

Simple (thread-safe) LRU cache. After the cache size reached a certain limit, the least recently used entry is removed, when adding a new entry.

Author:
Christoph Beck

Constructor Summary
Cache(int size)
          Constructor.
Cache(int size, Map<String,Tree> secondary)
          Constructor.
 
Method Summary
 Tree get(String expression)
          Lookup tree
 void put(String expression, Tree tree)
          Cache tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cache

public Cache(int size)
Constructor. Use a WeakHashMap as secondary map.

Parameters:
size - maximum primary cache size

Cache

public Cache(int size,
             Map<String,Tree> secondary)
Constructor. If the least recently used entry is removed from the primary cache, it is added to the secondary map.

Parameters:
size - maximum primary cache size
secondary - the secondary map (may be null)
Method Detail

get

public Tree get(String expression)
Description copied from interface: TreeCache
Lookup tree

Specified by:
get in interface TreeCache

put

public void put(String expression,
                Tree tree)
Description copied from interface: TreeCache
Cache tree

Specified by:
put in interface TreeCache


Copyright © 2017 camunda services GmbH. All rights reserved.