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/06/23 21:54:28 UTC
svn commit: r416809 [2/3] - in /jakarta/jcs/trunk/src:
java/org/apache/jcs/access/ java/org/apache/jcs/access/behavior/
java/org/apache/jcs/access/exception/ java/org/apache/jcs/access/monitor/
java/org/apache/jcs/admin/ java/org/apache/jcs/admin/servl...
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=416809&r1=416808&r2=416809&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 Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.BufferedInputStream;
@@ -27,14 +22,12 @@
import java.io.RandomAccessFile;
import java.io.Serializable;
-import org.apache.jcs.engine.CacheElement;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.CacheElement;
/**
* Provides thread safe access to the underlying random access file.
- *
*/
class IndexedDisk
{
@@ -46,11 +39,11 @@
/**
* Constructor for the Disk object
- *
+ * <p>
* @param file
* @exception FileNotFoundException
*/
- IndexedDisk( File file )
+ public IndexedDisk( File file )
throws FileNotFoundException
{
this.filepath = file.getAbsolutePath();
@@ -63,12 +56,12 @@
* The firt four bytes of the record should tell us how long it is. The data
* is read into a byte array and then an object is constructed from the byte
* array.
- *
+ * <p>
* @return Serializable
* @param pos
* @throws IOException
*/
- Serializable readObject( long pos )
+ protected Serializable readObject( long pos )
throws IOException
{
String message = null;
@@ -102,7 +95,7 @@
{
log.warn( "\n The dataFile is corrupted!" + "\n " + message + "\n raf.length() = " + raf.length()
+ "\n pos = " + pos );
- //reset();
+ // reset();
throw new IOException( "The Data File Is Corrupt, need to reset" );
// return null;
}
@@ -131,11 +124,11 @@
/**
* Appends byte array to the Disk.
- *
+ * <p>
* @return
* @param data
*/
- boolean append( byte[] data )
+ protected boolean append( byte[] data )
{
try
{
@@ -153,12 +146,12 @@
/**
* Writes the given byte array to the Disk at the specified position.
- *
- * @return
+ * <p>
* @param data
* @param pos
+ * @return true if we wrote successfully
*/
- boolean write( byte[] data, long pos )
+ protected boolean write( byte[] data, long pos )
{
if ( log.isDebugEnabled() )
{
@@ -177,19 +170,19 @@
}
catch ( IOException ex )
{
- ex.printStackTrace();
+ log.error( "Problem writing object to disk.", ex );
}
return false;
}
/**
- * Description of the Method
- *
+ * Serializes the object and write it out to the given position.
+ * <p>
* @return
* @param obj
* @param pos
*/
- boolean writeObject( Serializable obj, long pos )
+ protected boolean writeObject( Serializable obj, long pos )
{
try
{
@@ -197,24 +190,23 @@
}
catch ( IOException ex )
{
- ex.printStackTrace();
+ log.error( "Problem writing object to disk.", ex );
}
return false;
}
/**
- * Description of the Method
- *
+ * Writes an object to the end of the file.
+ * <p>
* @return
* @param obj
*/
- IndexedDiskElementDescriptor appendObject( CacheElement obj )
+ protected IndexedDiskElementDescriptor appendObject( CacheElement obj )
{
long pos = -1;
boolean success = false;
try
{
-
IndexedDiskElementDescriptor ded = new IndexedDiskElementDescriptor();
byte[] data = serialize( obj );
@@ -224,23 +216,23 @@
ded.init( pos, data );
success = write( data, pos );
}
- //return success ? new DiskElement(pos, data) : null;
+ // return success ? new DiskElement(pos, data) : null;
return success ? ded : null;
}
catch ( IOException ex )
{
- ex.printStackTrace();
+ log.error( "Problem writing object to disk.", ex );
}
return null;
}
/**
* Returns the raf length.
- *
+ * <p>
* @return
* @exception IOException
*/
- long length()
+ protected long length()
throws IOException
{
synchronized ( this )
@@ -251,10 +243,10 @@
/**
* Closes the raf.
- *
+ * <p>
* @exception IOException
*/
- synchronized void close()
+ protected synchronized void close()
throws IOException
{
raf.close();
@@ -262,13 +254,12 @@
/**
* Sets the raf to empty.
- *
+ * <p>
* @exception IOException
*/
- synchronized void reset()
+ protected synchronized void reset()
throws IOException
{
-
log.warn( "Resetting data file" );
raf.close();
File f = new File( filepath );
@@ -296,12 +287,14 @@
/**
* Returns the serialized form of the given object in a byte array.
- *
- * @return
+ * <p>
+ * Use the Serilizer abstraction layer.
+ * <p>
+ * @return a byte array of the serialized object.
* @param obj
* @exception IOException
*/
- static byte[] serialize( Serializable obj )
+ protected static byte[] serialize( Serializable obj )
throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.File;
@@ -47,12 +42,9 @@
import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
/**
- * Disk cache that uses a RandomAccessFile with keys stored in memory.
- *
- * The maximum number of keys stored in memory is configurable.
- *
- * The disk cache tries to recycle spots on disk to limit file expansion.
- *
+ * Disk cache that uses a RandomAccessFile with keys stored in memory. The
+ * maximum number of keys stored in memory is configurable. The disk cache tries
+ * to recycle spots on disk to limit file expansion.
* @version $Id$
*/
public class IndexedDiskCache
@@ -103,7 +95,6 @@
/**
* Constructor for the DiskCache object
- *
* @param cattr
*/
public IndexedDiskCache( IndexedDiskCacheAttributes cattr )
@@ -188,7 +179,6 @@
/**
* Loads the keys from the .key file. The keys are stored in a HashMap on
* disk. This is converted into a LRUMap.
- *
* @throws InterruptedException
*/
protected void loadKeys()
@@ -255,7 +245,6 @@
* <p>
* The caller should take the appropriate action if the keys and data are
* not consistent.
- *
* @return True if the test passes
*/
private boolean checkKeyDataConsistency()
@@ -341,13 +330,12 @@
* Update the disk cache. Called from the Queue. Makes sure the Item has not
* been retireved from purgatory while in queue for disk. Remove items from
* purgatory when they go to disk.
- *
+ * <p>
* @param ce
* The ICacheElement to put to disk.
*/
public void doUpdate( ICacheElement ce )
{
-
if ( log.isDebugEnabled() )
{
log.debug( "Storing element on disk, key: " + ce.getKey() );
@@ -409,7 +397,6 @@
{
log.debug( "no ded to recycle" );
}
-
}
}
}
@@ -423,7 +410,6 @@
log.debug( "added to optimizing put list." + optimizingPutList.size() );
}
}
-
}
finally
{
@@ -460,14 +446,12 @@
*/
protected ICacheElement doGet( Serializable key )
{
-
if ( log.isDebugEnabled() )
{
log.debug( "Trying to get from disk: " + key );
}
ICacheElement object = null;
-
try
{
storageLock.readLock().acquire();
@@ -502,7 +486,7 @@
/**
* Reads the item from disk.
- *
+ * <p>
* @param key
* @return
* @throws IOException
@@ -539,6 +523,11 @@
return object;
}
+ /**
+ * Gets the group keys from the disk.
+ * <p>
+ * @see org.apache.jcs.auxiliary.AuxiliaryCache#getGroupKeys(java.lang.String)
+ */
public Set getGroupKeys( String groupName )
{
GroupId groupId = new GroupId( cacheName, groupName );
@@ -573,13 +562,12 @@
/**
* Returns true if the removal was succesful; or false if there is nothing
* to remove. Current implementation always result in a disk orphan.
- *
+ * <p>
* @return
* @param key
*/
public boolean doRemove( Serializable key )
{
-
optCnt++;
if ( !this.isOptomizing && optCnt == this.cattr.getOptimizeAtRemoveCount() )
{
@@ -655,7 +643,6 @@
}
}
}
-
iter.remove();
removed = true;
}
@@ -800,7 +787,6 @@
/**
* Create the map for keys that contain the index position on disk.
- *
*/
private void initKeyMap()
{
@@ -827,7 +813,7 @@
/**
* Dispose of the disk cache in a background thread. Joins against this
* thread to put a cap on the disposal time.
- *
+ * <p>
* @todo make dispose window configurable.
*/
public void doDispose()
@@ -939,9 +925,7 @@
private int timesOptimized = 0;
/**
- * Realtime optimization is handled by this method.
- *
- * It works in this way:
+ * Realtime optimization is handled by this method. It works in this way:
* <ul>
* <li>1. Lock the active file, create a new file.</li>
* <li>2. Copy the keys for iteration.</li>
@@ -954,11 +938,9 @@
* <li>5. All gets will be serviced by the new file. </li>
* <li>6. All puts are made on the new file.</li>
* </ul>
- *
*/
protected void optimizeRealTime()
{
-
long start = System.currentTimeMillis();
if ( log.isInfoEnabled() )
{
@@ -1044,7 +1026,6 @@
{
storageLock.writeLock().release();
}
-
}
catch ( Exception e )
{
@@ -1059,7 +1040,6 @@
{
log.info( "Finished #" + timesOptimized + " Real Time Optimization in " + time + " millis." );
}
-
}
/**
@@ -1089,7 +1069,6 @@
try
{
-
// while ( itr.hasNext() )
for ( int i = 0; i < len; i++ )
{
@@ -1100,13 +1079,11 @@
// main
tempToPrimary( keyHashTemp, dataFileTemp );
-
}
catch ( IOException e )
{
log.error( "Problem in optimization, abandoning attempt" );
}
-
}
catch ( Exception e )
{
@@ -1117,7 +1094,7 @@
/**
* Copies data for a key from main file to temp file and key to temp keyhash
* Clients must manage locking.
- *
+ * <p>
* @param key
* Serializable
* @param keyHashTemp
@@ -1128,7 +1105,6 @@
private void moveKeyDataToTemp( Serializable key, LRUMap keyHashTemp, IndexedDisk dataFileTemp )
throws Exception
{
-
ICacheElement tempDe = null;
try
{
@@ -1169,13 +1145,11 @@
log.debug( fileName + " -- keyHashTemp.size(): " + keyHashTemp.size() + ", keyHash.size(): "
+ keyHash.size() );
}
-
}
/**
* Replaces current keyHash, data file, and recylce bin. Temp file passed in
* must follow Temp.data naming convention.
- *
* @param keyHashTemp
* LRUMap
* @param dataFileTemp
@@ -1183,7 +1157,6 @@
*/
private void tempToPrimary( LRUMap keyHashTemp, IndexedDisk dataFileTemp )
{
-
try
{
// Make dataFileTemp to become dataFile on disk.
@@ -1232,14 +1205,13 @@
{
log.error( "Failed to put to temp disk cache", e );
}
-
}
// /////////////////////////////////////////////////////////////////////////////
// DEBUG
/**
* Returns the current cache size.
- *
+ * <p>
* @return The size value
*/
public int getSize()
@@ -1249,7 +1221,7 @@
/**
* This is for debugging and testing.
- *
+ * <p>
* @return the length of the data file.
* @throws IOException
*/
@@ -1261,7 +1233,6 @@
try
{
storageLock.readLock().acquire();
-
try
{
if ( dataFile != null )
@@ -1278,7 +1249,6 @@
{
// nothing
}
-
return size;
}
@@ -1287,6 +1257,8 @@
*/
public void dump()
{
+ if ( log.isDebugEnabled() )
+ {
log.debug( "[dump] Number of keys: " + keyHash.size() );
Iterator itr = keyHash.entrySet().iterator();
@@ -1303,11 +1275,12 @@
log.debug( "[dump] Disk element, key: " + key + ", val: " + val + ", pos: " + ded.pos );
}
+ }
}
/**
* Gets basic stats for the disk cache.
- *
+ * <p>
* @return String
*/
public String getStats()
@@ -1317,7 +1290,6 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.auxiliary.AuxiliaryCache#getStatistics()
*/
public IStats getStatistics()
@@ -1407,7 +1379,6 @@
public class LRUMap
extends LRUMapJCS
{
-
private static final long serialVersionUID = 4955079991472142198L;
/**
@@ -1433,7 +1404,6 @@
protected void processRemovedLRU( Object key, Object value )
{
-
if ( doRecycle )
{
// reuse the spot
@@ -1453,20 +1423,17 @@
log.debug( "Removing key: '" + key + "' from key store." );
log.debug( "Key store size: '" + this.size() + "'." );
}
-
}
}
/**
* Called on shutdown
- *
+ * <p>
* @author Aaron Smuts
- *
*/
class ShutdownHook
extends Thread
{
-
public void run()
{
if ( alive )
@@ -1476,6 +1443,5 @@
doDispose();
}
}
-
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.auxiliary.AuxiliaryCacheAttributes;
@@ -21,22 +16,19 @@
/**
* Configuration class for the Indexed Disk Cache
- *
*/
public class IndexedDiskCacheAttributes
extends AbstractDiskCacheAttributes
{
-
private static final long serialVersionUID = -2190863599358782950L;
private static final int DEFAULT_maxKeySize = 5000;
/** -1 means no limit. */
private int maxKeySize = DEFAULT_maxKeySize;
-
private static final int DEFAULT_maxRecycleBinSize = 5000;
-
+
/**
* Cannot be larger than the max size. If max is less than 0, this will be
* 5000
@@ -45,7 +37,7 @@
// default to -1, i.e., don't optimize until shutdown
private int optimizeAtRemoveCount = -1;
-
+
/**
* Constructor for the DiskCacheAttributes object
*/
@@ -56,7 +48,7 @@
/**
* Gets the maxKeySize attribute of the DiskCacheAttributes object
- *
+ * <p>
* @return The maxKeySize value
*/
public int getMaxKeySize()
@@ -66,7 +58,7 @@
/**
* Sets the maxKeySize attribute of the DiskCacheAttributes object
- *
+ * <p>
* @param maxKeySize
* The new maxKeySize value
*/
@@ -81,7 +73,7 @@
/**
* Gets the optimizeAtRemoveCount attribute of the DiskCacheAttributes
* object
- *
+ * <p>
* @return The optimizeAtRemoveCount value
*/
public int getOptimizeAtRemoveCount()
@@ -93,7 +85,7 @@
* Sets the optimizeAtRemoveCount attribute of the DiskCacheAttributes
* object This number determines how often the disk cache should run real
* time optimizations.
- *
+ * <p>
* @param cnt
* The new optimizeAtRemoveCount value
*/
@@ -106,9 +98,9 @@
* This cannot be larger than the maxKeySize. It wouldn't hurt anything, but
* it makes the config necessary. The recycle bin entry willbe at least as
* large as a key.
- *
+ * <p>
* If the maxKeySize is -1 this will be set tot he default, which is 5000.
- *
+ * <p>
* @param maxRecycleBinSize
* The maxRecycleBinSize to set.
*/
@@ -124,10 +116,10 @@
{
return maxRecycleBinSize;
}
-
+
/**
* Returns a copy of the attributes.
- *
+ * <p>
* @return AuxiliaryCacheAttributes
*/
public AuxiliaryCacheAttributes copy()
@@ -142,10 +134,10 @@
}
return this;
}
-
+
/**
- * Description of the Method
- *
+ * Write out the values for debugging purposes.
+ * <p>
* @return String
*/
public String toString()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheFactory.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheFactory.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.commons.logging.Log;
@@ -24,7 +19,7 @@
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
/**
- * @version 1.0
+ * Creates disk cache instances.
*/
public class IndexedDiskCacheFactory
implements AuxiliaryCacheFactory
@@ -40,14 +35,12 @@
* The manager is a singleton.
* <p>
* One disk cache is returned per region fromt he maanger.
- *
+ * <p>
* @param iaca
- *
* @param cacheMgr
* This allows auxiliaries to reference the manager without
* assuming that it is a singleton. This will allow JCS to be a
* nonsingleton. Also, it makes it easier to test.
- *
* @return AuxiliaryCache
*/
public AuxiliaryCache createCache( AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr )
@@ -63,7 +56,7 @@
/**
* Gets the name attribute of the DiskCacheFactory object
- *
+ * <p>
* @return The name value
*/
public String getName()
@@ -73,7 +66,7 @@
/**
* Sets the name attribute of the DiskCacheFactory object
- *
+ * <p>
* @param name
* The new name value
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java Fri Jun 23 12:54:25 2006
@@ -1,35 +1,28 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.Enumeration;
+import java.util.Hashtable;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
import org.apache.jcs.engine.behavior.ICache;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
/**
- * Cache manager for IndexedDiskCaches.
- *
- * @version $Id: IndexedDiskCacheManager.java,v 1.7 2005/01/29 00:40:02 asmuts
- * Exp $
+ * Cache manager for IndexedDiskCaches. This manages the instances of the disk
+ * cache.
*/
public class IndexedDiskCacheManager
implements AuxiliaryCacheManager
@@ -48,7 +41,7 @@
/**
* Constructor for the IndexedDiskCacheManager object
- *
+ * <p>
* @param defaultCacheAttributes
* Default attributes for caches managed by the instance.
*/
@@ -59,7 +52,7 @@
/**
* Gets the singleton instance of the manager
- *
+ * <p>
* @param defaultCacheAttributes
* If the instance has not yet been created, it will be
* initialized with this set of default attributes.
@@ -83,7 +76,7 @@
/**
* Gets an IndexedDiskCache for the supplied name using the default
* attributes.
- *
+ * <p>
* @param cacheName
* Name that will be used when creating attributes.
* @return A cache.
@@ -101,11 +94,10 @@
* Get an IndexedDiskCache for the supplied attributes. Will provide an
* existing cache for the name attribute if one has been created, or will
* create a new cache.
- *
+ * <p>
* @param cacheAttributes
* Attributes the cache should have.
* @return A cache, either from the existing set or newly created.
- *
*/
public AuxiliaryCache getCache( IndexedDiskCacheAttributes cacheAttributes )
{
@@ -139,7 +131,7 @@
/**
* Disposes the cache with the given name, if found in the set of managed
* caches.
- *
+ * <p>
* @param cacheName
* Name of cache to dispose.
*/
@@ -162,7 +154,7 @@
/**
* Gets the cacheType attribute of the DiskCacheManager object
- *
+ * <p>
* @return The cacheType value
*/
public int getCacheType()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java Fri Jun 23 12:54:25 2006
@@ -1,30 +1,28 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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.
*/
/**
- * Used to dump out a Disk cache from disk for debugging.
- *
+ * Used to dump out a Disk cache from disk for debugging. This is meant to be
+ * run as a comman line utility for
*/
public class IndexedDiskDumper
{
/**
* The main program for the DiskDumper class
- *
+ * <p>
+ * Creates a disk cache and then calls dump, which write out the contents to
+ * a debug log.
+ * <p>
* @param args
* The command line arguments
*/
@@ -41,8 +39,8 @@
attr.setCacheName( args[0] );
attr.setDiskPath( args[0] );
- final IndexedDiskCache rc = new IndexedDiskCache( attr );
- rc.dump();
+ final IndexedDiskCache dc = new IndexedDiskCache( attr );
+ dc.dump();
System.exit( 0 );
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.indexed;
/*
- * 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;
@@ -21,7 +16,6 @@
/**
* Disk objects are located by descriptor entries. These are saved on shutdown
* and loaded into memory on startup.
- *
*/
public class IndexedDiskElementDescriptor
implements Serializable, Comparable
@@ -36,8 +30,8 @@
public int len;
/**
- * Description of the Method
- *
+ * Set the offset (i.e. position, and the size of the element)
+ * <p>
* @param pos
* @param data
*/
@@ -45,7 +39,6 @@
{
this.pos = pos;
this.len = data.length;
- // this.hash = hashCode(data);
}
/** Constructor for the DiskElementDescriptor object */
@@ -64,8 +57,8 @@
}
/**
- * compareTo
- *
+ * Compares based on length.
+ * <p>
* @param o
* Object
* @return int
@@ -92,5 +85,4 @@
}
return 0;
}
-
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.jdbc;
/*
- * 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;
@@ -52,35 +47,34 @@
* <p>
* It expects a table created by the following script. The table name is
* configurable.
+ * <p>
*
* <pre>
- * drop TABLE JCS_STORE;
- *
- * CREATE TABLE JCS_STORE
- * (
- * CACHE_KEY VARCHAR(250) NOT NULL,
- * REGION VARCHAR(250) NOT NULL,
- * ELEMENT BLOB,
- * CREATE_TIME DATE,
- * CREATE_TIME_SECONDS BIGINT,
- * MAX_LIFE_SECONDS BIGINT,
- * SYSTEM_EXPIRE_TIME_SECONDS BIGINT,
- * IS_ETERNAL CHAR(1),
- * PRIMARY KEY (CACHE_KEY, REGION)
- * );
+ * drop TABLE JCS_STORE;
+ *
+ * CREATE TABLE JCS_STORE
+ * (
+ * CACHE_KEY VARCHAR(250) NOT NULL,
+ * REGION VARCHAR(250) NOT NULL,
+ * ELEMENT BLOB,
+ * CREATE_TIME DATE,
+ * CREATE_TIME_SECONDS BIGINT,
+ * MAX_LIFE_SECONDS BIGINT,
+ * SYSTEM_EXPIRE_TIME_SECONDS BIGINT,
+ * IS_ETERNAL CHAR(1),
+ * PRIMARY KEY (CACHE_KEY, REGION)
+ * );
* </pre>
*
- *
+ * <p>
* The cleanup thread will delete non eternal items where (now - create time) >
* max life seconds * 1000
* <p>
* To speed up the deletion the SYSTEM_EXPIRE_TIME_SECONDS is used instead. It
* is recommended that an index be created on this column is you will have over
* a million records.
- *
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class JDBCDiskCache
extends AbstractDiskCache
@@ -107,7 +101,6 @@
private static final int LOG_INTERVAL = 100;
/**
- *
* @param cattr
*/
public JDBCDiskCache( JDBCDiskCacheAttributes cattr )
@@ -153,12 +146,10 @@
/*
* (non-Javadoc)
- *
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doUpdate(org.apache.jcs.engine.behavior.ICacheElement)
*/
public void doUpdate( ICacheElement ce )
{
-
incrementUpdateCount();
if ( log.isDebugEnabled() )
@@ -240,7 +231,6 @@
// If it doesn't exist, insert it, otherwise update
if ( !exists )
{
-
try
{
String sqlI = "insert into "
@@ -355,9 +345,9 @@
/**
* Does an element exist for this key?
- *
+ * <p>
* @param ce
- * @return
+ * @return boolean
*/
protected boolean doesElementExist( ICacheElement ce )
{
@@ -430,14 +420,14 @@
return exists;
}
- /*
- * (non-Javadoc)
- *
+ /**
+ * Queries the database for the value. If it gets a result, the value is
+ * deserialized.
+ * <p>
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doGet(java.io.Serializable)
*/
public ICacheElement doGet( Serializable key )
{
-
incrementGetCount();
if ( log.isDebugEnabled() )
@@ -483,7 +473,6 @@
{
// USE THE SERIALIZER
obj = (ICacheElement) getElementSerializer().deSerialize( data );
-
}
catch ( IOException ioe )
{
@@ -541,7 +530,7 @@
/**
* Returns true if the removal was succesful; or false if there is nothing
* to remove. Current implementation always result in a disk orphan.
- *
+ * <p>
* @param key
* @return boolean
*/
@@ -654,12 +643,9 @@
}
/**
- * Removed the expired.
- *
- * (now - create time) > max life seconds * 1000
- *
+ * Removed the expired. (now - create time) > max life seconds * 1000
+ * <p>
* @return the number deleted
- *
*/
protected int deleteExpired()
{
@@ -740,8 +726,8 @@
}
/**
- * Returns the current cache size.
- *
+ * Returns the current cache size. Just does a count(*) for the region.
+ * <p>
* @return The size value
*/
public int getSize()
@@ -817,7 +803,7 @@
/**
* Returns the serialized form of the given object in a byte array.
- *
+ * <p>
* @param obj
* @return byte[]
* @throws IOException
@@ -831,7 +817,6 @@
/**
* @param groupName
* @return
- *
*/
public Set getGroupKeys( String groupName )
{
@@ -860,7 +845,6 @@
}
/**
- *
* @param connectURI
* @param userName
* @param password
@@ -910,7 +894,6 @@
}
/**
- *
* @throws Exception
*/
public void logDriverStats()
@@ -940,7 +923,6 @@
/**
* How many are idle in the pool.
- *
* @return
*/
public int getNumIdleInPool()
@@ -966,7 +948,6 @@
/**
* How many are active in the pool.
- *
* @return
*/
public int getNumActiveInPool()
@@ -991,7 +972,6 @@
}
/**
- *
* @throws Exception
*/
public void shutdownDriver()
@@ -1110,10 +1090,10 @@
return stats;
}
-
+
/**
* Returns the name of the table.
- *
+ * <p>
* @return the table name or UNDEFINED
*/
protected String getTableName()
@@ -1121,17 +1101,16 @@
String name = "UNDEFINED";
if ( this.getJdbcDiskCacheAttributes() != null )
{
- name = this.getJdbcDiskCacheAttributes() .getTableName();
+ name = this.getJdbcDiskCacheAttributes().getTableName();
}
return name;
}
-
-
+
/**
* For debugging.
*/
public String toString()
{
- return this.getStats();
- }
+ return this.getStats();
+ }
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.jdbc;
/*
- * 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.auxiliary.disk.AbstractDiskCacheAttributes;
@@ -21,9 +16,8 @@
/**
* The configurator will set these values based on what is in the cache.ccf
* file.
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class JDBCDiskCacheAttributes
extends AbstractDiskCacheAttributes
@@ -109,7 +103,6 @@
/**
* This is appended to the url.
- *
* @param database
* The database to set.
*/
@@ -164,7 +157,6 @@
* If this is true then the disk cache will check to see if the item already
* exists in the database. If it is false, it will try to insert. If the
* isnert fails it will try to update.
- *
* @param testBeforeInsert
* The testBeforeInsert to set.
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.jdbc;
/*
- * 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.auxiliary.AuxiliaryCache;
@@ -23,9 +18,8 @@
/**
* This factory should create mysql disk caches.
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class JDBCDiskCacheFactory
implements AuxiliaryCacheFactory
@@ -37,8 +31,8 @@
*/
public AuxiliaryCache createCache( AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager arg1 )
{
- JDBCDiskCacheManager mgr = JDBCDiskCacheManager.getInstance( (JDBCDiskCacheAttributes)rawAttr );
- return mgr.getCache( (JDBCDiskCacheAttributes)rawAttr );
+ JDBCDiskCacheManager mgr = JDBCDiskCacheManager.getInstance( (JDBCDiskCacheAttributes) rawAttr );
+ return mgr.getCache( (JDBCDiskCacheAttributes) rawAttr );
}
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.jdbc;
/*
- * 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.Enumeration;
@@ -32,7 +27,6 @@
* This manages instances of the jdbc disk cache. It maintains one for each
* region. One for all regions would work, but this gives us more detailed stats
* by region.
- *
*/
public class JDBCDiskCacheManager
implements AuxiliaryCacheManager
@@ -63,7 +57,7 @@
/**
* Constructor for the HSQLCacheManager object
- *
+ * <p>
* @param cattr
*/
private JDBCDiskCacheManager( JDBCDiskCacheAttributes cattr )
@@ -77,7 +71,7 @@
/**
* Gets the defaultCattr attribute of the HSQLCacheManager object
- *
+ * <p>
* @return The defaultCattr value
*/
public JDBCDiskCacheAttributes getDefaultCattr()
@@ -87,9 +81,8 @@
/**
* Gets the instance attribute of the HSQLCacheManager class
- *
+ * <p>
* @param cattr
- *
* @return The instance value
*/
public static JDBCDiskCacheManager getInstance( JDBCDiskCacheAttributes cattr )
@@ -108,9 +101,8 @@
/**
* Gets the cache attribute of the HSQLCacheManager object
- *
+ * <p>
* @param cacheName
- *
* @return The cache value
*/
public AuxiliaryCache getCache( String cacheName )
@@ -122,9 +114,8 @@
/**
* Gets the cache attribute of the HSQLCacheManager object
- *
+ * <p>
* @param cattr
- *
* @return The cache value
*/
public AuxiliaryCache getCache( JDBCDiskCacheAttributes cattr )
@@ -179,7 +170,6 @@
}
/**
- *
* @param name
*/
public void freeCache( String name )
@@ -193,7 +183,7 @@
/**
* Gets the cacheType attribute of the HSQLCacheManager object
- *
+ * <p>
* @return The cacheType value
*/
public int getCacheType()
@@ -226,16 +216,14 @@
/**
* Allows us to set the daemon status on the clockdaemon
- *
+ * <p>
* @author aaronsm
- *
*/
class MyThreadFactory
implements ThreadFactory
{
/*
* (non-Javadoc)
- *
* @see EDU.oswego.cs.dl.util.concurrent.ThreadFactory#newThread(java.lang.Runnable)
*/
public Thread newThread( Runnable runner )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java Fri Jun 23 12:54:25 2006
@@ -10,9 +10,8 @@
/**
* Calls delete expired on the disk caches. The shrinker is run by a clock
* daemon. The shrinker calls delete on each region. It pauses between calls.
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class ShrinkerThread
implements Runnable
@@ -33,7 +32,7 @@
/**
* Does nothing special.
- *
+ * <p>
* @param diskCache
*/
protected ShrinkerThread()
@@ -43,7 +42,7 @@
/**
* Adds a JDBC disk cache to the set of disk cache to shrink.
- *
+ * <p>
* @param diskCache
*/
public void addDiskCacheToShrinkList( JDBCDiskCache diskCache )
@@ -113,7 +112,7 @@
/**
* How long should we wait between calls to deleteExpired when we are
* iterating through the list of regions.
- *
+ * <p>
* @param pauseBetweenRegionCallsMillis
* The pauseBetweenRegionCallsMillis to set.
*/
@@ -125,7 +124,7 @@
/**
* How long should we wait between calls to deleteExpired when we are
* iterating through the list of regions.
- *
+ * <p>
* @return Returns the pauseBetweenRegionCallsMillis.
*/
public long getPauseBetweenRegionCallsMillis()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.disk.jdbc.hsql;
/*
- * 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.sql.Connection;
@@ -35,9 +30,8 @@
/**
* This factory should create mysql disk caches.
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class HSQLDiskCacheFactory
implements AuxiliaryCacheFactory
@@ -53,9 +47,7 @@
*/
public AuxiliaryCache createCache( AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager arg1 )
{
-
JDBCDiskCacheManager mgr = JDBCDiskCacheManager.getInstance( (JDBCDiskCacheAttributes) rawAttr );
-
try
{
setupDatabase( (JDBCDiskCacheAttributes) rawAttr );
@@ -65,7 +57,6 @@
// TODO we may not want to try and get the cache at this point.
log.error( "Problem setting up database.", e );
}
-
return mgr.getCache( (JDBCDiskCacheAttributes) rawAttr );
}
@@ -88,14 +79,13 @@
/**
* Creates the database if it doesn't exist, registers the driver class,
* etc.
- *
+ * <p>
* @param attributes
* @throws Exception
*/
protected void setupDatabase( JDBCDiskCacheAttributes attributes )
throws Exception
{
-
if ( attributes == null )
{
throw new Exception( "The attributes are null." );
@@ -147,7 +137,7 @@
/**
* SETUP TABLE FOR CACHE
- *
+ * <p>
* @param cConn
* @param tableName
*/
@@ -165,7 +155,7 @@
createSql.append( "CREATE_TIME DATE, " );
createSql.append( "CREATE_TIME_SECONDS BIGINT, " );
createSql.append( "MAX_LIFE_SECONDS BIGINT, " );
- createSql.append( "SYSTEM_EXPIRE_TIME_SECONDS BIGINT, " );
+ createSql.append( "SYSTEM_EXPIRE_TIME_SECONDS BIGINT, " );
createSql.append( "IS_ETERNAL CHAR(1), " );
createSql.append( "PRIMARY KEY (CACHE_KEY, REGION) " );
createSql.append( ");" );
@@ -197,7 +187,7 @@
}
}
- //TODO create an index on SYSTEM_EXPIRE_TIME_SECONDS
+ // TODO create an index on SYSTEM_EXPIRE_TIME_SECONDS
String setupData[] = { "create index iKEY on " + tableName + " (CACHE_KEY, REGION)" };
if ( newT )
@@ -213,6 +203,6 @@
log.error( "Exception caught when creating index." + e );
}
}
- } // end ifnew
+ }
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java Fri Jun 23 12:54:25 2006
@@ -23,7 +23,7 @@
/**
* This interface defines configuration options common to lateral cache
* plugins.
- *
+ * <p>
* TODO it needs to be trimmed down. The old version had features for
* every lateral. Now, the individual laterals have their own specific
* attributes interfaces.
@@ -60,7 +60,7 @@
/**
* Sets the httpServer attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new httpServer value
*/
@@ -68,7 +68,7 @@
/**
* Gets the httpServer attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The httpServer value
*/
public String getHttpServer();
@@ -76,7 +76,7 @@
/**
* Sets the httpListenerPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new tcpListenerPort value
*/
@@ -84,14 +84,14 @@
/**
* Gets the httpListenerPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The httpListenerPort value
*/
public int getHttpListenerPort();
/**
* Sets the httpServers attribute of the LateralCacheAttributes object
- *
+ * <p>
* @param val
* The new httpServers value
*/
@@ -99,15 +99,14 @@
/**
* Gets the httpSrvers attribute of the LateralCacheAttributes object
- *
+ * <p>
* @return The httpServers value
*/
public String getHttpServers();
- // configure udp multicast parameters
/**
* Sets the udpMulticastAddr attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new udpMulticastAddr value
*/
@@ -115,14 +114,14 @@
/**
* Gets the udpMulticastAddr attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The udpMulticastAddr value
*/
public String getUdpMulticastAddr();
/**
* Sets the udpMulticastPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new udpMulticastPort value
*/
@@ -130,14 +129,14 @@
/**
* Gets the udpMulticastPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The udpMulticastPort value
*/
public int getUdpMulticastPort();
/**
* Sets the transmissionType attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new transmissionType value
*/
@@ -145,7 +144,7 @@
/**
* Gets the transmissionType attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The transmissionType value
*/
public int getTransmissionType();
@@ -153,7 +152,7 @@
/**
* Sets the transmissionTypeName attribute of the ILateralCacheAttributes
* object
- *
+ * <p>
* @param val
* The new transmissionTypeName value
*/
@@ -162,7 +161,7 @@
/**
* Gets the transmissionTypeName attribute of the ILateralCacheAttributes
* object
- *
+ * <p>
* @return The transmissionTypeName value
*/
public String getTransmissionTypeName();
@@ -171,7 +170,7 @@
* Sets the putOnlyMode attribute of the ILateralCacheAttributes. When this
* is true the lateral cache will only issue put and remove order and will
* not try to retrieve elements from other lateral caches.
- *
+ * <p>
* @param val
* The new transmissionTypeName value
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.lateral.behavior;
/*
- * 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.ICacheListener;
@@ -21,12 +16,10 @@
/**
* Listens for lateral cache event notification.
- *
*/
public interface ILateralCacheListener
extends ICacheListener
{
-
/** Description of the Method */
public void init();
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java Fri Jun 23 12:54:25 2006
@@ -1,51 +1,59 @@
package org.apache.jcs.auxiliary.lateral.behavior;
+/*
+ * 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.util.Map;
import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
/**
- * This helps ensure some common behvior among LateraLCacheManagers
- * for things such as montiors.
- *
+ * This helps ensure some common behvior among LateraLCacheManagers for things
+ * such as montiors.
+ * <p>
* @author Aaron Smuts
- *
*/
-public interface ILateralCacheManager extends AuxiliaryCacheManager
+public interface ILateralCacheManager
+ extends AuxiliaryCacheManager
{
-
/**
- * This is a temporary solution that allos the monitor to get the instances of a manager.
- *
+ * This is a temporary solution that allos the monitor to get the instances
+ * of a manager.
* @return
*/
public abstract Map getInstances();
-
-
+
/**
- * This is a temporary solution that allos the monitor to get caches from an instance of a manager.
- *
+ * This is a temporary solution that allos the monitor to get caches from an
+ * instance of a manager.
* @return
*/
public abstract Map getCaches();
-
-
+
/**
* The restore calls thsi on the manger if a cache if found to be in error.
- *
* @return Object is the service if it can be fixed.
- * @throws IOException if the service cannot be fixed.
+ * @throws IOException
+ * if the service cannot be fixed.
*/
- public abstract Object fixService() throws IOException;
+ public abstract Object fixService()
+ throws IOException;
/**
- * Sets the corected service. The restore process will call this
- * if it gets a good service back from fixService.
- *
+ * Sets the corected service. The restore process will call this if it gets
+ * a good service back from fixService.
* @param lateralService
* @param lateralWatch
*/
public void fixCaches( ILateralCacheService lateralService, ILateralCacheObserver lateralWatch );
-
+
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheObserver.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheObserver.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheObserver.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheObserver.java Fri Jun 23 12:54:25 2006
@@ -1,26 +1,20 @@
package org.apache.jcs.auxiliary.lateral.behavior;
/*
- * 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.ICacheObserver;
/**
* Description of the Interface
- *
*/
public interface ILateralCacheObserver
extends ICacheObserver
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheService.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheService.java Fri Jun 23 12:54:25 2006
@@ -1,19 +1,14 @@
package org.apache.jcs.auxiliary.lateral.behavior;
/*
- * 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;
@@ -25,13 +20,14 @@
/**
* Used to retrieve and update the lateral cache.
- *
*/
public interface ILateralCacheService
extends ICacheService
{
- /** Puts a cache item to the cache.
+ /**
+ * Puts a cache item to the cache.
+ * <p>
* @param item
* @param requesterId
* @throws IOException
@@ -39,7 +35,9 @@
public void update( ICacheElement item, long requesterId )
throws IOException;
- /** Removes the given key from the specified cache.
+ /**
+ * Removes the given key from the specified cache.
+ * <p>
* @param cacheName
* @param key
* @param requesterId
@@ -48,7 +46,9 @@
public void remove( String cacheName, Serializable key, long requesterId )
throws IOException;
- /** Remove all keys from the sepcified cache.
+ /**
+ * Remove all keys from the sepcified cache.
+ * <p>
* @param cacheName
* @param requesterId
* @throws IOException
@@ -57,7 +57,6 @@
throws IOException;
/**
- *
* @param cacheName
* @param groupName
* @return
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java Fri Jun 23 12:54:25 2006
@@ -1,37 +1,31 @@
package org.apache.jcs.auxiliary.lateral.socket.tcp.behavior;
/*
- * 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.auxiliary.lateral.behavior.ILateralCacheAttributes;
/**
- * This interface defines functions that are particular to the
- * TCP Lateral Cache plugin. It extends the generic LateralCacheAttributes interface
- * which in turn extends the AuxiliaryCache interface.
- *
+ * This interface defines functions that are particular to the TCP Lateral Cache
+ * plugin. It extends the generic LateralCacheAttributes interface which in turn
+ * extends the AuxiliaryCache interface.
+ * <p>
* @author Aaron Smuts
*/
public interface ITCPLateralCacheAttributes
extends ILateralCacheAttributes
{
-
/**
* Sets the tcpServer attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new tcpServer value
*/
@@ -39,14 +33,14 @@
/**
* Gets the tcpServer attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The tcpServer value
*/
public String getTcpServer();
/**
* Sets the tcpServers attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new tcpServers value
*/
@@ -54,14 +48,14 @@
/**
* Gets the tcpServers attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The tcpServers value
*/
public String getTcpServers();
/**
* Sets the tcpListenerPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @param val
* The new tcpListenerPort value
*/
@@ -69,16 +63,16 @@
/**
* Gets the tcpListenerPort attribute of the ILateralCacheAttributes object
- *
+ * <p>
* @return The tcpListenerPort value
*/
public int getTcpListenerPort();
-
+
/**
* Can setup UDP Discovery. This only works for TCp laterals right now. It
* allows TCP laterals to find each other by broadcasting to a multicast
* port.
- *
+ * <p>
* @param udpDiscoveryEnabled
* The udpDiscoveryEnabled to set.
*/
@@ -87,21 +81,21 @@
/**
* Whether or not TCP laterals can try to find each other by multicast
* communication.
- *
+ * <p>
* @return Returns the udpDiscoveryEnabled.
*/
public boolean isUdpDiscoveryEnabled();
/**
* The port to use if UDPDiscovery is enabled.
- *
+ * <p>
* @return Returns the udpDiscoveryPort.
*/
public int getUdpDiscoveryPort();
/**
* Sets the port to use if UDPDiscovery is enabled.
- *
+ * <p>
* @param udpDiscoveryPort
* The udpDiscoveryPort to set.
*/
@@ -109,92 +103,89 @@
/**
* The address to broadcast to if UDPDiscovery is enabled.
- *
+ * <p>
* @return Returns the udpDiscoveryAddr.
*/
public String getUdpDiscoveryAddr();
/**
* Sets the address to broadcast to if UDPDiscovery is enabled.
- *
+ * <p>
* @param udpDiscoveryAddr
* The udpDiscoveryAddr to set.
*/
public void setUdpDiscoveryAddr( String udpDiscoveryAddr );
-
-
+
/**
* Is the lateral allowed to try and get from other laterals.
* <p>
* This replaces the old putOnlyMode
- *
+ * <p>
* @param allowGet
*/
public void setAllowGet( boolean allowGet );
-
+
/**
* Is the lateral allowed to try and get from other laterals.
- *
+ * <p>
* @return true if the lateral will try to get
*/
public boolean isAllowGet();
-
+
/**
* Is the lateral allowed to put objects to other laterals.
- *
+ * <p>
* @param allowPut
*/
public void setAllowPut( boolean allowPut );
-
+
/**
* Is the lateral allowed to put objects to other laterals.
- *
+ * <p>
* @return true if puts are allowed
*/
public boolean isAllowPut();
/**
- * Should the client send a remove command rather than a put when
- * update is called. This is a client option, not a receiver option.
- * This allows you to prevent the lateral from serializing objects.
- *
+ * Should the client send a remove command rather than a put when update is
+ * called. This is a client option, not a receiver option. This allows you
+ * to prevent the lateral from serializing objects.
+ * <p>
* @param issueRemoveOnPut
*/
public void setIssueRemoveOnPut( boolean issueRemoveOnPut );
-
+
/**
- * Should the client send a remove command rather than a put when
- * update is called. This is a client option, not a receiver option.
- * This allows you to prevent the lateral from serializing objects.
- *
+ * Should the client send a remove command rather than a put when update is
+ * called. This is a client option, not a receiver option. This allows you
+ * to prevent the lateral from serializing objects.
+ * <p>
* @return true if updates will result in a remove command being sent.
*/
public boolean isIssueRemoveOnPut();
-
/**
- * Should the receiver try to match hashcodes.
- * If true, the receiver will see if the client supplied a hshcode.
- * If it did, then it will try to get the item locally. If the item
- * exists, then it will compare the hashcode. if they are
- * the same, it will not remove. This isn't perfect since different objects can
- * have the same hashcode, but it is unlikely of objects of the same
- * type.
- *
- * @return
+ * Should the receiver try to match hashcodes. If true, the receiver will
+ * see if the client supplied a hshcode. If it did, then it will try to get
+ * the item locally. If the item exists, then it will compare the hashcode.
+ * if they are the same, it will not remove. This isn't perfect since
+ * different objects can have the same hashcode, but it is unlikely of
+ * objects of the same type.
+ * <p>
+ * @return boolean
*/
public boolean isFilterRemoveByHashCode();
-
+
/**
- * Should the receiver try to match hashcodes.
- * If true, the receiver will see if the client supplied a hshcode.
- * If it did, then it will try to get the item locally. If the item
- * exists, then it will compare the hashcode. if they are
- * the same, it will not remove. This isn't perfect since different objects can
- * have the same hashcode, but it is unlikely of objects of the same
- * type.
+ * Should the receiver try to match hashcodes. If true, the receiver will
+ * see if the client supplied a hshcode. If it did, then it will try to get
+ * the item locally. If the item exists, then it will compare the hashcode.
+ * if they are the same, it will not remove. This isn't perfect since
+ * different objects can have the same hashcode, but it is unlikely of
+ * objects of the same type.
+ * <p>
* @param filter
*/
public void setFilterRemoveByHashCode( boolean filter );
-
+
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java Fri Jun 23 12:54:25 2006
@@ -1,36 +1,27 @@
package org.apache.jcs.auxiliary.remote.behavior;
/*
- * 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 java.util.Set;
-
import java.rmi.Remote;
+import java.util.Set;
import org.apache.jcs.access.exception.ObjectExistsException;
-import org.apache.jcs.access.exception.ObjectNotFoundException;
-
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.ICacheService;
/**
* Used to retrieve and update the remote cache.
- *
*/
public interface IRemoteCacheService
extends Remote, ICacheService
@@ -38,7 +29,7 @@
/**
* Puts a cache item to the cache.
- *
+ * <p>
* @param item
* @param requesterId
* @throws ObjectExistsException
@@ -49,7 +40,7 @@
/**
* Removes the given key from the specified cache.
- *
+ * <p>
* @param cacheName
* @param key
* @param requesterId
@@ -60,7 +51,7 @@
/**
* Remove all keys from the sepcified cache.
- *
+ * <p>
* @param cacheName
* @param requesterId
* @throws IOException
@@ -72,18 +63,18 @@
* Returns a cache bean from the specified cache; or null if the key does
* not exist.
* <p>
- * Adding the requestor id, allows the cache to determine the sournce of the get.
- *
+ * Adding the requestor id, allows the cache to determine the sournce of the
+ * get.
+ * <p>
* @param cacheName
* @param key
- * @param requesterId
+ * @param requesterId
* @return ICacheElement
- * @throws ObjectNotFoundException
* @throws IOException
*/
public ICacheElement get( String cacheName, Serializable key, long requesterId )
throws IOException;
-
+
/**
* @param cacheName
* @param groupName
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=416809&r1=416808&r2=416809&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java Fri Jun 23 12:54:25 2006
@@ -31,7 +31,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.access.exception.ObjectNotFoundException;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
@@ -480,7 +479,6 @@
* @param key
* @param requesterId
* @return ICacheElement
- * @throws ObjectNotFoundException
* @throws IOException
*/
public ICacheElement get( String cacheName, Serializable key, long requesterId )
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org