froehlich 02/01/12 10:40:16
Modified: simplestore/src/java/org/apache/commons/simplestore
StoreJanitorImpl.java StoreJanitor.java Store.java
MRUMemoryStore.java JispStringKey.java
JispFilesystemStore.java
Log:
more javadoc updates and formating
Revision Changes Path
1.3 +31 -32
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/StoreJanitorImpl.java
Index: StoreJanitorImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/StoreJanitorImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StoreJanitorImpl.java 12 Jan 2002 18:24:15 -0000 1.2
+++ StoreJanitorImpl.java 12 Jan 2002 18:40:16 -0000 1.3
@@ -15,21 +15,22 @@
* This class is a implentation of a StoreJanitor. Store classes
* can register to the StoreJanitor. When memory is too low,
* the StoreJanitor frees the registered caches until memory is normal.
- *
- * NOTE:
+ * <br>
+ * NOTE:<br>
* Be careful with the setFreeMemory and setHeapsize methods. Wrong values can
- * cause high cpu usage.
- * Example configuration:
- * Jvm settings:
- * -Xms100000000 -Xmx200000000
- * StoreJanitor settings:
- * setFreeMemory(50000000)
- * setHeapsize(150000000)
+ * cause high cpu usage.<br>
+ * Example configuration:<br>
+ * Jvm settings:<br>
+ * -Xms100000000 -Xmx200000000<br>
+ * StoreJanitor settings:<br>
+ * setFreeMemory(50000000)<br>
+ * setHeapsize(150000000)<br>
*
* Heapsize must be higher then the -Xms parameter and freememory
- * between those both.
+ * between those both.<br>
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
+ * @author Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
*/
public class StoreJanitorImpl
implements StoreJanitor,
@@ -47,8 +48,6 @@
/**
* Initialize the StoreJanitorImpl.
*
- * @param - the Configuration of the application
- * @exception - ConfigurationException
*/
public void initialize() {
this.mJVM = Runtime.getRuntime();
@@ -99,7 +98,7 @@
/**
* Method to check if memory is running low in the JVM.
*
- * @return - true if memory is low
+ * @return true if memory is low
*/
private boolean memoryLow() {
return this.mJVM.totalMemory() > this.getHeapsize() &&
this.mJVM.freeMemory() < this.getFreememory();
@@ -108,7 +107,7 @@
/**
* This method register the stores
*
- * @param - the store to be registered
+ * @param store the store to be registered
*/
public void register(Store store) {
this.mStoreList.add(store);
@@ -117,7 +116,7 @@
/**
* This method unregister the stores
*
- * @param - the store to be unregistered
+ * @param store the store to be unregistered
*/
public void unregister(Store store) {
this.mStoreList.remove(store);
@@ -168,7 +167,7 @@
* This method returns the current free memory
* setting.
*
- * @return - current value of free memory in bytes
+ * @return current value of free memory in bytes
*/
public int getFreememory() {
return mFreeMemory;
@@ -178,16 +177,16 @@
* This method sets how much memory should be available
* in the JVM.
*
- * @param - free memory in bytes
+ * @param freememory free memory in bytes
*/
- public void setFreeMemory(int _freememory) {
- this.mFreeMemory = _freememory;
+ public void setFreeMemory(int freememory) {
+ this.mFreeMemory = freememory;
}
/**
* This method returns current Heapsize setting.
*
- * @return - current value of the Heapsize in bytes
+ * @return current value of the Heapsize in bytes
*/
public int getHeapsize() {
return this.mHeapSize;
@@ -197,17 +196,17 @@
* This method sets the maximum JVM consumptions, called
* Heapsize.
*
- * @param - maximum JVM consumption in bytes.
+ * @param heapsize maximum JVM consumption in bytes.
*/
- public void setHeapsize(int _heapsize) {
- this.mHeapSize = _heapsize;
+ public void setHeapsize(int heapsize) {
+ this.mHeapSize = heapsize;
}
/**
* This method return the current setting of the background
* Thread interval.
*
- * @return - current interval in seconds
+ * @return current interval in seconds
*/
public int getThreadInterval() {
return this.mThreadInterval;
@@ -217,17 +216,17 @@
* This method sets the background Thread interval in
* seconds.
*
- * @param - current interval in seconds
+ * @param threadinterval current interval in seconds
*/
- public void setThreadInterval(int _cleanupthreadinterval) {
- this.mThreadInterval = _cleanupthreadinterval;
+ public void setThreadInterval(int threadinterval) {
+ this.mThreadInterval = threadinterval;
}
/**
* This method returns the priority of the background
* Thread.
*
- * @return - current Thread priority
+ * @return current Thread priority
*/
public int getThreadPriority() {
return this.mThreadPriority;
@@ -237,10 +236,10 @@
* This method sets the priority of the background
* Thread.
*
- * @param - current Thread priority
+ * @param priority current Thread priority
*/
- public void setThreadPriority(int _priority) {
- this.mThreadPriority = _priority;
+ public void setThreadPriority(int priority) {
+ this.mThreadPriority = priority;
}
private void resetIndex() {
1.3 +4 -3
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/StoreJanitor.java
Index: StoreJanitor.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/StoreJanitor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StoreJanitor.java 12 Jan 2002 18:24:15 -0000 1.2
+++ StoreJanitor.java 12 Jan 2002 18:40:16 -0000 1.3
@@ -13,21 +13,22 @@
/**
* Interface for the StoreJanitors
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
+ * @author Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
*/
public interface StoreJanitor {
/**
* register method for the stores
*
- * @param - the Store to be registered
+ * @param store the Store to be registered
*/
void register(Store store);
/**
* unregister method for the stores
*
- * @param - the Store to be unregistered
+ * @param store the Store to be unregistered
*/
void unregister(Store store);
1.3 +9 -8
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/Store.java
Index: Store.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/Store.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Store.java 12 Jan 2002 18:24:15 -0000 1.2
+++ Store.java 12 Jan 2002 18:40:16 -0000 1.3
@@ -14,14 +14,15 @@
/**
* Interface for the Store implementations
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
+ * @author Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
*/
public interface Store {
/**
* Get the object associated to the given unique key.
*
- * @param - the Key Object
+ * @param key the Key Object
*/
Object get(Object key);
@@ -30,8 +31,8 @@
* caller to ensure that the key has a persistent state across
* different JVM executions.
*
- * @param - the Key Object
- * @param - the Value Object
+ * @param key the Key Object
+ * @param value the Value Object
*/
void store(Object key, Object value) throws IOException;
@@ -40,8 +41,8 @@
* the object store will discard held objects if the
* virtual machine is restarted or some error happens.
*
- * @param - the Key Object
- * @param - the Value Object
+ * @param key the Key Object
+ * @param value the Value Object
*/
void hold(Object key, Object value) throws IOException;
@@ -53,14 +54,14 @@
/**
* Remove the object associated to the given key.
*
- * @param - the Key Object
+ * @param key the Key Object
*/
void remove(Object key);
/**
* Indicates if the given key is associated to a contained object.
*
- * @param - the Key Object
+ * @param key the Key Object
*/
boolean containsKey(Object key);
1.3 +13 -13
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/MRUMemoryStore.java
Index: MRUMemoryStore.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/MRUMemoryStore.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MRUMemoryStore.java 12 Jan 2002 18:24:15 -0000 1.2
+++ MRUMemoryStore.java 12 Jan 2002 18:40:16 -0000 1.3
@@ -13,11 +13,11 @@
import java.util.LinkedList;
/**
- * This class provides a cache algorithm for the requested documents. It
- * combines a HashMap and a LinkedList to create a so called MRU (Most Recently
- * Used) cache.
+ * This class provides a MRU cache algorithm. It combines a HashMap
+ * and a LinkedList to create a so called MRU (Most Recently Used) cache.
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
+ * @author Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
*/
public final class MRUMemoryStore
implements Store {
@@ -31,7 +31,7 @@
* This method sets the number of objects the Store is
* allowed to hold. Default is 100 objects.
*
- * @param maxobjects - number of objects which are allowed
+ * @param maxobjects number of objects which are allowed
* to be stored.
*/
public void setMaxObjects(int maxobjects) {
@@ -60,7 +60,7 @@
/**
* Get the object associated to the given unique key.
*
- * @param the Key Object
+ * @param key the Key Object
* @return the Object associated with Key Object
*/
public Object get(Object key) {
@@ -79,8 +79,8 @@
* ensure that the key has a persistent state across different JVM
* executions.
*
- * @param the Key Object
- * @param the Value Object
+ * @param key the Key Object
+ * @param value the Value Object
*/
public void store(Object key, Object value) {
this.hold(key,value);
@@ -91,8 +91,8 @@
* LinkedList to create the MRU. It also stores objects onto the filesystem
* if configured.
*
- * @param the Key Object
- * @param the Value Object
+ * @param key the Key Object
+ * @param value the Value Object
*/
public void hold(Object key, Object value) {
while (this.mMRUList.size() >= this.mMaxObjects) {
@@ -106,7 +106,7 @@
/**
* Remove the object associated to the given key.
*
- * @param the Key object
+ * @param key the Key object
*/
public void remove(Object key) {
this.mCache.remove(key);
@@ -116,7 +116,7 @@
/**
* Indicates if the given key is associated to a contained object.
*
- * @param the Key Object
+ * @param key the Key Object
* @return true if Key exists and false if not
*/
public boolean containsKey(Object key) {
@@ -126,7 +126,7 @@
/**
* Returns the list of used keys as an Enumeration.
*
- * @return the enumeration of the cache
+ * @return the enumeration of the cache
*/
public Enumeration keys() {
return this.mCache.keys();
1.3 +10 -10
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/JispStringKey.java
Index: JispStringKey.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/JispStringKey.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JispStringKey.java 12 Jan 2002 18:24:15 -0000 1.2
+++ JispStringKey.java 12 Jan 2002 18:40:16 -0000 1.3
@@ -35,7 +35,7 @@
/**
* Constructor for the JispStringKey object
*
- * @param - the Value of the Key as String
+ * @param keyValue the Value of the Key as String
*/
public JispStringKey(String keyValue) {
mKey = keyValue;
@@ -44,8 +44,8 @@
/**
* Compares two String Keys
*
- * @param - the KeyObject to be compared
- * @return - 0 if equal, 1 if greater, -1 if less
+ * @param key the KeyObject to be compared
+ * @return 0 if equal, 1 if greater, -1 if less
*/
public int compareTo(KeyObject key) {
@@ -68,7 +68,7 @@
/**
* Composes a null Kewy
*
- * @return - a null Key
+ * @return a null Key
*/
public KeyObject makeNullKey() {
return new JispStringKey();
@@ -80,8 +80,8 @@
* calling the writeObject method of ObjectOutput for objects, strings,
* and arrays.
*
- * @param out - the stream to write the object to
- * @exception - IOException
+ * @param out the stream to write the object to
+ * @exception IOException
*/
public void writeExternal(ObjectOutput out)
throws IOException {
@@ -96,9 +96,9 @@
* for objects, strings and arrays. The readExternal method must read the
* values in the same sequence and with the same types as were written by
writeExternal.
*
- * @param in - the stream to read data from in order to restore the object
- * @exception IOException
- * @exception ClassNotFoundException
+ * @param in the stream to read data from in order to restore the object
+ * @exception IOException
+ * @exception ClassNotFoundException
*/
public void readExternal(ObjectInput in)
@@ -109,7 +109,7 @@
/**
* Overrides the toString() method
*
- * @return - the Key as String
+ * @return the Key as String
*/
public String toString() {
return mKey;
1.4 +23 -23
jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/JispFilesystemStore.java
Index: JispFilesystemStore.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/JispFilesystemStore.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JispFilesystemStore.java 12 Jan 2002 18:24:15 -0000 1.3
+++ JispFilesystemStore.java 12 Jan 2002 18:40:16 -0000 1.4
@@ -23,8 +23,8 @@
* (http://www.coyotegulch.com/jisp/index.html). This store uses B-Tree indexes
* to access variable-length serialized data stored in files.
*
- * @author Gerhard Froehlich
- * <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a>
+ * @author Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]">
+ * [EMAIL PROTECTED]</a>
*/
public final class JispFilesystemStore
@@ -50,7 +50,7 @@
* This method sets the name of the data file. Default
* is default.dat.
*
- * @param name - name of the data file
+ * @param name name of the data file
*/
public void setDatabaseName(String name) {
this.mDatabaseName = name;
@@ -60,7 +60,7 @@
* This method returns the name of the data file. Default
* is default.dat.
*
- * @return - name of the data file
+ * @return name of the data file
*/
public String getDatabaseName() {
return this.mDatabaseName;
@@ -70,7 +70,7 @@
* This method sets the name of the index file. Default
* is default.idx.
*
- * @param name - name of the index file
+ * @param name name of the index file
*/
public void setIndexfileName(String name) {
this.mIndexName = name;
@@ -80,7 +80,7 @@
* This method returns the name of the index file. Default
* is default.idx.
*
- * @return - name of the index file
+ * @return name of the index file
*/
public String getIndexfileName() {
return this.mIndexName;
@@ -97,8 +97,8 @@
/**
* Sets the repository's location
*
- * @param - the new directory value
- * @exception - IOException
+ * @param directory the new directory value
+ * @exception IOException
*/
public void setDirectory(final String directory)
throws IOException {
@@ -108,8 +108,8 @@
/**
* Sets the repository's location
*
- * @param - the new directory value
- * @exception - IOException
+ * @param directory the new directory value
+ * @exception IOException
*/
public void setDirectory(final File directory)
throws IOException {
@@ -147,7 +147,7 @@
/**
* Returns the repository's full pathname
*
- * @return - the directory as String
+ * @return the directory as String
*/
public String getDirectoryPath() {
return this.mDirectoryPath;
@@ -156,8 +156,8 @@
/**
* Returns a Object from the store associated with the Key Object
*
- * @param - the Key object
- * @return - the Object associated with Key Object
+ * @param key the Key object
+ * @return the Object associated with Key Object
*/
public Object get(Object key) {
Object readObj = null;
@@ -197,9 +197,9 @@
/**
* Store the given Object in the indexed data file.
*
- * @param - the Key Object
- * @param - the Value Object
- * @exception - IOException
+ * @param key the Key Object
+ * @param value the Value Object
+ * @exception IOException
*/
public void store(Object key, Object value)
throws IOException {
@@ -219,9 +219,9 @@
/**
* Holds the given Object in the indexed data file.
*
- * @param - the Key Object
- * @param - the Value Object
- * @exception - IOException
+ * @param key the Key Object
+ * @param value the Value Object
+ * @exception IOException
*/
public void hold(Object key, Object value)
throws IOException {
@@ -239,7 +239,7 @@
/**
* Removes a value from the data file with the given key.
*
- * @param - the Key Object
+ * @param key the Key Object
*/
public void remove(Object key) {
try {
@@ -278,7 +278,7 @@
/**
* Returns a Enumeration of all Keys in the indexed file
*
- * @return - Enumeration Object with all existing keys
+ * @return Enumeration Object with all existing keys
*/
public Enumeration keys() {
//TODO: Implementation
@@ -288,8 +288,8 @@
/**
* This method wraps around the key Object a Jisp KeyObject.
*
- * @param key - the key Object
- * @return - the wraped key Object
+ * @param key the key Object
+ * @return the wraped key Object
*/
private KeyObject wrapKeyObject(Object key) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>