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 2006/07/14 19:49:14 UTC
svn commit: r421965 [1/2] - in /jakarta/jcs/trunk/src/java/org/apache/jcs:
auxiliary/disk/jdbc/mysql/ engine/ engine/memory/ utils/access/
utils/config/ utils/net/ utils/props/ utils/serialization/ utils/servlet/
utils/struct/ utils/threadpool/ utils/t...
Author: asmuts
Date: Fri Jul 14 10:49:13 2006
New Revision: 421965
URL: http://svn.apache.org/viewvc?rev=421965&view=rev
Log:
improved formatting and javadocs. removed an unused class.
Removed:
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheDescriptor.java
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheAdaptor.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheConstants.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElement.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElementSerialized.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheGroup.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheInfo.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheListeners.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheUtils.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheWatchRepairable.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CompositeCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ElementAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorker.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorkerHelper.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/IUtilConstants.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/net/HostNameUtil.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/servlet/BasicHttpAuthenticator.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMapEntry.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPool.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/behavior/IPoolConfiguration.java
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java Fri Jul 14 10:49:13 2006
@@ -13,7 +13,7 @@
private static final long serialVersionUID = -6535808344813320061L;
/**
- * For now this is a simpel comma delimited list of HH:MM times to optimize
+ * For now this is a simple comma delimited list of HH:MM:SS times to optimize
* the table. If none is supplied, then no optimizations will be performed.
* <p>
* In the future we can add a chron like scheduling system. This is to meet
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheAdaptor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheAdaptor.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheAdaptor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheAdaptor.java Fri Jul 14 10:49:13 2006
@@ -1,34 +1,28 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.IOException;
import java.io.Serializable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.behavior.ICache;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.ICacheListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
- * Used for Cache-to-Cache messaging purposes.
- *
+ * Used for Cache-to-Cache messaging purposes. These are used in the balking
+ * facades in the lateral and remote caches.
*/
public class CacheAdaptor
implements ICacheListener
@@ -37,12 +31,12 @@
private final ICache cache;
- /** Description of the Field */
+ /** The unique id of this listner. */
protected long listenerId = 0;
/**
* Sets the listenerId attribute of the CacheAdaptor object
- *
+ * <p>
* @param id
* The new listenerId value
* @throws IOException
@@ -56,7 +50,7 @@
/**
* Gets the listenerId attribute of the CacheAdaptor object
- *
+ * <p>
* @return The listenerId value
* @throws IOException
*/
@@ -68,7 +62,6 @@
/**
* Constructor for the CacheAdaptor object
- *
* @param cache
*/
public CacheAdaptor( ICache cache )
@@ -76,9 +69,9 @@
this.cache = cache;
}
- /**
+ /**
* Puts an item into the cache.
- *
+ * <p>
* @param item
* @throws IOException
*/
@@ -87,9 +80,6 @@
{
try
{
- //cache.put(item.getKey(), item.getVal());
- //cache.update( (CacheElement)item );// .put(item.getKey(),
- // item.getVal());
cache.update( item );
}
catch ( Exception e )
@@ -99,8 +89,9 @@
}
/*
- * (non-Javadoc)
- * @see org.apache.jcs.engine.behavior.ICacheListener#handleRemove(java.lang.String, java.io.Serializable)
+ * (non-Javadoc)
+ * @see org.apache.jcs.engine.behavior.ICacheListener#handleRemove(java.lang.String,
+ * java.io.Serializable)
*/
public void handleRemove( String cacheName, Serializable key )
throws IOException
@@ -109,7 +100,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheListener#handleRemoveAll(java.lang.String)
*/
public void handleRemoveAll( String cacheName )
@@ -119,7 +110,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheListener#handleDispose(java.lang.String)
*/
public void handleDispose( String cacheName )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheConstants.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheConstants.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheConstants.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheConstants.java Fri Jul 14 10:49:13 2006
@@ -18,7 +18,7 @@
/**
* Constants used throughout the JCS cache engine
- *
+ * <p>
* @version $Id$
*/
public interface CacheConstants
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElement.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElement.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElement.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElement.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.Serializable;
@@ -23,12 +18,10 @@
/**
* Generic element wrapper. Often stuffed inside another.
- *
*/
public class CacheElement
implements ICacheElement, Serializable
{
-
private static final long serialVersionUID = -6062305728297627263L;
/** The name of the cache region. This is a namespace. */
@@ -48,7 +41,7 @@
/**
* Constructor for the CacheElement object
- *
+ * <p>
* @param cacheName
* @param key
* @param val
@@ -62,7 +55,7 @@
/**
* Constructor for the CacheElement object
- *
+ * <p>
* @param cacheName
* @param key
* @param val
@@ -78,7 +71,7 @@
/**
* Constructor for the CacheElement object
- *
+ * <p>
* @param cacheName
* @param key
* @param val
@@ -90,7 +83,7 @@
/**
* Gets the cacheName attribute of the CacheElement object
- *
+ * <p>
* @return The cacheName value
*/
public String getCacheName()
@@ -100,7 +93,7 @@
/**
* Gets the key attribute of the CacheElement object
- *
+ * <p>
* @return The key value
*/
public Serializable getKey()
@@ -110,7 +103,7 @@
/**
* Gets the val attribute of the CacheElement object
- *
+ * <p>
* @return The val value
*/
public Serializable getVal()
@@ -120,7 +113,7 @@
/**
* Sets the attributes attribute of the CacheElement object
- *
+ * <p>
* @param attr
* The new IElementAttributes value
*/
@@ -131,7 +124,7 @@
/**
* Gets the IElementAttributes attribute of the CacheElement object
- *
+ * <p>
* @return The IElementAttributes value, never null
*/
public IElementAttributes getElementAttributes()
@@ -148,7 +141,6 @@
/**
* @return a hash of the key only
- *
*/
public int hashCode()
{
@@ -157,9 +149,8 @@
/**
* For debugging only.
- *
+ * <p>
* @return String representation
- *
*/
public String toString()
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElementSerialized.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElementSerialized.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElementSerialized.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheElementSerialized.java Fri Jul 14 10:49:13 2006
@@ -6,19 +6,14 @@
import org.apache.jcs.engine.behavior.IElementAttributes;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
/**
@@ -27,7 +22,6 @@
public class CacheElementSerialized
implements ICacheElementSerialized
{
-
private static final long serialVersionUID = -7265084818647601874L;
/** The name of the cache region. This is a namespace. */
@@ -45,7 +39,8 @@
private IElementAttributes elementAttributes;
/**
- *
+ * Constructs a usable wrapper.
+ * <p>
* @param cacheNameArg
* @param keyArg
* @param serializedValueArg
@@ -60,6 +55,9 @@
this.elementAttributes = elementAttributesArg;
}
+ /**
+ * Returns the name of the cache. This is the name of the region.
+ */
public String getCacheName()
{
return this.cacheName;
@@ -67,7 +65,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheElement#getKey()
*/
public Serializable getKey()
@@ -77,7 +74,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheElementSerialized#getSerializedValue()
*/
public byte[] getSerializedValue()
@@ -87,7 +83,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheElement#getElementAttributes()
*/
public IElementAttributes getElementAttributes()
@@ -97,7 +92,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheElement#setElementAttributes(org.apache.jcs.engine.behavior.IElementAttributes)
*/
public void setElementAttributes( IElementAttributes attr )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.IOException;
@@ -33,12 +28,11 @@
/**
* An event queue is used to propagate ordered cache events to one and only one
* target listener.
- *
+ * <p>
* This is a modified version of the experimental version. It should lazy
* initilaize the processor thread, and kill the thread if the queue goes emtpy
* for a specified period, now set to 1 minute. If something comes in after that
* a new processor thread should be created.
- *
*/
public class CacheEventQueue
implements ICacheEventQueue
@@ -88,7 +82,7 @@
/**
* Constructs with the specified listener and the cache name.
- *
+ * <p>
* @param listener
* @param listenerId
* @param cacheName
@@ -100,7 +94,7 @@
/**
* Constructor for the CacheEventQueue object
- *
+ * <p>
* @param listener
* @param listenerId
* @param cacheName
@@ -129,7 +123,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheEventQueue#getQueueType()
*/
public int getQueueType()
@@ -149,7 +142,6 @@
/**
* Returns the time to wait for events before killing the background thread.
- *
* @return int
*/
public int getWaitToDieMillis()
@@ -159,7 +151,7 @@
/**
* Sets the time to wait for events before killing the background thread.
- *
+ * <p>
* @param wtdm
* the ms for the q to sit idle.
*/
@@ -178,7 +170,7 @@
/**
* If they queue has an active thread it is considered alive.
- *
+ * <p>
* @return The alive value
*/
public boolean isAlive()
@@ -189,7 +181,7 @@
/**
* Sets whether the queue is actively processing -- if there are working
* threads.
- *
+ * <p>
* @param aState
*/
public void setAlive( boolean aState )
@@ -207,7 +199,7 @@
/**
* Event Q is emtpy.
- *
+ * <p>
* Calling destroy interupts the processor thread.
*/
public synchronized void destroy()
@@ -292,7 +284,7 @@
/**
* This adds a remove all event to the queue. When it is processed, all
* elements will be removed from the cache.
- *
+ * <p>
* @exception IOException
*/
public synchronized void addRemoveAllEvent()
@@ -332,7 +324,7 @@
/**
* Adds an event to the queue.
- *
+ * <p>
* @param event
*/
private void put( AbstractCacheEvent event )
@@ -375,9 +367,8 @@
* that node. This value is returned.
* <p>
* When the queue is empty the head node is the same as the tail node.
- *
+ * <p>
* @return An event to process.
- *
*/
private AbstractCacheEvent take()
{
@@ -410,7 +401,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheEventQueue#getStatistics()
*/
public IStats getStatistics()
@@ -479,7 +469,7 @@
/**
* This is the thread that works the queue.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -490,7 +480,6 @@
/**
* Constructor for the QProcessor object
- *
* @param aQueue
* the event queue to take items from.
*/
@@ -504,7 +493,7 @@
/**
* Main processing method for the QProcessor object.
- *
+ * <p>
* Waits for a specified time (waitToDieMillis) for something to come in
* and if no new events come in during that period the run method can
* exit and the thread is dereferenced.
@@ -561,7 +550,7 @@
/**
* Retries before declaring failure.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -630,7 +619,7 @@
/**
* An element should be put in the cache.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -642,7 +631,6 @@
/**
* Constructor for the PutEvent object
- *
* @param ice
* @exception IOException
*/
@@ -654,7 +642,6 @@
/**
* Description of the Method
- *
* @exception IOException
*/
protected void doRun()
@@ -676,7 +663,7 @@
/**
* An element should be removed from the cache.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -687,7 +674,6 @@
/**
* Constructor for the RemoveEvent object
- *
* @param key
* @exception IOException
*/
@@ -699,7 +685,7 @@
/**
* Description of the Method
- *
+ * <p>
* @exception IOException
*/
protected void doRun()
@@ -710,7 +696,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
public String toString()
@@ -723,7 +708,7 @@
/**
* All elements should be removed from the cache when this event is
* processed.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -733,7 +718,6 @@
/**
* Description of the Method
- *
* @exception IOException
*/
protected void doRun()
@@ -744,7 +728,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
public String toString()
@@ -756,7 +739,7 @@
/**
* The cache should be disposed when this event is processed.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -766,7 +749,7 @@
/**
* Called when gets to the end of the queue
- *
+ * <p>
* @exception IOException
*/
protected void doRun()
@@ -793,7 +776,7 @@
* This means that the queue is functional. If we reached the max number of
* failures, the queue is marked as non functional and will never work
* again.
- *
+ * <p>
* @param b
*/
public void setWorking( boolean b )
@@ -802,7 +785,6 @@
}
/**
- *
* @return whether there are any items in the queue.
*/
public boolean isEmpty()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java Fri Jul 14 10:49:13 2006
@@ -8,9 +8,8 @@
/**
* This class hands out event Queues. This allows us to change the
* implementation more easily.
- *
+ * <p>
* @author aaronsm
- *
*/
public class CacheEventQueueFactory
{
@@ -19,7 +18,7 @@
/**
* The most commonly used factory method.
- *
+ * <p>
* @param listener
* @param listenerId
* @param cacheName
@@ -35,7 +34,7 @@
/**
* Fully configured event queue.
- *
+ * <p>
* @param listener
* @param listenerId
* @param cacheName
@@ -51,7 +50,6 @@
int maxFailure, int waitBeforeRetry, String threadPoolName,
int poolType )
{
-
if ( log.isDebugEnabled() )
{
log.debug( "threadPoolName = [" + threadPoolName + "] poolType = " + poolType + " " );
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheGroup.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheGroup.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheGroup.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheGroup.java Fri Jul 14 10:49:13 2006
@@ -1,30 +1,24 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import org.apache.jcs.engine.behavior.IElementAttributes;
/**
- * Description of the Class
- *
+ * Holder for attributes specific to a group. The grouping functionality is on
+ * the way out.
*/
public class CacheGroup
{
-
/** Element configuration. */
public IElementAttributes attr;
@@ -36,7 +30,7 @@
/**
* Sets the attributes attribute of the CacheGroup object
- *
+ * <p>
* @param attr
* The new attributes value
*/
@@ -47,12 +41,11 @@
/**
* Gets the attrributes attribute of the CacheGroup object
- *
+ * <p>
* @return The attrributes value
*/
public IElementAttributes getElementAttrributes()
{
return attr;
}
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheInfo.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheInfo.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheInfo.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheInfo.java Fri Jul 14 10:49:13 2006
@@ -1,30 +1,23 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.rmi.dgc.VMID;
/**
- * A shared static variable holder for the lateral cache
- *
+ * This is a static variable holder for the distribution auxiliaries that need something like a vmid.
*/
public final class CacheInfo
{
-
/** shouldn't be instantiated */
private CacheInfo()
{
@@ -32,15 +25,15 @@
}
/**
- * Shouldn't be used till after reconneting, after setting = thread safe
* Used to identify a client, so we can run multiple clients off one host.
* Need since there is no way to identify a client other than by host in
- * rmi. TODO: may have some trouble in failover mode if the cache keeps its
- * old id. We may need to reset this when moving into failover.
+ * rmi.
+ * <p>
+ * TODO: may have some trouble in failover mode if the cache keeps its old
+ * id. We may need to reset this when moving into failover.
*/
protected static VMID vmid = new VMID();
- /** Description of the Field */
+ /** By default this is the hashcode of the VMID */
public static long listenerId = vmid.hashCode();
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheListeners.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheListeners.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheListeners.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheListeners.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.util.Hashtable;
@@ -24,11 +19,9 @@
/**
* Used to associates a set of [cache listener to cache event queue] for a
* cache.
- *
*/
public class CacheListeners
{
-
/** Description of the Field */
public final ICache cache;
@@ -40,7 +33,7 @@
/**
* Constructs with the given cache.
- *
+ * <p>
* @param cache
*/
public CacheListeners( ICache cache )
@@ -51,6 +44,4 @@
}
this.cache = cache;
}
-
}
-// end CacheListeners
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheUtils.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheUtils.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheUtils.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheUtils.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.ByteArrayInputStream;
@@ -25,22 +20,21 @@
/**
* This will be superceded by the new pluggable serializer infastructure.
- *
+ * <p>
* basic utility functions
- *
+ * <p>
* TODO move to util
- *
*/
public final class CacheUtils
{
-
/** No instances please. */
private CacheUtils()
{
super();
}
- /** Returns a deeply cloned object.
+ /**
+ * Returns a deeply cloned object.
* @param obj
* @return
* @throws IOException
@@ -53,6 +47,7 @@
/**
* Returns the serialized form of the given object in a byte array.
+ * <p>
* @param obj
* @return
* @throws IOException
@@ -73,7 +68,9 @@
return baos.toByteArray();
}
- /** Returns the object deserialized from the given byte array.
+ /**
+ * Returns the object deserialized from the given byte array.
+ * <p>
* @param buf
* @return
* @throws IOException
@@ -98,6 +95,4 @@
ois.close();
}
}
-
}
-// end class
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheWatchRepairable.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheWatchRepairable.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheWatchRepairable.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CacheWatchRepairable.java Fri Jul 14 10:49:13 2006
@@ -50,7 +50,7 @@
/**
* Replaces the underlying cache watch service and reattached all existing
* listeners to the new cache watch.
- *
+ * <p>
* @param cacheWatch
* The new cacheWatch value
*/
@@ -72,7 +72,7 @@
}
catch ( IOException ex )
{
- log.error( ex );
+ log.error( "Problem adding listener.", ex );
}
}
}
@@ -82,7 +82,7 @@
/**
* Adds a feature to the CacheListener attribute of the CacheWatchRepairable
* object
- *
+ * <p>
* @param cacheName
* The feature to be added to the CacheListener attribute
* @param obj
@@ -111,7 +111,7 @@
/**
* Adds a feature to the CacheListener attribute of the CacheWatchRepairable
* object
- *
+ * <p>
* @param obj
* The feature to be added to the CacheListener attribute
* @throws IOException
@@ -163,8 +163,7 @@
throws IOException
{
// Record the removal locally, regardless of whether the remote
- // remove-listener
- // operation succeeds or fails.
+ // remove-listener operation succeeds or fails.
synchronized ( cacheMap )
{
for ( Iterator itr = cacheMap.values().iterator(); itr.hasNext(); )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CompositeCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CompositeCacheAttributes.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CompositeCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/CompositeCacheAttributes.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
@@ -25,17 +20,12 @@
* <p>
* If all the default attributes are not defined in the default region
* definition in the cache.ccf, the hard coded defaults will be used.
- *
*/
public class CompositeCacheAttributes
implements ICompositeCacheAttributes, Cloneable
{
-
private static final long serialVersionUID = 6754049978134196787L;
- // Allows for programmatic stopping of configuration information. Shouldn't
- // use.
- // cannot turn on service if it is not set in props. Only stop.
private static final boolean DEFAULT_USE_LATERAL = true;
private static final boolean DEFAULT_USE_REMOTE = true;
@@ -46,14 +36,14 @@
private static final int DEFAULT_MAX_OBJECTS = 100;
- private static final int DEFAULT_MAX_MEMORY_IDLE_TIME_SECONDS = 60 * 120; // 2 hours
+ private static final int DEFAULT_MAX_MEMORY_IDLE_TIME_SECONDS = 60 * 120;
- private static final int DEFAULT_SHRINKER_INTERVAL_SECONDS = 30;
+ private static final int DEFAULT_SHRINKER_INTERVAL_SECONDS = 30;
- private static final int DEFAULT_MAX_SPOOL_PER_RUN = -1;
+ private static final int DEFAULT_MAX_SPOOL_PER_RUN = -1;
private static final String DEFAULT_MEMORY_CACHE_NAME = "org.apache.jcs.engine.memory.lru.LRUMemoryCache";
-
+
private boolean useLateral = DEFAULT_USE_LATERAL;
private boolean useRemote = DEFAULT_USE_REMOTE;
@@ -70,7 +60,7 @@
/** maxMemoryIdleTimeSeconds */
private long maxMemoryIdleTimeSeconds = DEFAULT_MAX_MEMORY_IDLE_TIME_SECONDS;
- /** shrinkerIntervalSeconds */
+ /** shrinkerIntervalSeconds */
private long shrinkerIntervalSeconds = DEFAULT_SHRINKER_INTERVAL_SECONDS;
/** The maximum number the shrinker will spool to disk per run. */
@@ -94,7 +84,7 @@
/**
* Sets the maxObjects attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param maxObjs
* The new maxObjects value
*/
@@ -105,7 +95,7 @@
/**
* Gets the maxObjects attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The maxObjects value
*/
public int getMaxObjects()
@@ -115,7 +105,7 @@
/**
* Sets the useDisk attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param useDisk
* The new useDisk value
*/
@@ -126,7 +116,7 @@
/**
* Gets the useDisk attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The useDisk value
*/
public boolean getUseDisk()
@@ -136,7 +126,7 @@
/**
* Sets the useLateral attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param b
* The new useLateral value
*/
@@ -147,7 +137,7 @@
/**
* Gets the useLateral attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The useLateral value
*/
public boolean getUseLateral()
@@ -157,7 +147,7 @@
/**
* Sets the useRemote attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param useRemote
* The new useRemote value
*/
@@ -168,7 +158,7 @@
/**
* Gets the useRemote attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The useRemote value
*/
public boolean getUseRemote()
@@ -178,7 +168,7 @@
/**
* Sets the cacheName attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param s
* The new cacheName value
*/
@@ -189,7 +179,7 @@
/**
* Gets the cacheName attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The cacheName value
*/
public String getCacheName()
@@ -199,7 +189,7 @@
/**
* Sets the memoryCacheName attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @param s
* The new memoryCacheName value
*/
@@ -210,7 +200,7 @@
/**
* Gets the memoryCacheName attribute of the CompositeCacheAttributes object
- *
+ * <p>
* @return The memoryCacheName value
*/
public String getMemoryCacheName()
@@ -220,7 +210,7 @@
/**
* Whether the memory cache should perform background memory shrinkage.
- *
+ * <p>
* @param useShrinker
* The new UseMemoryShrinker value
*/
@@ -231,7 +221,7 @@
/**
* Whether the memory cache should perform background memory shrinkage.
- *
+ * <p>
* @return The UseMemoryShrinker value
*/
public boolean getUseMemoryShrinker()
@@ -242,7 +232,7 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space.
- *
+ * <p>
* @param seconds
* The new MaxMemoryIdleTimeSeconds value
*/
@@ -254,7 +244,7 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space.
- *
+ * <p>
* @return The MaxMemoryIdleTimeSeconds value
*/
public long getMaxMemoryIdleTimeSeconds()
@@ -265,7 +255,7 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space. This sets the shrinker interval.
- *
+ * <p>
* @param seconds
* The new ShrinkerIntervalSeconds value
*/
@@ -277,7 +267,7 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space. This gets the shrinker interval.
- *
+ * <p>
* @return The ShrinkerIntervalSeconds value
*/
public long getShrinkerIntervalSeconds()
@@ -288,10 +278,10 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space. This sets the maximum number of items to spool per run.
- *
+ * <p>
* If the value is -1, then there is no limit to the number of items to be
* spooled.
- *
+ * <p>
* @param maxSpoolPerRun
* The new maxSpoolPerRun value
*/
@@ -303,7 +293,7 @@
/**
* If UseMemoryShrinker is true the memory cache should auto-expire elements
* to reclaim space. This gets the maximum number of items to spool per run.
- *
+ * <p>
* @return The maxSpoolPerRun value
*/
public int getMaxSpoolPerRun()
@@ -313,7 +303,7 @@
/**
* Description of the Method
- *
+ * <p>
* @return
*/
public ICompositeCacheAttributes copy()
@@ -324,7 +314,7 @@
return cattr;
}
catch ( Exception e )
- {
+ {
System.err.println( e.toString() );
return new CompositeCacheAttributes();
}
@@ -332,16 +322,20 @@
/**
* Description of the Method
- *
+ * <p>
* @return
*/
public String toString()
{
StringBuffer dump = new StringBuffer();
- dump.append( "[ " ).append( "useLateral = " ).append( useLateral ).append( ", useRemote = " )
- .append( useRemote ).append( ", useDisk = " ).append( useDisk ).append( ", maxObjs = " ).append( maxObjs )
- .append( ", maxSpoolPerRun = " ).append( maxSpoolPerRun ).append( " ]" );
+ dump.append( "[ " );
+ dump.append( "useLateral = " ).append( useLateral );
+ dump.append( ", useRemote = " ).append( useRemote );
+ dump.append( ", useDisk = " ).append( useDisk );
+ dump.append( ", maxObjs = " ).append( maxObjs );
+ dump.append( ", maxSpoolPerRun = " ).append( maxSpoolPerRun );
+ dump.append( " ]" );
return dump.toString();
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ElementAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ElementAttributes.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ElementAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ElementAttributes.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.ByteArrayInputStream;
@@ -31,21 +26,19 @@
* This it the element attribute descriptor class. Each element in the cache has
* an ElementAttribute object associated with it. An ElementAttributes object
* can be associated with an element in 3 ways:
- * <ul>
- * <li>1. When the item is put into the cache, you can associate an element
+ * <ol>
+ * <li>When the item is put into the cache, you can associate an element
* attributes object.</li>
- * <li>2. If not attributes object is include when the element is put into the
+ * <li>If not attributes object is include when the element is put into the
* cache, then the default attributes for the region will be used.</li>
- * <li>3. The element attributes can be reset. This effectively results in a
+ * <li>The element attributes can be reset. This effectively results in a
* retrieval followed by a put. Hence, this is the same as 1.</li>
- * </ul>
- *
+ * </ol>
* @version $Id: ILateralCacheTCPListener.java,v 1.2 2002/01/18 22:08:26
*/
public class ElementAttributes
implements IElementAttributes, Serializable, Cloneable
{
-
private static final long serialVersionUID = 7814990748035017441L;
/**
@@ -64,8 +57,8 @@
public boolean IS_REMOTE = true;
/**
- * You can turn off expiration by setting this to true. This causes the cache
- * to bypass both max life and idle time expiration.
+ * You can turn off expiration by setting this to true. This causes the
+ * cache to bypass both max life and idle time expiration.
*/
public boolean IS_ETERNAL = true;
@@ -80,7 +73,8 @@
public long maxLifeSeconds = -1;
/**
- * The maximum time an entry can be idle. Setting this to -1 causes the idle time check to be ignored.
+ * The maximum time an entry can be idle. Setting this to -1 causes the idle
+ * time check to be ignored.
*/
public long maxIdleTimeSeconds = -1;
@@ -103,7 +97,7 @@
* The list of Event handlers to use. This is transient, since the event
* handlers cannot usually be serialized. This means that you cannot attach
* a post serialization event to an item.
- *
+ * <p>
* TODO we need to check that when an item is passed to a non-local cache
* that if the local cache had a copy with event handlers, that those
* handlers are used.
@@ -121,7 +115,7 @@
/**
* Constructor for the IElementAttributes object
- *
+ * <p>
* @param attr
*/
protected ElementAttributes( ElementAttributes attr )
@@ -145,7 +139,7 @@
/**
* Copies the attributes, including references to event handlers.
- *
+ * <p>
* @return a copy of the Attributes
*/
public IElementAttributes copy()
@@ -172,12 +166,11 @@
/**
* Deep clone the attributes.
- *
+ * <p>
* @return a clone of these attributes
*/
public Object clone2()
{
-
try
{
ByteArrayOutputStream baos = new ByteArrayOutputStream( 100 );
@@ -205,7 +198,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setVersion(long)
*/
public void setVersion( long version )
@@ -215,7 +207,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setMaxLifeSeconds(long)
*/
public void setMaxLifeSeconds( long mls )
@@ -225,7 +216,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getMaxLifeSeconds()
*/
public long getMaxLifeSeconds()
@@ -235,7 +225,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setIdleTime(long)
*/
public void setIdleTime( long idle )
@@ -245,7 +234,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setSize(int)
*/
public void setSize( int size )
@@ -255,7 +243,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getSize()
*/
public int getSize()
@@ -265,7 +252,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getCreateTime()
*/
public long getCreateTime()
@@ -283,7 +269,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getVersion()
*/
public long getVersion()
@@ -293,7 +278,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getIdleTime()
*/
public long getIdleTime()
@@ -303,7 +287,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getTimeToLiveSeconds()
*/
public long getTimeToLiveSeconds()
@@ -314,7 +297,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getLastAccessTime()
*/
public long getLastAccessTime()
@@ -324,7 +306,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setLastAccessTimeNow()
*/
public void setLastAccessTimeNow()
@@ -334,7 +315,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getIsSpool()
*/
public boolean getIsSpool()
@@ -344,7 +324,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setIsSpool(boolean)
*/
public void setIsSpool( boolean val )
@@ -354,7 +333,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#getIsLateral()
*/
public boolean getIsLateral()
@@ -364,7 +342,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.IElementAttributes#setIsLateral(boolean)
*/
public void setIsLateral( boolean val )
@@ -374,7 +351,6 @@
/**
* Can this item be sent to the remote cache
- *
* @return true if the item can be sent to a remote auxiliary
*/
public boolean getIsRemote()
@@ -384,7 +360,6 @@
/**
* Sets the isRemote attribute of the ElementAttributes object
- *
* @param val
* The new isRemote value
*/
@@ -396,7 +371,7 @@
/**
* You can turn off expiration by setting this to true. The max life value
* will be ignored.
- *
+ * <p>
* @return true if the item cannot expire.
*/
public boolean getIsEternal()
@@ -409,7 +384,7 @@
* that the item should never expire. If can still be removed if it is the
* least recently used, and you are using the LRUMemory cache. it just will
* not be filtered for expiration by the cache hub.
- *
+ * <p>
* @param val
* The new isEternal value
*/
@@ -421,11 +396,11 @@
/**
* Adds a ElementEventHandler. Handler's can be registered for multiple
* events. A registered handler will be called at every recognized event.
- *
+ * <p>
* The alternative would be to register handlers for each event. Or maybe
* The handler interface should have a method to return whether it cares
* about certain events.
- *
+ * <p>
* @param eventHandler
* The ElementEventHandler to be added to the list.
*/
@@ -444,7 +419,7 @@
* <p>
* This add the references to the local list. Subsequent changes in the
* caller's list will not be reflected.
- *
+ * <p>
* @param eventHandlers
* List of IElementEventHandler objects
*/
@@ -464,7 +439,7 @@
/**
* Gets the elementEventHandlers. Returns null if none exist. Makes checking
* easy.
- *
+ * <p>
* @return The elementEventHandlers List of IElementEventHandler objects
*/
public ArrayList getElementEventHandlers()
@@ -474,20 +449,23 @@
/**
* For logging and debugging the element IElementAttributes.
- *
+ * <p>
* @return String info about the values.
*/
public String toString()
{
StringBuffer dump = new StringBuffer();
- dump.append( "[ IS_LATERAL = " ).append( IS_LATERAL ).append( ", IS_SPOOL = " ).append( IS_SPOOL )
- .append( ", IS_REMOTE = " ).append( IS_REMOTE ).append( ", IS_ETERNAL = " ).append( IS_ETERNAL )
- .append( ", MaxLifeSeconds = " ).append( this.getMaxLifeSeconds() ).append( ", IdleTime = " )
- .append( this.getIdleTime() ).append( ", CreateTime = " ).append( this.getCreateTime() )
- .append( ", LastAccessTime = " ).append( this.getLastAccessTime() ).append( ", getTimeToLiveSeconds() = " )
- .append( String.valueOf( getTimeToLiveSeconds() ) ).append( ", createTime = " )
- .append( String.valueOf( createTime ) ).append( " ]" );
+ dump.append( "[ IS_LATERAL = " ).append( IS_LATERAL );
+ dump.append( ", IS_SPOOL = " ).append( IS_SPOOL );
+ dump.append( ", IS_REMOTE = " ).append( IS_REMOTE );
+ dump.append( ", IS_ETERNAL = " ).append( IS_ETERNAL );
+ dump.append( ", MaxLifeSeconds = " ).append( this.getMaxLifeSeconds() );
+ dump.append( ", IdleTime = " ).append( this.getIdleTime() );
+ dump.append( ", CreateTime = " ).append( this.getCreateTime() );
+ dump.append( ", LastAccessTime = " ).append( this.getLastAccessTime() );
+ dump.append( ", getTimeToLiveSeconds() = " ).append( String.valueOf( getTimeToLiveSeconds() ) );
+ dump.append( ", createTime = " ).append( String.valueOf( createTime ) ).append( " ]" );
return dump.toString();
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.IOException;
@@ -37,24 +32,22 @@
/**
* An event queue is used to propagate ordered cache events to one and only one
* target listener.
- *
+ * <p>
* This is a modified version of the experimental version. It uses a
* PooledExecutor and a BoundedBuffer to queue up events and execute them as
* threads become available.
- *
+ * <p>
* The PooledExecutor is static, because presumably these processes will be IO
* bound, so throwing more than a few threads at them will serve no purpose
* other than to saturate the IO interface. In light of this, having one thread
* per region seems unnecessary. This may prove to be false.
- *
+ * <p>
* @author Aaron Smuts
* @author Travis Savo <ts...@ifilm.com>
- *
*/
public class PooledCacheEventQueue
implements ICacheEventQueue
{
-
private static final int queueType = POOLED_QUEUE_TYPE;
private static final Log log = LogFactory.getLog( PooledCacheEventQueue.class );
@@ -79,12 +72,12 @@
private boolean working = true;
- //The Thread Pool to execute events with.
+ // The Thread Pool to execute events with.
private ThreadPool pool = null;
/**
* Constructor for the CacheEventQueue object
- *
+ * <p>
* @param listener
* @param listenerId
* @param cacheName
@@ -113,11 +106,6 @@
}
pool = ThreadPoolManager.getInstance().getPool( threadPoolName );
- //When our pool is filling up too fast, we should ditch the oldest
- // event in favor of the newer ones.
- //TODO: Make this configurable as a generic option.
- //pool.getPool().discardOldestWhenBlocked();
-
if ( log.isDebugEnabled() )
{
log.debug( "Constructed: " + this );
@@ -126,7 +114,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheEventQueue#getQueueType()
*/
public int getQueueType()
@@ -146,7 +133,7 @@
/**
* Returns the time to wait for events before killing the background thread.
- *
+ * <p>
* @return the time to wait before shutting down in ms.
*/
public int getWaitToDieMillis()
@@ -156,7 +143,7 @@
/**
* Sets the time to wait for events before killing the background thread.
- *
+ * <p>
* @param wtdm
*/
public void setWaitToDieMillis( int wtdm )
@@ -173,7 +160,7 @@
}
/**
- * @return The {3} value
+ * @return true if not destroyed.
*/
public boolean isAlive()
{
@@ -212,6 +199,8 @@
}
/**
+ * Constructs a PutEvent for the object and passes it to the event queue.
+ * <p>
* @param ce
* The feature to be added to the PutEvent attribute
* @exception IOException
@@ -293,7 +282,7 @@
/**
* Adds an event to the queue.
- *
+ * <p>
* @param event
*/
private void put( AbstractCacheEvent event )
@@ -318,7 +307,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.engine.behavior.ICacheEventQueue#getStatistics()
*/
public IStats getStatistics()
@@ -379,11 +367,11 @@
return stats;
}
- ///////////////////////////// Inner classes /////////////////////////////
+ // /////////////////////////// Inner classes /////////////////////////////
/**
* Retries before declaring failure.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -395,7 +383,8 @@
boolean done = false;
/**
- * Main processing method for the AbstractCacheEvent object
+ * Main processing method for the AbstractCacheEvent object. It calls
+ * the abstract doRun method that all concrete instances must implement.
*/
public void run()
{
@@ -449,18 +438,18 @@
}
/**
+ * An event that puts an item to a ICacheListener
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
private class PutEvent
extends AbstractCacheEvent
{
-
private ICacheElement ice;
/**
* Constructor for the PutEvent object
- *
* @param ice
* @exception IOException
*/
@@ -468,24 +457,16 @@
throws IOException
{
this.ice = ice;
- /*
- * this.key = key; this.obj = CacheUtils.dup(obj); this.attr = attr;
- * this.groupName = groupName;
- */
}
/**
- * Description of the Method
- *
+ * Tells the ICacheListener to handle the put.
+ * <p>
* @exception IOException
*/
protected void doRun()
throws IOException
{
- /*
- * CacheElement ce = new CacheElement(cacheName, key, obj);
- * ce.setElementAttributes( attr ); ce.setGroupName( groupName );
- */
listener.handlePut( ice );
}
@@ -498,8 +479,8 @@
}
/**
- * Description of the Class
- *
+ * An event that knows how to call remove on an ICacheListener
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -510,7 +491,6 @@
/**
* Constructor for the RemoveEvent object
- *
* @param key
* @exception IOException
*/
@@ -521,8 +501,8 @@
}
/**
- * Description of the Method
- *
+ * Calls remove on the listner.
+ * <p>
* @exception IOException
*/
protected void doRun()
@@ -533,7 +513,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
public String toString()
@@ -544,18 +523,17 @@
}
/**
- * Description of the Class
- *
+ * An event that knows how to call remove all on an ICacheListener
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
private class RemoveAllEvent
extends AbstractCacheEvent
{
-
/**
- * Description of the Method
- *
+ * Call removeAll on the listener.
+ * <p>
* @exception IOException
*/
protected void doRun()
@@ -566,7 +544,6 @@
/*
* (non-Javadoc)
- *
* @see java.lang.Object#toString()
*/
public String toString()
@@ -578,7 +555,7 @@
/**
* The Event put into the queue for dispose requests.
- *
+ * <p>
* @author asmuts
* @created January 15, 2002
*/
@@ -588,7 +565,7 @@
/**
* Called when gets to the end of the queue
- *
+ * <p>
* @exception IOException
*/
protected void doRun()
@@ -623,7 +600,7 @@
/**
* If the Queue is using a bounded channel we can determine the size. If it
* is zero or we can't determine the size, we return true.
- *
+ * <p>
* @return whether or not there are items in the queue
*/
public boolean isEmpty()
@@ -645,5 +622,4 @@
}
}
}
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.Serializable;
@@ -26,8 +21,7 @@
import org.apache.jcs.engine.behavior.IZombie;
/**
- * Zombie adapter for any cache service. balks at every call.
- *
+ * Zombie adapter for any cache service. balks at every call.
*/
public class ZombieCacheService
implements ICacheService, IZombie
@@ -35,9 +29,7 @@
private static final Log log = LogFactory.getLog( ZombieCacheService.class );
-
/**
- *
* @param item
*/
public void put( ICacheElement item )
@@ -50,7 +42,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheService#update(org.apache.jcs.engine.behavior.ICacheElement)
*/
public void update( ICacheElement item )
@@ -59,35 +51,37 @@
}
/*
- * (non-Javadoc)
- * @see org.apache.jcs.engine.behavior.ICacheService#get(java.lang.String, java.io.Serializable)
+ * (non-Javadoc)
+ * @see org.apache.jcs.engine.behavior.ICacheService#get(java.lang.String,
+ * java.io.Serializable)
*/
public ICacheElement get( String cacheName, Serializable key )
{
return null;
}
-
/**
- *
+ * Logs the get to debug, but always balks.
+ * <p>
* @param cacheName
* @param key
* @param container
- * @return
+ * @return null always
*/
public Serializable get( String cacheName, Serializable key, boolean container )
- {
+ {
if ( log.isDebugEnabled() )
{
log.debug( "Zombie get for key [" + key + "] cacheName [" + cacheName + "] container [" + container + "]" );
- }
+ }
// zombies have no inner life
return null;
}
/*
- * (non-Javadoc)
- * @see org.apache.jcs.engine.behavior.ICacheService#remove(java.lang.String, java.io.Serializable)
+ * (non-Javadoc)
+ * @see org.apache.jcs.engine.behavior.ICacheService#remove(java.lang.String,
+ * java.io.Serializable)
*/
public void remove( String cacheName, Serializable key )
{
@@ -95,7 +89,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheService#removeAll(java.lang.String)
*/
public void removeAll( String cacheName )
@@ -104,7 +98,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheService#dispose(java.lang.String)
*/
public void dispose( String cacheName )
@@ -114,7 +108,7 @@
}
/*
- * (non-Javadoc)
+ * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.ICacheService#release()
*/
public void release()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java Fri Jul 14 10:49:13 2006
@@ -31,7 +31,7 @@
/**
* Adds a feature to the CacheListener attribute of the ZombieCacheWatch
* object
- *
+ * <p>
* @param cacheName
* The feature to be added to the CacheListener attribute
* @param obj
@@ -45,7 +45,7 @@
/**
* Adds a feature to the CacheListener attribute of the ZombieCacheWatch
* object
- *
+ * <p>
* @param obj
* The feature to be added to the CacheListener attribute
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/MemoryCache.java Fri Jul 14 10:49:13 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.engine.memory;
/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
import java.io.IOException;
@@ -28,16 +23,16 @@
/**
* 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
+ * why we use this. Should use the IMemeoryCache interface. I'll change it
* later.
- *
+ * <p>
* @version $Id$
*/
public interface MemoryCache
{
/**
* Initialize the memory cache
- *
+ * <p>
* @param cache
* The cache (region) this memory store is attached to.
*/
@@ -45,7 +40,7 @@
/**
* Destroy the memory cache
- *
+ * <p>
* @throws IOException
*/
public void dispose()
@@ -53,14 +48,14 @@
/**
* Get the number of elements contained in the memory store
- *
+ * <p>
* @return Element count
*/
public int getSize();
/**
* Returns the historical and statistical data for a region's memory cache.
- *
+ * <p>
* @return Statistics and Infor for the Memory Cache.
*/
public IStats getStatistics();
@@ -69,15 +64,14 @@
* 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.
- *
+ * <p>
* @return An iterator
- *
*/
public Iterator getIterator();
/**
* Get an Array of the keys for all elements in the memory cache.
- *
+ * <p>
* @return Object[]
* @TODO This should probably be done in chunks with a range pased in. This
* will be a problem if someone puts a 1,000,000 or so items in a
@@ -87,7 +81,7 @@
/**
* Removes an item from the cache
- *
+ * <p>
* @param key
* Identifies item to be removed
* @return Description of the Return Value
@@ -99,7 +93,7 @@
/**
* Removes all cached items from the cache.
- *
+ * <p>
* @exception IOException
* Description of the Exception
*/
@@ -108,7 +102,7 @@
/**
* Get an item from the cache
- *
+ * <p>
* @param key
* Description of the Parameter
* @return Description of the Return Value
@@ -121,7 +115,7 @@
/**
* Get an item from the cache without effecting its order or last access
* time
- *
+ * <p>
* @param key
* Description of the Parameter
* @return The quiet value
@@ -133,7 +127,7 @@
/**
* Spools the item contained in the provided element to disk
- *
+ * <p>
* @param ce
* Description of the Parameter
* @exception IOException
@@ -144,7 +138,7 @@
/**
* Puts an item to the cache.
- *
+ * <p>
* @param ce
* Description of the Parameter
* @exception IOException
@@ -155,29 +149,29 @@
/**
* Returns the CacheAttributes for the region.
- *
+ * <p>
* @return The cacheAttributes value
*/
public ICompositeCacheAttributes getCacheAttributes();
/**
* Sets the CacheAttributes of the region.
- *
+ * <p>
* @param cattr
* The new cacheAttributes value
*/
public void setCacheAttributes( ICompositeCacheAttributes cattr );
/**
- * Gets the cache hub / region taht the MemoryCache is used by
- *
+ * Gets the cache hub / region that uses the MemoryCache.
+ * <p>
* @return The cache value
*/
public CompositeCache getCompositeCache();
/**
- * Gets the set of keys of objects currently in the group
- *
+ * Gets the set of keys of objects currently in the group.
+ * <p>
* @param group
* @return a Set of group keys.
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java?rev=421965&r1=421964&r2=421965&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java Fri Jul 14 10:49:13 2006
@@ -1,40 +1,42 @@
package org.apache.jcs.utils.access;
/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License") you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
+ * Copyright 2002-2004 The Apache Software Foundation. Licensed under the Apache
+ * License, Version 2.0 (the "License") you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
*/
/**
+ * This is an abstract template for JCSWorkerHelper implementations. it simple
+ * has a convenience method for setting the finished flag.
+ * <p>
* @author tsavo
- *
*/
-public abstract class AbstractJCSWorkerHelper implements JCSWorkerHelper {
- private boolean finished = false;
- /**
- *
- */
- public AbstractJCSWorkerHelper() {
- super();
- // TODO Auto-generated constructor stub
- }
+public abstract class AbstractJCSWorkerHelper
+ implements JCSWorkerHelper
+{
+ private boolean finished = false;
- public boolean isFinished(){
- return finished;
- }
-
- public void setFinished(boolean isFinished){
- finished = isFinished;
- }
+ /**
+ * Default
+ */
+ public AbstractJCSWorkerHelper()
+ {
+ super();
+ }
+
+ public boolean isFinished()
+ {
+ return finished;
+ }
+
+ public void setFinished( boolean isFinished )
+ {
+ finished = isFinished;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org