You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2008/04/11 21:40:24 UTC
svn commit: r647281 - in /jakarta/jcs/trunk/src/java/org/apache/jcs:
auxiliary/disk/indexed/ engine/behavior/ engine/control/event/
Author: asmuts
Date: Fri Apr 11 12:40:22 2008
New Revision: 647281
URL: http://svn.apache.org/viewvc?rev=647281&view=rev
Log:
fixing a few javadoc problems
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/IElementSerializer.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEvent.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java Fri Apr 11 12:40:22 2008
@@ -39,14 +39,19 @@
*/
public static final int RECORD_HEADER = 4;
+ /** Serializes. */
private static final StandardSerializer SERIALIZER = new StandardSerializer();
+ /** The logger */
private static final Log log = LogFactory.getLog( IndexedDisk.class );
+ /** The path to the log directory. */
private final String filepath;
+ /** The data file. */
private RandomAccessFile raf;
+ /** read buffer */
private final byte[] buffer = new byte[16384]; // 16K
/**
@@ -198,7 +203,7 @@
* Serializes the object and write it out to the given position.
* <p>
* TODO: make this take a ded as well.
- * @return
+ * @return true unless error
* @param obj
* @param pos
* @throws IOException
@@ -214,7 +219,7 @@
/**
* Returns the raf length.
* <p>
- * @return
+ * @return the length of the file.
* @exception IOException
*/
protected long length()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java Fri Apr 11 12:40:22 2008
@@ -43,7 +43,7 @@
/**
* Return the type of event queue we are using, either single or pooled.
* <p>
- * @return
+ * @return the queue type: single or pooled
*/
public abstract int getQueueType();
@@ -130,7 +130,7 @@
/**
* Returns the historical and statistical data for an event queue cache.
* <p>
- * @return
+ * @return IStats
*/
public IStats getStatistics();
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java Fri Apr 11 12:40:22 2008
@@ -32,7 +32,7 @@
* Gets the cache attribute of the CacheHub object
*
* @param cacheName
- * @return
+ * @return CompositeCache
*/
public abstract CompositeCache getCache( String cacheName );
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/IElementSerializer.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/IElementSerializer.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/IElementSerializer.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/behavior/IElementSerializer.java Fri Apr 11 12:40:22 2008
@@ -23,20 +23,17 @@
import java.io.Serializable;
/**
- * Defines the behavior for cache element serializers. This layer of abstraction
- * allows us to plug in different serialization mechanisms, such as XStream.
- *
+ * Defines the behavior for cache element serializers. This layer of abstraction allows us to plug
+ * in different serialization mechanisms, such as XStream.
+ * <p>
* @author Aaron Smuts
- *
*/
public interface IElementSerializer
{
-
/**
* Turns an object into a byte array.
- *
* @param obj
- * @return
+ * @return byte[]
* @throws IOException
*/
public abstract byte[] serialize( Serializable obj )
@@ -44,13 +41,11 @@
/**
* Turns a byte array into an object.
- *
* @param bytes
- * @return
+ * @return Object
* @throws IOException
* @throws ClassNotFoundException thrown if we don't know the object.
*/
public abstract Object deSerialize( byte[] bytes )
throws IOException, ClassNotFoundException;
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEvent.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEvent.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEvent.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEvent.java Fri Apr 11 12:40:22 2008
@@ -25,26 +25,24 @@
import org.apache.jcs.engine.control.event.behavior.IElementEventConstants;
/**
- * Element events will trigger the creation of Element Event objects. This is a
- * wrapper around the cache element that indicates the event triggered.
- *
+ * Element events will trigger the creation of Element Event objects. This is a wrapper around the
+ * cache element that indicates the event triggered.
*/
public class ElementEvent
extends EventObject
implements IElementEventConstants, IElementEvent
{
-
+ /** Don't change */
private static final long serialVersionUID = -5364117411457467056L;
+ /** default event code */
private int elementEvent = ElementEvent.ELEMENT_EVENT_EXCEEDED_MAXLIFE_BACKGROUND;
/**
* Constructor for the ElementEvent object
- *
- * @param source
- * The Cache Element (should restrict?)
- * @param elementEvent
- * The event id defined in the constants class.
+ * <p>
+ * @param source The Cache Element (should restrict?)
+ * @param elementEvent The event id defined in the constants class.
*/
public ElementEvent( Object source, int elementEvent )
{
@@ -54,13 +52,11 @@
/**
* Gets the elementEvent attribute of the ElementEvent object
- *
- * @return The elementEvent value. The List of values is defined in
- * IElementEventConstants.
+ * <p>
+ * @return The elementEvent value. The List of values is defined in IElementEventConstants.
*/
public int getElementEvent()
{
return elementEvent;
}
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java?rev=647281&r1=647280&r2=647281&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java Fri Apr 11 12:40:22 2008
@@ -23,41 +23,42 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import org.apache.jcs.engine.control.event.behavior.IElementEventQueue;
-import org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
import org.apache.jcs.engine.control.event.behavior.IElementEvent;
+import org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
+import org.apache.jcs.engine.control.event.behavior.IElementEventQueue;
/**
- * An event queue is used to propagate ordered cache events to one and only one
- * target listener.
+ * An event queue is used to propagate ordered cache events to one and only one target listener.
*/
public class ElementEventQueue
implements IElementEventQueue
{
+ /** The logger */
private final static Log log = LogFactory.getLog( ElementEventQueue.class );
+ /** number of processors */
private static int processorInstanceCount = 0;
+ /** The cache (region) name. */
private String cacheName;
+ /** shutdown or not */
private boolean destroyed = false;
+ /** The worker thread. */
private Thread t;
- // Internal queue implementation
-
+ /** Internal queue implementation */
private Object queueLock = new Object();
- // Dummy node
-
+ /** Dummy node */
private Node head = new Node();
+ /** tail of the doubly linked list */
private Node tail = head;
/**
* Constructor for the ElementEventQueue object
- *
* @param cacheName
*/
public ElementEventQueue( String cacheName )
@@ -115,11 +116,8 @@
/**
* Adds an ElementEvent to be handled
- *
- * @param hand
- * The IElementEventHandler
- * @param event
- * The IElementEventHandler IElementEvent event
+ * @param hand The IElementEventHandler
+ * @param event The IElementEventHandler IElementEvent event
* @throws IOException
*/
public void addElementEvent( IElementEventHandler hand, IElementEvent event )
@@ -146,7 +144,6 @@
/**
* Adds an event to the queue.
- *
* @param event
*/
private void put( AbstractElementEventRunner event )
@@ -164,6 +161,12 @@
}
}
+ /**
+ * Returns the next item on the queue, or waits if empty.
+ * <p>
+ * @return AbstractElementEventRunner
+ * @throws InterruptedException
+ */
private AbstractElementEventRunner take()
throws InterruptedException
{
@@ -207,7 +210,7 @@
}
}
- ///////////////////////////// Inner classes /////////////////////////////
+ // /////////////////////////// Inner classes /////////////////////////////
private static class Node
{
@@ -253,7 +256,6 @@
catch ( InterruptedException e )
{
// We were interrupted, so terminate gracefully.
-
this.destroy();
}
@@ -269,7 +271,6 @@
/**
* Retries before declaring failure.
- *
*/
private abstract class AbstractElementEventRunner
implements Runnable
@@ -303,8 +304,8 @@
}
/**
- * Description of the Method
- *
+ * This will do the work or trigger the work to be done.
+ * <p>
* @exception IOException
*/
protected abstract void doRun()
@@ -312,17 +313,20 @@
}
/**
+ * ElementEventRunner.
*/
private class ElementEventRunner
extends AbstractElementEventRunner
{
-
+ /** the handler */
private IElementEventHandler hand;
+ /** event */
private IElementEvent event;
/**
- * Constructor for the PutEvent object
+ * Constructor for the PutEvent object.
+ * <p>
* @param hand
* @param event
* @exception IOException
@@ -339,8 +343,8 @@
}
/**
- * Description of the Method
- *
+ * Tells the handler to handle the event.
+ * <p>
* @exception IOException
*/
protected void doRun()
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org