|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.portals.applications.transform.impl.MemoryTransformCache
TransformCacheComponent
Field Summary | |
private TreeMap |
cache
|
private boolean |
debug
|
private boolean |
enable
|
private int |
evictionPercentage
|
private Object |
lock
|
private int |
maxSize
|
private Transform |
transform
|
Constructor Summary | |
MemoryTransformCache(Transform transform,
int maxSize,
int evictionPercentage,
boolean enable,
boolean debug)
Spring constructor injection |
Method Summary | |
void |
clearCache()
Clear the Transform Cache |
int |
compare(Object o1,
Object o2)
|
String |
constructKey(String url,
String stylesheet)
Construct the key for the TransformDocumentTreeMap cache |
protected void |
evict()
The eviction policy will keep n items in the cache, and then start evicting x items ordered-by least used first. |
TransformCacheEntry |
get(String key)
Retrieve the unique TransformCacheEntry keyed off with key |
Object |
getDocument(String key)
Retrieve the byte[] storing the transformed content for the transfomId and the documentId combination. |
int |
getEvictionPercentage()
Get the eviction percentage of the cache |
int |
getMaxSize()
Get the maximum size of the cache |
boolean |
isEnabled()
Find out if TransformCache is enables |
void |
put(String key,
Object document,
long timeToLive)
Put a value in the TransformCache keyed off with the TransformId and the DocumentId. |
Object |
remove(String key)
Remove a unique value keyed off with the TransformId and DocumentId from the cache. |
void |
setMaxSize(int maxSize)
Set the new maximum size of the cache |
void |
update(Observable o,
Object arg)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Field Detail |
private boolean debug
private int maxSize
private int evictionPercentage
private boolean enable
private Transform transform
private TreeMap cache
private Object lock
Constructor Detail |
public MemoryTransformCache(Transform transform, int maxSize, int evictionPercentage, boolean enable, boolean debug)
Method Detail |
public int getMaxSize()
TransformCache
getMaxSize
in interface TransformCache
public void setMaxSize(int maxSize)
TransformCache
setMaxSize
in interface TransformCache
maxSize
- the maximum size of the cachepublic int getEvictionPercentage()
TransformCache
getEvictionPercentage
in interface TransformCache
public boolean isEnabled()
TransformCache
isEnabled
in interface TransformCache
public void put(String key, Object document, long timeToLive)
TransformCache
put
in interface TransformCache
key
- document
- protected void evict()
public Object remove(String key)
TransformCache
remove
in interface TransformCache
key
-
public TransformCacheEntry get(String key)
TransformCache
get
in interface TransformCache
key
-
public Object getDocument(String key)
TransformCache
getDocument
in interface TransformCache
public int compare(Object o1, Object o2)
compare
in interface Comparator
public String constructKey(String url, String stylesheet)
TransformCache
constructKey
in interface TransformCache
public void clearCache()
TransformCache
clearCache
in interface TransformCache
public void update(Observable o, Object arg)
update
in interface Observer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |