Xindice API
version 1.2m1

org.apache.xindice.core.cache
Class DocumentCacheImpl

java.lang.Object
  extended byorg.apache.xindice.core.cache.DocumentCacheImpl
All Implemented Interfaces:
DocumentCache

public class DocumentCacheImpl
extends Object
implements DocumentCache

DocumentCache implements a simple Document caching system for Collections. FIXME: Revisit cache implementation. Most probably, commons collections' ReferenceMap should be used instead of WeakHashMap.

Version:
$Revision: 594588 $, $Date: 2007-11-13 12:21:25 -0500 (Tue, 13 Nov 2007) $

Nested Class Summary
 
Nested classes inherited from class org.apache.xindice.core.cache.DocumentCache
DocumentCache.CacheKey
 
Field Summary
 
Fields inherited from interface org.apache.xindice.core.cache.DocumentCache
BINARY, COMPRESSED, UNCOMPRESSED
 
Constructor Summary
DocumentCacheImpl()
           
 
Method Summary
 Entry getEntry(Collection col, Key key)
          Obtains resource entry from the cache
 Entry getEntryMeta(Collection col, Key key)
          Obtains resource entry metadata from cache.
 void putEntry(Collection col, Key key, int type, Value value, Map meta)
          Stores resource entry value in the cache
 void putEntryMeta(Collection col, Key key, int type, Map meta)
          Stores resource meta entry in the cache
 void removeEntry(Collection col, Key key)
          Remove resource entry from the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCacheImpl

public DocumentCacheImpl()
Method Detail

getEntry

public Entry getEntry(Collection col,
                      Key key)
Description copied from interface: DocumentCache
Obtains resource entry from the cache

Specified by:
getEntry in interface DocumentCache
Parameters:
col - resource collection
key - resource key
Returns:
entry cached resource entry or null if not present

getEntryMeta

public Entry getEntryMeta(Collection col,
                          Key key)
Description copied from interface: DocumentCache
Obtains resource entry metadata from cache.

Specified by:
getEntryMeta in interface DocumentCache
Parameters:
col - resource collection
key - resource key
Returns:
entry cached resource metadata or null if not present

putEntry

public void putEntry(Collection col,
                     Key key,
                     int type,
                     Value value,
                     Map meta)
Description copied from interface: DocumentCache
Stores resource entry value in the cache

Specified by:
putEntry in interface DocumentCache
Parameters:
col - resource collection
key - resource key
type - resource type: COMPRESSED, UNCOMPRESSED, BINARY
value - entry value
meta - resource meta attributes map

putEntryMeta

public void putEntryMeta(Collection col,
                         Key key,
                         int type,
                         Map meta)
Description copied from interface: DocumentCache
Stores resource meta entry in the cache

Specified by:
putEntryMeta in interface DocumentCache
Parameters:
col - resource collection
key - resource key
type - resource type: COMPRESSED, UNCOMPRESSED, BINARY
meta - resource metadata attributes map

removeEntry

public void removeEntry(Collection col,
                        Key key)
Description copied from interface: DocumentCache
Remove resource entry from the cache

Specified by:
removeEntry in interface DocumentCache
Parameters:
col - resource collection
key - resource key

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.