asmuts 02/05/13 11:31:41
Modified: src/java/org/apache/jcs/engine/memory/behavior
IMemoryCache.java
src/java/org/apache/jcs/engine/memory MemoryCache.java
Log:
Cleaned and commented
Revision Changes Path
1.4 +84 -25
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java
Index: IMemoryCache.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- IMemoryCache.java 13 May 2002 16:25:41 -0000 1.3
+++ IMemoryCache.java 13 May 2002 18:31:41 -0000 1.4
@@ -14,92 +14,151 @@
import org.apache.jcs.engine.control.Cache;
/**
- * For the framework. Insures methods a MemoryCache needs to access.
+ * For the framework. Insures methods a MemoryCache needs to access.
*
- * @author asmuts
- * @created January 15, 2002
+ *@author asmuts
+ *@created January 15, 2002
*/
public interface IMemoryCache extends ICacheType
{
// for initialization
- /** Description of the Method */
+ /**
+ * Description of the Method
+ *
+ *@param cacheName Description of the Parameter
+ *@param cattr Description of the Parameter
+ *@param cache Description of the Parameter
+ */
public void initialize( String cacheName,
ICompositeCacheAttributes cattr,
Cache cache );
// TODO: need a setCacheAttributes or reInitialize method
- /** Description of the Method */
+ /**
+ * Description of the Method
+ *
+ *@return The size value
+ */
//public void makeFirst( MemoryElementDescriptor me );
//public void moveToMemory( ICacheElement ce );
/**
- * Gets the size attribute of the IMemoryCache object
+ * Gets the size attribute of the IMemoryCache object
*
- * @return The size value
+ *@return The size value
*/
public int getSize();
- // get an Iterator for all the elements
/**
- * Gets the iterator attribute of the IMemoryCache object
+ * Get an iterator for all elements in the memory cache. This should be
+ * removed since it is fairly dangerous. Other classes should not be able
+ * to directly access items in the memory cache.
*
- * @return The iterator value
+ *@return An iterator
+ *@deprecated
*/
public Iterator getIterator();
/**
- * Get an Array of the keys for all elements in the memory cache
+ * Get an Array of the keys for all elements in the memory cache
*
- * @return An Object[]
+ *@return An Object[]
*/
public Object[] getKeyArray();
- /** Removes an item from the cache. */
+ /**
+ * Removes an item from the cache.
+ *
+ *@param key Description of the Parameter
+ *@return Description of the Return Value
+ *@exception IOException Description of the Exception
+ */
public boolean remove( Serializable key )
throws IOException;
- /** Removes all cached items from the cache. */
+ /**
+ * Removes all cached items from the cache.
+ *
+ *@exception IOException Description of the Exception
+ */
public void removeAll()
throws IOException;
- /** Description of the Method */
+ /**
+ * Description of the Method
+ *
+ *@param key Description of the Parameter
+ *@return Description of the Return Value
+ *@exception IOException Description of the Exception
+ */
public Serializable get( Serializable key )
throws IOException;
- /** Get an item from the cache without effecting its order or last access time
*/
+ /**
+ * Get an item from the cache without effecting its order or last access
+ * time
+ *
+ *@param key Description of the Parameter
+ *@return The quiet value
+ *@exception IOException Description of the Exception
+ */
public ICacheElement getQuiet( Serializable key )
throws IOException;
- /** Description of the Method */
+ /**
+ * Description of the Method
+ *
+ *@param key Description of the Parameter
+ *@param container Description of the Parameter
+ *@return Description of the Return Value
+ *@exception IOException Description of the Exception
+ */
public Serializable get( Serializable key, boolean container )
throws IOException;
- /** Throws an item out of memory, if there is a disk cache it will be spooled.
*/
-// public void waterfal( MemoryElementDescriptor me )
-// throws IOException;
-
+ /**
+ * Throws an item out of memory, if there is a disk cache it will be
+ * spooled.
+ *
+ *@param ce Description of the Parameter
+ *@exception IOException Description of the Exception
+ */
public void waterfal( ICacheElement ce )
throws IOException;
- /** Puts an item to the cache. */
+ /**
+ * Puts an item to the cache.
+ *
+ *@param ce Description of the Parameter
+ *@exception IOException Description of the Exception
+ */
public void update( ICacheElement ce )
throws IOException;
- /** Returns the CacheAttributes. */
- public ICompositeCacheAttributes getCacheAttributes( );
- /** Sets the CacheAttributes. */
+ /**
+ * Returns the CacheAttributes.
+ *
+ *@return The cacheAttributes value
+ */
+ public ICompositeCacheAttributes getCacheAttributes();
+
+ /**
+ * Sets the CacheAttributes.
+ *
+ *@param cattr The new cacheAttributes value
+ */
public void setCacheAttributes( ICompositeCacheAttributes cattr );
}
1.4 +68 -30
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/MemoryCache.java
Index: MemoryCache.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/MemoryCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MemoryCache.java 13 May 2002 16:25:42 -0000 1.3
+++ MemoryCache.java 13 May 2002 18:31:41 -0000 1.4
@@ -9,81 +9,119 @@
import org.apache.jcs.engine.control.Cache;
/**
- * For the framework. Insures methods a MemoryCache needs to access.
+ * For the framework. Insures methods a MemoryCache needs to access. Not sure
+ * why we use this. Should use teh IMemeoryCache interface. I'll change it
+ * later.
*
- * Not sure why we use this. Should use teh IMemeoryCache interface.
- * I'll change it later.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Aaron Smuts</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">James Taylor</a>
- * @version $Id: MemoryCache.java,v 1.3 2002/05/13 16:25:42 asmuts Exp $
+ *@author <a href="mailto:[EMAIL PROTECTED]">Aaron Smuts</a>
+ *@author <a href="mailto:[EMAIL PROTECTED]">James Taylor</a>
+ *@created May 13, 2002
+ *@version $Id: MemoryCache.java,v 1.4 2002/05/13 18:31:41 asmuts Exp $
*/
public interface MemoryCache
{
/**
- * Initialize the memory cache
+ * Initialize the memory cache
*
- * @param cache The cache (region) this memory store is attached to.
+ *@param cache The cache (region) this memory store is attached to.
*/
public void initialize( Cache cache );
/**
- * Get the number of elements contained in the memory store
+ * Get the number of elements contained in the memory store
*
- * @return Element count
+ *@return Element count
*/
public int getSize();
/**
- * Get an iterator for all elements in the memory cache
+ * Get an iterator for all elements in the memory cache. This should be
+ * removed since it is fairly dangerous. Other classes should not be able
+ * to directly access items in the memory cache.
*
- * @return An iterator
+ *@return An iterator
+ *@deprecated
*/
public Iterator getIterator();
/**
- * Get an Array of the keys for all elements in the memory cache
+ * Get an Array of the keys for all elements in the memory cache
*
- * @return Object[]
+ *@return Object[]
*/
public Object[] getKeyArray();
/**
- * Removes an item from the cache
+ * Removes an item from the cache
*
- * @param key Identifies item to be removed
+ *@param key Identifies item to be removed
+ *@return Description of the Return Value
+ *@exception IOException Description of the Exception
*/
- public boolean remove( Serializable key ) throws IOException;
+ public boolean remove( Serializable key )
+ throws IOException;
/**
- * Removes all cached items from the cache.
+ * Removes all cached items from the cache.
+ *
+ *@exception IOException Description of the Exception
*/
- public void removeAll() throws IOException;
+ public void removeAll()
+ throws IOException;
- /** Get an item from the cache */
+ /**
+ * Get an item from the cache
+ *
+ *@param key Description of the Parameter
+ *@return Description of the Return Value
+ *@exception IOException Description of the Exception
+ */
public ICacheElement get( Serializable key )
throws IOException;
- /** Get an item from the cache without effecting its order or last access time
*/
+ /**
+ * Get an item from the cache without effecting its order or last access
+ * time
+ *
+ *@param key Description of the Parameter
+ *@return The quiet value
+ *@exception IOException Description of the Exception
+ */
public ICacheElement getQuiet( Serializable key )
throws IOException;
- /** Spools the item contained in the provided element to disk */
-// public void waterfal( MemoryElementDescriptor me )
-// throws IOException;
-
+ /**
+ * Spools the item contained in the provided element to disk
+ *
+ *@param ce Description of the Parameter
+ *@exception IOException Description of the Exception
+ */
public void waterfal( ICacheElement ce )
throws IOException;
- /** Puts an item to the cache. */
- public void update( ICacheElement ce ) throws IOException;
+ /**
+ * Puts an item to the cache.
+ *
+ *@param ce Description of the Parameter
+ *@exception IOException Description of the Exception
+ */
+ public void update( ICacheElement ce )
+ throws IOException;
- /** Returns the CacheAttributes. */
+ /**
+ * Returns the CacheAttributes for the region.
+ *
+ *@return The cacheAttributes value
+ */
public ICompositeCacheAttributes getCacheAttributes();
- /** Sets the CacheAttributes. */
+ /**
+ * Sets the CacheAttributes of the region.
+ *
+ *@param cattr The new cacheAttributes value
+ */
public void setCacheAttributes( ICompositeCacheAttributes cattr );
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>