vgritsenko 2003/12/25 12:04:40
Modified: java/src/org/apache/xindice/core Collection.java
CollectionManager.java DocumentCache.java
java/src/org/apache/xindice/core/meta/inline NullReader.java
java/src/org/apache/xindice/xml/dom DBDocument.java
Log:
javadoc fixes
Revision Changes Path
1.43 +8 -5
xml-xindice/java/src/org/apache/xindice/core/Collection.java
Index: Collection.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- Collection.java 24 Dec 2003 14:10:04 -0000 1.42
+++ Collection.java 25 Dec 2003 20:04:40 -0000 1.43
@@ -518,8 +518,11 @@
}
/**
- * @param key
- * @return
+ * From the document key and this collection canonical name,
+ * composes canonical document name.
+ *
+ * @param key document key
+ * @return The canonical document name
*/
public final String getCanonicalDocumentName(String key) {
StringBuffer sb = new StringBuffer();
@@ -569,7 +572,7 @@
}
/**
- * @return
+ * @return The collection root
*/
public final File getCollectionRoot() {
return collectionRoot;
1.23 +3 -3
xml-xindice/java/src/org/apache/xindice/core/CollectionManager.java
Index: CollectionManager.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/CollectionManager.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- CollectionManager.java 24 Dec 2003 14:10:04 -0000 1.22
+++ CollectionManager.java 25 Dec 2003 20:04:40 -0000 1.23
@@ -257,7 +257,7 @@
}
/**
- * @return
+ * @return The collections map
*/
protected Map getCollections() {
return this.collections;
1.12 +36 -22
xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java
Index: DocumentCache.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DocumentCache.java 9 Aug 2003 21:19:53 -0000 1.11
+++ DocumentCache.java 25 Dec 2003 20:04:40 -0000 1.12
@@ -78,6 +78,11 @@
* DocumentCache implements a simple Document caching system for
* Collections.
*
+ * <small>
+ * FIXME: Revisit cache implementation. Most probably, commons collections'
+ * ReferenceMap should be used instead of WeakHashMap.
+ * </small>
+ *
* @version CVS $Revision$, $Date$
*/
public final class DocumentCache {
@@ -87,34 +92,38 @@
private Map table = new WeakHashMap();
/**
- * @param col
- * @param key
- * @return
+ * Obtains document from cache
+ *
+ * @param col document collection
+ * @param key document key
+ * @return document from the cache or null if not present
*/
public Document getDocument(Collection col, Key key) {
Object v = table.get(new CacheKey(col, key));
- Document doc = null;
- if (v instanceof Document) {
- doc = (Document) v;
- }
- else if (v instanceof byte[]) {
+ if (v == null) {
+ return null;
+ } else if (v instanceof Document) {
+ return (Document) v;
+ } else if (v instanceof byte[]) {
try {
SymbolTable s = col.getSymbols();
NodeSource ns = new NodeSource(col, key);
- doc = new DocumentImpl((byte[]) v, s, ns);
+ return new DocumentImpl((byte[]) v, s, ns);
} catch (Exception e) {
if (log.isWarnEnabled()) {
log.warn("ignored exception", e);
}
}
}
- return doc;
+ return null;
}
/**
- * @param col
- * @param key
- * @param bytes
+ * Stores document in the cache
+ *
+ * @param col document collection
+ * @param key document key
+ * @param bytes compressed document
*/
public void putDocument(Collection col, Key key, byte[] bytes) {
CacheKey ckey = new CacheKey(col, key);
@@ -122,9 +131,11 @@
}
/**
- * @param col
- * @param key
- * @param doc
+ * Stores document in the cache
+ *
+ * @param col document collection
+ * @param key document key
+ * @param doc document to store in the cache
*/
public void putDocument(Collection col, Key key, Document doc) {
CacheKey ckey = new CacheKey(col, key);
@@ -132,16 +143,19 @@
}
/**
- * @param col
- * @param key
+ * Remove document from the cache
+ *
+ * @param col document collection
+ * @param key document key
*/
public void removeDocument(Collection col, Key key) {
table.remove(new CacheKey(col, key));
}
/**
- * @param doc
- * @return
+ * Obtains value of the cache control processing instruction in this
document
+ * @param doc document to inspect for cache control processing
instruction
+ * @return cache control value
*/
public static int getCacheControl(Document doc) {
String cache = DBDocument.CACHE;
1.4 +3 -3
xml-xindice/java/src/org/apache/xindice/core/meta/inline/NullReader.java
Index: NullReader.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/inline/NullReader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- NullReader.java 7 Aug 2003 20:13:22 -0000 1.3
+++ NullReader.java 25 Dec 2003 20:04:40 -0000 1.4
@@ -119,7 +119,7 @@
}
/**
- * @see org.apache.xindice.core.meta.inline.InlineMetaMap#put(String)
+ * @see
org.apache.xindice.core.meta.inline.InlineMetaMap#put(String,Object)
*/
public void put(String key, Object value) throws InlineMetaException
{
throw new InlineMetaException(FaultCodes.GEN_CRITICAL_ERROR,
"NullMap does not accept key '" + key + "'");
1.6 +14 -2
xml-xindice/java/src/org/apache/xindice/xml/dom/DBDocument.java
Index: DBDocument.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/DBDocument.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DBDocument.java 7 Aug 2003 20:13:25 -0000 1.5
+++ DBDocument.java 25 Dec 2003 20:04:40 -0000 1.6
@@ -67,8 +67,20 @@
* @version CVS $Revision$, $Date$
*/
public interface DBDocument extends DBNode, Document {
+
+ /**
+ * Cache control processing instruction
+ */
static final String CACHE_CONTROL = "xindice-cache";
+
+ /**
+ * 'cache' value of the cache control processing instruction
+ */
static final String CACHE = "cache";
+
+ /**
+ * 'no-cache' value of the cache control processing instruction
+ */
static final String NOCACHE = "no-cache";
/**