commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1344374 [2/14] - in /commons/proper/jcs/trunk: ./ auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jcs...
Date Wed, 30 May 2012 18:14:51 GMT
Modified: commons/proper/jcs/trunk/project.properties
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/project.properties?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/project.properties (original)
+++ commons/proper/jcs/trunk/project.properties Wed May 30 18:14:43 2012
@@ -1,98 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-# -------------------------------------------------------------------
-# REPOS
-# -------------------------------------------------------------------
-maven.repo.remote=http://ibiblio.org/maven,http://repository.codehaus.org/org/codehaus/mojo/,http://maven-plugins.sourceforge.net,http://maven-plugins.sourceforge.net/repository/maven-plugins/,http://repo1.maven.org/maven
-
-maven.repo.list=apache
-maven.repo.apache=scp://people.apache.org
-maven.repo.apache.directory=/www/people.apache.org/repo/m1-ibiblio-rsync-repository
-
-# -------------------------------------------------------------------
-# XDOC
-# -------------------------------------------------------------------
-maven.xdoc.date = left
-
-# -------------------------------------------------------------------
-# Compilation options
-# -------------------------------------------------------------------
-maven.compile.source = 1.4
-maven.compile.target = 1.4
-
-# Add information on compilation options to the Manifest
-maven.jar.manifest.attributes.list=X-Compile-Source-JDK,X-Compile-Target-JDK
-maven.jar.manifest.attribute.X-Compile-Source-JDK=${maven.compile.source}
-maven.jar.manifest.attribute.X-Compile-Target-JDK=${maven.compile.target}
-
-# -------------------------------------------------------------------
-# TEST
-# -------------------------------------------------------------------
-maven.test.callback.pre-test.buildFile = build.xml
-maven.test.callback.pre-test.buildTarget = jcs:test-prepare
-
-# this only include *UnitTest.java by default
-# this allows us to keep performance tests out of jcoverage,
-# since instrumented perf tests will always fail.
-test=Unit
-
-maven.core.callback.post-compile.buildFile = build.xml
-maven.core.callback.post-compile.buildTarget = jcs:copy-classpath-vm
-
-# -------------------------------------------------------------------
-# JUNIT
-# -------------------------------------------------------------------
-maven.junit.fork = true
-# I'm setting this for jcoverage.
-# maven.test.failure.ignore=true
-maven.jcoverage.junit.fork = true
-maven.junit.sysproperties=java.security.policy
-java.security.policy=${basedir}/src/conf/cache.policy
-maven.junit.jvmargs=-Xmx256m
-
-# -------------------------------------------------------------------
-# Cobertura
-# -------------------------------------------------------------------
-maven.cobertura.datafile=${basedir}/cobertura.ser
-
-# -------------------------------------------------------------------
-# C H E C K S T Y L E  P R O P E R T I E S
-# -------------------------------------------------------------------
-maven.checkstyle.properties = ${basedir}/checkstyle.xml
-
-# -------------------------------------------------------------------
-# C H A N G E L O G  P R O P E R T I E S
-# -------------------------------------------------------------------
-maven.changelog.range=360
-maven.changelog.factory = org.apache.maven.svnlib.SvnChangeLogFactory
-
-# -------------------------------------------------------------------
-# L I C E N S E  P R O P E R T I E S
-# -------------------------------------------------------------------
-maven.license.licenseFile = ${basedir}/LICENSE.txt
-
-# -------------------------------------------------------------------
-# C H A N G E S  P R O P E R T I E S
-# -------------------------------------------------------------------
-maven.changes.issue.template = http://issues.apache.org/jira/browse/%ISSUE%
-
-# -------------------------------------------------------------------
-# X D O C  P R O P E R T I E S
-# -------------------------------------------------------------------
-# display the date on the site
-maven.xdoc.date = left
-maven.xdoc.locale.default = en

Modified: commons/proper/jcs/trunk/project.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/project.xml?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/project.xml (original)
+++ commons/proper/jcs/trunk/project.xml Wed May 30 18:14:43 2012
@@ -1,362 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-	<!--
-		Licensed to the Apache Software Foundation (ASF) under one or more
-		contributor license agreements. See the NOTICE file distributed with
-		this work for additional information regarding copyright ownership.
-		The ASF licenses this file to you 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.
-	-->
-<project>
-	<pomVersion>3</pomVersion>
-	<name>JCS</name>
-	<id>jcs</id>
-	<currentVersion>1.3.3.5-RC</currentVersion>
-	<organization>
-		<name>Apache Software Foundation</name>
-		<url>http://jakarta.apache.org/</url>
-		<logo>/images/jakarta.png</logo>
-	</organization>
-	<inceptionYear>2002</inceptionYear>
-	<package>org.apache.jcs</package>
-	<logo></logo>
-	<gumpRepositoryId>jakarta</gumpRepositoryId>
-	<shortDescription>Cache</shortDescription>
-	<description>Comprehensive Caching System</description>
-	<url>http://jakarta.apache.org/jcs/</url>
-	<issueTrackingUrl> http://issues.apache.org/jira/browse/JCS
-	</issueTrackingUrl>
-	<siteAddress>people.apache.org</siteAddress>
-	<siteDirectory>/www/jakarta.apache.org/jcs/
-	</siteDirectory>
-	<distributionSite>www.apache.org</distributionSite>
-	<distributionDirectory> /www/www.apache.org/dist/java-repository
-	</distributionDirectory>
-	<repository>
-		<connection>
-			scm:svn:http://svn.apache.org/repos/asf/commons/proper/jcs/trunk/
-		</connection>
-		<developerConnection>
-			scm:svn:https://svn.apache.org/repos/asf/commons/proper/jcs/trunk/
-		</developerConnection>
-		<url>http://svn.apache.org/viewcvs.cgi/commons/proper/jcs/trunk/
-		</url>
-	</repository>
-	<mailingLists>
-		<mailingList>
-			<name>JCS User List</name>
-			<subscribe> jcs-users-subscribe@jakarta.apache.org</subscribe>
-			<unsubscribe> jcs-users-unsubscribe@jakarta.apache.org</unsubscribe>
-			<archive> http://mail-archives.apache.org/mod_mbox/jakarta-jcs-users/
-			</archive>
-		</mailingList>
-		<mailingList>
-			<name>JCS Developer List</name>
-			<subscribe>jcs-dev-subscribe@jakarta.apache.org
-			</subscribe>
-			<unsubscribe> jcs-dev-unsubscribe@jakarta.apache.org</unsubscribe>
-			<archive> http://mail-archives.apache.org/mod_mbox/jakarta-jcs-dev/
-			</archive>
-		</mailingList>
-		<mailingList>
-			<name>OLD User list</name>
-			<subscribe></subscribe>
-			<unsubscribe></unsubscribe>
-			<archive>
-				http://mail-archives.apache.org/mod_mbox/jakarta-turbine-jcs-user/
-			</archive>
-		</mailingList>
-		<mailingList>
-			<name>OLD Developer list</name>
-			<subscribe></subscribe>
-			<unsubscribe></unsubscribe>
-			<archive>
-				http://mail-archives.apache.org/mod_mbox/jakarta-turbine-jcs-dev/
-			</archive>
-		</mailingList>
-	</mailingLists>
-	<developers>
-		<developer>
-			<name>Aaron Smuts</name>
-			<id>asmuts</id>
-			<email>asmuts@apache.org</email>
-			<organization />
-		</developer>
-		<developer>
-			<name>James Taylor</name>
-			<id>jtaylor</id>
-			<email>james@jamestaylor.org</email>
-			<organization />
-		</developer>
-		<developer>
-			<name>Hanson Char</name>
-			<id>hchar</id>
-			<email>hchar@apache.org</email>
-			<organization />
-		</developer>
-		<developer>
-			<name>Travis Savo</name>
-			<id>tsavo</id>
-			<email>tsavo@ifilm.com</email>
-			<organization>IFilm</organization>
-		</developer>
-	</developers>
-	<contributors>
-		<contributor>
-			<name>Scott Eade</name>
-			<email>seade@backstagetech.com.au</email>
-		</contributor>
-		<contributor>
-			<name>Michael Stevens</name>
-			<email>mstevens@etla.org</email>
-		</contributor>
-		<contributor>
-			<name>Thomas Vandahl</name>
-			<email>tv@apache.org</email>
-		</contributor>
-	</contributors>
-	<dependencies>
-
-		<!--  For comparative performance tests only -->
-		<dependency>
-			<groupId>commons-collections</groupId>
-			<artifactId>commons-collections</artifactId>
-			<version>3.2</version>
-			<url>http://jakarta.apache.org/commons/collections/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>commons-configuration</groupId>
-			<artifactId>commons-configuration</artifactId>
-			<version>1.4</version>
-			<url>http://jakarta.apache.org/commons/configuration/
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  REQUIRED FOR JCS CORE -->
-		<dependency>
-			<groupId>commons-logging</groupId>
-			<artifactId>commons-logging</artifactId>
-			<version>1.1</version>
-			<url>http://jakarta.apache.org/commons/logging/
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  REQUIRED FOR JCS CORE -->
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-			<version>2.1</version>
-			<url>http://jakarta.apache.org/commons/lang/
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  JDBC DISK CACHE -->
-		<dependency>
-			<groupId>commons-dbcp</groupId>
-			<artifactId>commons-dbcp</artifactId>
-			<version>1.2.2</version>
-			<url>http://jakarta.apache.org/commons
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  JDBC DISK CACHE -->
-		<dependency>
-			<groupId>commons-pool</groupId>
-			<artifactId>commons-pool</artifactId>
-			<version>1.3</version>
-			<url>http://jakarta.apache.org/commons
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  REQUIRED FOR JCS CORE -->
-		<dependency>
-			<groupId>concurrent</groupId>
-			<artifactId>concurrent</artifactId>
-			<!-- Using old release for now while JDK 1.3 is supported. -->
-			<version>1.0</version>
-			<url>
-				http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-			<version>3.0.10</version>
-			<url></url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>hsqldb</groupId>
-			<artifactId>hsqldb</artifactId>
-			<version>1.7.3.3</version>
-			<!-- <version>1.8.0.7</version> -->
-			<url>http://hsqldb.sourceforge.net/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-			<version>1.2.12</version>
-			<url>http://logging.apache.org/log4j/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>servletapi</groupId>
-			<artifactId>servletapi</artifactId>
-			<version>2.3</version>
-			<url>http://java.sun.com/products/servlet/
-			</url>
-			<type>jar</type>
-		</dependency>
-
-		<!--  For the HTTP Remote Cache -->
-		<dependency>
-			<groupId>commons-httpclient</groupId>
-			<artifactId>commons-httpclient</artifactId>
-			<version>3.0-rc4</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-codec</groupId>
-			<artifactId>commons-codec</artifactId>
-			<version>1.2</version>
-		</dependency>
-		<dependency>
-			<groupId>tomcat</groupId>
-			<artifactId>tomcat-util</artifactId>
-			<version>3.2.1</version>
-			<url>http://tomcat.apache.org/</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>velocity</groupId>
-			<artifactId>velocity</artifactId>
-			<version>1.5</version>
-			<url>http://jakarta.apache.org/velocity/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>3.8.1</version>
-			<url>http://www.junit.org/</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>xmlrpc</groupId>
-			<artifactId>xmlrpc</artifactId>
-			<version>2.0</version>
-			<url>http://ws.apache.org/xmlrpc/</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>xerces</groupId>
-			<artifactId>xercesImpl</artifactId>
-			<version>2.6.2</version>
-			<url>http://xml.apache.org/xerces2-j/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>xml-apis</groupId>
-			<artifactId>xml-apis</artifactId>
-			<version>2.0.2</version>
-			<url>http://xml.apache.org/commons/
-			</url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>berkeleydb</groupId>
-			<artifactId>berkeleydb</artifactId>
-			<version>1.5.1</version>
-			<url></url>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>maven-plugins</groupId>
-			<artifactId>maven-cobertura-plugin</artifactId>
-			<version>1.4</version>
-			<type>plugin</type>
-		</dependency>
-	</dependencies>
-	<build>
-		<sourceDirectory>src/java</sourceDirectory>
-		<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
-		<!-- aspectSourceDirectories></aspectSourceDirectories -->
-		<unitTest>
-			<includes>
-				<include>**/*${test}Test.java</include>
-			</includes>
-			<excludes>
-				<!--
-					Several of the test cases rely on background tasks that are timing
-					sensitive.
-				-->
-				<!-- You need to manually run these test cases. -->
-				<exclude>**/BlockDiskElementDescriptorUnitTest.java
-				</exclude>
-				<exclude>**/HSQLDiskCacheConcurrentUnitTest.java
-				</exclude>
-				<exclude>**/HSQLDiskCacheUnitTest.java
-				</exclude>
-				<exclude>**/IndexedDiskCacheOptimizationUnitTest.java
-				</exclude>
-				<exclude>**/TestTCPLateralUnitTest.java
-				</exclude>
-				<exclude>**/UDPDiscoveryUnitTest.java
-				</exclude>
-				<!-- The ones that fail may be different for you. -->
-				<!-- <exclude>**/JDBCDiskCacheRemovalUnitTest.java</exclude> -->
-				<!-- <exclude>**/JDBCDiskCacheUnitTest.java</exclude> -->
-			</excludes>
-			<resources>
-				<resource>
-					<directory>src/test-conf</directory>
-					<includes>
-						<include>**/*.properties</include>
-						<include>**/*.ccf</include>
-					</includes>
-				</resource>
-			</resources>
-		</unitTest>
-		<resources>
-			<resource>
-				<directory>${basedir}</directory>
-				<targetPath>META-INF</targetPath>
-				<includes>
-					<include>NOTICE</include>
-					<include>LICENSE.xerox</include>
-				</includes>
-			</resource>
-		</resources>
-	</build>
-	<reports>
-		<report>maven-jdepend-plugin</report>
-		<!-- report>maven-checkstyle-plugin</report-->
-		<report>maven-changes-plugin</report>
-		<report>maven-cobertura-plugin</report>
-		<report>maven-javadoc-plugin</report>
-		<report>maven-jxr-plugin</report>
-		<report>maven-junit-report-plugin</report>
-		<report>maven-tasklist-plugin</report>
-		<report>maven-pmd-plugin</report>
-		<report>maven-simian-plugin</report>
-		<report>maven-faq-plugin</report>
-	</reports>
-</project>

Modified: commons/proper/jcs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/changes/changes.xml?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/changes/changes.xml (original)
+++ commons/proper/jcs/trunk/src/changes/changes.xml Wed May 30 18:14:43 2012
@@ -20,6 +20,21 @@
 	</properties>
 	<body>
 		<release version="2.0" date="unreleased" description="JDK 1.5 based major release">
+            <action dev="tv" type="fix" issue="JCS-90" due-to="Diego Rivera">
+                When issuing a shutDown() command, JCS fails to clean up the Queue Processor 
+                thread.
+            </action>
+            <action dev="tv" type="fix" issue="JCS-89" due-to="Diego Rivera">
+                UDP Discovery fails to report correct IP address to peers for back-connect 
+                when InetAddress.getLocalHost() fails to return an externally-visible 
+                address (i.e. returns a local address)
+            </action>
+            <action dev="tv" type="fix" issue="JCS-88" due-to="Diego Rivera">
+                Add a test to verify correct block size calculation
+            </action>
+            <action dev="tv" type="update">
+                Change the interfaces to use generics
+            </action>
             <action dev="tv" type="fix" issue="JCS-86" due-to="Roman Solo">
                 Fix region properties documentation.
             </action>

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java Wed May 30 18:14:43 2012
@@ -46,7 +46,7 @@ public class LateralCacheMulticaster
         LogFactory.getLog( LateralCacheMulticaster.class );
 
     private final static String servlet = "/cache/cache/LateralCacheServletReceiver";
-    private final ICacheElement ice;
+    private final ICacheElement<K, V> ice;
     private final ArrayList servers;
 
     /**
@@ -55,7 +55,7 @@ public class LateralCacheMulticaster
      * @param ice
      * @param servers
      */
-    public LateralCacheMulticaster( ICacheElement ice, ArrayList servers )
+    public LateralCacheMulticaster( ICacheElement<K, V> ice, ArrayList servers )
     {
         this.servers = servers;
         this.ice = ice;

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java Wed May 30 18:14:43 2012
@@ -83,7 +83,7 @@ public class LateralCacheThread extends 
         {
             long start = System.currentTimeMillis();
             //if ( running ) {
-            ICacheElement cb = new CacheElement( hashtableName, key, val );
+            ICacheElement<K, V> cb = new CacheElement( hashtableName, key, val );
             log.debug( "key = " + key );
             String result = sendCache( cb );
             sleep( 100 );
@@ -104,7 +104,7 @@ public class LateralCacheThread extends 
     // end run
 
     /** Description of the Method */
-    public String sendCache( ICacheElement cb )
+    public String sendCache( ICacheElement<K, V> cb )
     {
         String response = "";
         try
@@ -163,7 +163,7 @@ public class LateralCacheThread extends 
 
     // Write the Answer to the Connection
     /** Description of the Method */
-    public void writeObj( URLConnection connection, ICacheElement cb )
+    public void writeObj( URLConnection connection, ICacheElement<K, V> cb )
     {
         try
         {

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java Wed May 30 18:14:43 2012
@@ -46,7 +46,7 @@ public class LateralCacheUnicaster
     private final static Log log =
         LogFactory.getLog( LateralCacheUnicaster.class );
 
-    private final ICacheElement item;
+    private final ICacheElement<K, V> item;
     private final String urlStr;
 
     private URLConnection conn;
@@ -57,7 +57,7 @@ public class LateralCacheUnicaster
      * @param item
      * @param urlStr
      */
-    public LateralCacheUnicaster( ICacheElement item, String urlStr )
+    public LateralCacheUnicaster( ICacheElement<K, V> item, String urlStr )
     {
         this.item = item;
         this.urlStr = urlStr;

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java Wed May 30 18:14:43 2012
@@ -70,7 +70,7 @@ public class LateralCacheServletReciever
             log.debug( "The LateralCacheServlet has been called.\n" );
         }
 
-        ICacheElement item = null;
+        ICacheElement<K, V> item = null;
 
         try
         {
@@ -104,7 +104,7 @@ public class LateralCacheServletReciever
         else
         {
             String hashtableName = item.getCacheName();
-            Serializable key = item.getKey();
+            K key = item.getKey();
             Serializable val = item.getVal();
 
             log.debug( "item read in = " + item );

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java Wed May 30 18:14:43 2012
@@ -160,7 +160,7 @@ public class LateralCacheUDPListener imp
 
     //////////////////////////// implements the ILateralCacheListener interface. //////////////
     /** */
-    public void handlePut( ICacheElement cb )
+    public void handlePut( ICacheElement<K, V> cb )
         throws IOException
     {
         if ( log.isDebugEnabled() )
@@ -173,7 +173,7 @@ public class LateralCacheUDPListener imp
 
 
     /** Description of the Method */
-    public void handleRemove( String cacheName, Serializable key )
+    public void handleRemove( String cacheName, K key )
         throws IOException
     {
         if ( log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java Wed May 30 18:14:43 2012
@@ -84,7 +84,7 @@ public class LateralGroupCacheUDPListene
      * not necessary
      */
     /** Description of the Method */
-    public void handlePut( ICacheElement cb )
+    public void handlePut( ICacheElement<K, V> cb )
         throws IOException
     {
 

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java Wed May 30 18:14:43 2012
@@ -121,7 +121,7 @@ public class LateralUDPSender
 
     // Service Methods //
     /** Description of the Method */
-    public void update( ICacheElement item, byte requesterId )
+    public void update( ICacheElement<K, V> item, byte requesterId )
         throws IOException
     {
         LateralElementDescriptor led = new LateralElementDescriptor( item );
@@ -132,7 +132,7 @@ public class LateralUDPSender
 
 
     /** Description of the Method */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, LateralCacheInfo.listenerId );
@@ -140,7 +140,7 @@ public class LateralUDPSender
 
 
     /** Description of the Method */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
         CacheElement ce = new CacheElement( cacheName, key, null );

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java Wed May 30 18:14:43 2012
@@ -80,7 +80,7 @@ public class LateralUDPService implement
     }
 
     /** Description of the Method */
-    public void update( ICacheElement item )
+    public void update( ICacheElement<K, V> item )
         throws IOException
     {
         update( item, LateralCacheInfo.listenerId );
@@ -88,7 +88,7 @@ public class LateralUDPService implement
 
 
     /** Description of the Method */
-    public void update( ICacheElement item, long requesterId )
+    public void update( ICacheElement<K, V> item, long requesterId )
         throws IOException
     {
         LateralElementDescriptor led = new LateralElementDescriptor( item );
@@ -99,7 +99,7 @@ public class LateralUDPService implement
 
 
     /** Description of the Method */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, LateralCacheInfo.listenerId );
@@ -107,7 +107,7 @@ public class LateralUDPService implement
 
 
     /** Description of the Method */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
         CacheElement ce = new CacheElement( cacheName, key, null );
@@ -145,7 +145,7 @@ public class LateralUDPService implement
 
 
     /** Description of the Method */
-    public ICacheElement get( String cache, Serializable att )
+    public ICacheElement<K, V> get( String cache, Serializable att )
         throws IOException
     {
         return null;
@@ -165,7 +165,7 @@ public class LateralUDPService implement
      * Gets the set of keys of objects currently in the group
      * throws UnsupportedOperationException
      */
-    public Set<Serializable> getGroupKeys(String cacheName, String group)
+    public Set<K> getGroupKeys(String cacheName, String group)
     {
         if (true)
         {

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java Wed May 30 18:14:43 2012
@@ -165,7 +165,7 @@ public class LateralCacheXMLRPCListener 
 
     //////////////////////////// implements the ILateralCacheListener interface. //////////////
     /** */
-    public void handlePut( ICacheElement cb )
+    public void handlePut( ICacheElement<K, V> cb )
         throws IOException
     {
         if ( log.isDebugEnabled() )
@@ -178,7 +178,7 @@ public class LateralCacheXMLRPCListener 
 
 
     /** Description of the Method */
-    public void handleRemove( String cacheName, Serializable key )
+    public void handleRemove( String cacheName, K key )
         throws IOException
     {
         if ( log.isDebugEnabled() )
@@ -205,7 +205,7 @@ public class LateralCacheXMLRPCListener 
     }
 
     /** Test get implementation. */
-    public Serializable handleGet( String cacheName, Serializable key )
+    public Serializable handleGet( String cacheName, K key )
         throws IOException
     {
         if ( log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java Wed May 30 18:14:43 2012
@@ -186,7 +186,7 @@ public class LateralXMLRPCReceiverConnec
      * @param key
      * @exception Exception
      */
-    private Serializable getAndRespond( String cacheName, Serializable key )
+    private Serializable getAndRespond( String cacheName, K key )
         throws Exception
     {
         Serializable obj = ilcl.handleGet( cacheName, key );

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java Wed May 30 18:14:43 2012
@@ -212,10 +212,10 @@ public class LateralXMLRPCSender impleme
      * @param led
      * @exception IOException
      */
-    public ICacheElement sendAndReceive( LateralElementDescriptor led )
+    public ICacheElement<K, V> sendAndReceive( LateralElementDescriptor led )
         throws IOException
     {
-        ICacheElement ice = null;
+        ICacheElement<K, V> ice = null;
 
         log.debug( "sendAndReceive led" );
 
@@ -242,7 +242,7 @@ public class LateralXMLRPCSender impleme
                 Object obj = xmlrpc.execute( IXMLRPCConstants.HANDLERNAME + ".execute", params );
                 if ( !obj.equals( IXMLRPCConstants.NO_RESULTS ) )
                 {
-                    ice = ( ICacheElement ) obj;
+                    ice = ( ICacheElement<K, V> ) obj;
                     if ( ice == null )
                     {
                         //p( "ice is null" );
@@ -277,7 +277,7 @@ public class LateralXMLRPCSender impleme
      * @param requesterId
      * @exception IOException
      */
-    public void update( ICacheElement item, byte requesterId )
+    public void update( ICacheElement<K, V> item, byte requesterId )
         throws IOException
     {
         LateralElementDescriptor led = new LateralElementDescriptor( item );
@@ -294,7 +294,7 @@ public class LateralXMLRPCSender impleme
      * @param key
      * @exception IOException
      */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, LateralCacheInfo.listenerId );
@@ -309,7 +309,7 @@ public class LateralXMLRPCSender impleme
      * @param requesterId
      * @exception IOException
      */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
         CacheElement ce = new CacheElement( cacheName, key, null );

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java Wed May 30 18:14:43 2012
@@ -91,7 +91,7 @@ public class LateralXMLRPCService
      * @param item
      * @exception IOException
      */
-    public void update( ICacheElement item )
+    public void update( ICacheElement<K, V> item )
         throws IOException
     {
         update( item, LateralCacheInfo.listenerId );
@@ -102,7 +102,7 @@ public class LateralXMLRPCService
      * @param requesterId
      * @exception IOException
      */
-    public void update( ICacheElement item, long requesterId )
+    public void update( ICacheElement<K, V> item, long requesterId )
         throws IOException
     {
         LateralElementDescriptor led = new LateralElementDescriptor( item );
@@ -116,7 +116,7 @@ public class LateralXMLRPCService
      * @param key
      * @exception IOException
      */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, LateralCacheInfo.listenerId );
@@ -128,7 +128,7 @@ public class LateralXMLRPCService
      * @param requesterId
      * @exception IOException
      */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
         CacheElement ce = new CacheElement( cacheName, key, null );
@@ -179,7 +179,7 @@ public class LateralXMLRPCService
      * @param key
      * @exception IOException
      */
-    public ICacheElement get( String cacheName, Serializable key )
+    public ICacheElement<K, V> get( String cacheName, K key )
         throws IOException
     {
         //p( "get(cacheName,key,container)" );
@@ -196,7 +196,7 @@ public class LateralXMLRPCService
      * Gets the set of keys of objects currently in the group
      * throws UnsupportedOperationException
      */
-    public Set<Serializable> getGroupKeys(String cacheName, String group)
+    public Set<K> getGroupKeys(String cacheName, String group)
     {
         if (true)
         {

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java Wed May 30 18:14:43 2012
@@ -37,7 +37,7 @@ public interface ILateralCacheXMLRPCList
     public void init();
 
     /** Tries to get a requested item from the cache. */
-    public Serializable handleGet( String cacheName, Serializable key )
+    public Serializable handleGet( String cacheName, K key )
         throws IOException;
 
 }

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java Wed May 30 18:14:43 2012
@@ -114,7 +114,7 @@ public class ARCMemoryCache
         }
     }
 
-    public ICacheElement getQuiet( Serializable key )
+    public ICacheElement<K, V> getQuiet( K key )
         throws IOException
     {
         return get( key );
@@ -136,12 +136,12 @@ public class ARCMemoryCache
     /**
      * Looks for the item in the lists.
      */
-    public ICacheElement get( Serializable key )
+    public ICacheElement<K, V> get( K key )
         throws IOException
     {
         CacheElement ce = new CacheElement( cacheName, key, null );
 
-        ICacheElement ice = null;
+        ICacheElement<K, V> ice = null;
         try
         {
             ice = ARC( ce, true );
@@ -156,7 +156,7 @@ public class ARCMemoryCache
     /**
      * Adds an element to the cache.
      */
-    public void update( ICacheElement ce )
+    public void update( ICacheElement<K, V> ce )
     {
         try
         {
@@ -204,7 +204,7 @@ public class ARCMemoryCache
      *            boolean
      * @return ICacheElement
      */
-    public ICacheElement ARC( ICacheElement ce, boolean isGet )
+    public ICacheElement<K, V> ARC( ICacheElement<K, V> ce, boolean isGet )
     {
         cnt++;
         logStatsOccassionally( ce, isGet );
@@ -300,7 +300,7 @@ public class ARCMemoryCache
                     if ( T1.size() + T2.size() + B1.size() + B2.size() >= 2 * maxSize )
                     {
                         /* cache is full: */
-                        /* x find and reuse B2’s LRU */
+                        /* x find and reuse B2�s LRU */
                         temp = (ElementDescriptor) B2.removeLast();
                         if ( temp != null )
                         {
@@ -391,7 +391,7 @@ public class ARCMemoryCache
      * @param temp
      * @return
      */
-    protected ElementDescriptor handleFoundInB1( ICacheElement ce, boolean isGet, ElementDescriptor temp )
+    protected ElementDescriptor handleFoundInB1( ICacheElement<K, V> ce, boolean isGet, ElementDescriptor temp )
     {
         // B1 hit: favor recency
 
@@ -439,7 +439,7 @@ public class ARCMemoryCache
      * @param temp
      * @return
      */
-    protected ElementDescriptor handleFoundInB2( ICacheElement ce, boolean isGet, ElementDescriptor temp )
+    protected ElementDescriptor handleFoundInB2( ICacheElement<K, V> ce, boolean isGet, ElementDescriptor temp )
     {
         // adapt the target size
         target_T1 = Math.max( target_T1 - Math.max( B1.size() / B2.size(), 1 ), 0 );
@@ -486,7 +486,7 @@ public class ARCMemoryCache
      * @param ce
      * @param isGet
      */
-    protected void logStatsOccassionally( ICacheElement ce, boolean isGet )
+    protected void logStatsOccassionally( ICacheElement<K, V> ce, boolean isGet )
     {
         if ( cnt % 10000 == 0 )
         // if ( true )
@@ -519,7 +519,7 @@ public class ARCMemoryCache
             ElementDescriptor temp;
             if ( T1.size() >= Math.max( 1, target_T1 ) )
             {
-                // T1’s size exceeds target?
+                // T1�s size exceeds target?
                 // yes: T1 is too big
                 temp = (ElementDescriptor) T1.getLast();
                 if ( orig == null || !orig.key.equals( temp.key ) )
@@ -544,7 +544,7 @@ public class ARCMemoryCache
                     temp.ce = null;
                     temp.listNum = _B1_; // note that fact
                     B1.addFirst( temp ); // put it on B1
-                    // T1Length—; B1Length++; // bookkeep
+                    // T1Length�; B1Length++; // bookkeep
                 }
                 else
                 {
@@ -586,7 +586,7 @@ public class ARCMemoryCache
                     temp.ce = null;
                     temp.listNum = _B2_; // note that fact
                     B2.addFirst( temp ); // put it on B2
-                    // T2Length—; B2Length++; // bookkeep
+                    // T2Length�; B2Length++; // bookkeep
                 }
                 else
                 {
@@ -609,7 +609,7 @@ public class ARCMemoryCache
      *            Serializable
      * @return boolean
      */
-    public boolean remove( Serializable key )
+    public boolean remove( K key )
     {
         ElementDescriptor temp = (ElementDescriptor) map.remove( key );
         if ( temp != null )
@@ -739,13 +739,13 @@ public class ARCMemoryCache
         public int listNum;
 
         /** Its key */
-        public Serializable key;
+        public K key;
 
         /**
          * Constructs a usable object
          * @param ce
          */
-        public ElementDescriptor( ICacheElement ce )
+        public ElementDescriptor( ICacheElement<K, V> ce )
         {
             super( ce );
             key = ce.getKey();

Modified: commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java Wed May 30 18:14:43 2012
@@ -100,7 +100,7 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
@@ -132,12 +132,12 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
 
-        ICacheElement element = arc.get( 0 + ":key" );
+        ICacheElement<K, V> element = arc.get( 0 + ":key" );
 
         System.out.println( "testHitInT1BelowMax " + arc.getStats() );
 
@@ -167,12 +167,12 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
 
-        ICacheElement element = arc.get( 0 + ":key" );
+        ICacheElement<K, V> element = arc.get( 0 + ":key" );
 
         System.out.println( "testHitInT1ThenT2BelowMax " + arc.getStats() );
 
@@ -202,12 +202,12 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
 
-        ICacheElement element = arc.get( 0 + ":key" );
+        ICacheElement<K, V> element = arc.get( 0 + ":key" );
 
         System.out.println( "testHitInT1AtMax " + arc.getStats() );
 
@@ -237,12 +237,12 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
 
-        ICacheElement element = arc.get( 0 + ":key" );
+        ICacheElement<K, V> element = arc.get( 0 + ":key" );
 
         System.out.println( "testHitInT1OverMax " + arc.getStats() );
 
@@ -272,12 +272,12 @@ public class ARCMemoryCacheUnitTest
 
         for ( int i = 0; i < items; i++ )
         {
-            ICacheElement ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
+            ICacheElement<K, V> ice = new CacheElement( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i );
             ice.setElementAttributes( cache.getElementAttributes() );
             arc.update( ice );
         }
 
-        //ICacheElement element = arc.get( 0 + ":key" );
+        //ICacheElement<K, V> element = arc.get( 0 + ":key" );
 
         System.out.println( "testPutInT1ToMax " + arc.getStats() );
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/JCS.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/JCS.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/JCS.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/JCS.java Wed May 30 18:14:43 2012
@@ -19,6 +19,7 @@ package org.apache.jcs;
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.Properties;
 
 import org.apache.jcs.access.GroupCacheAccess;
@@ -34,8 +35,8 @@ import org.apache.jcs.engine.control.Com
  * want to access. If you have several regions, then get instances for each. For best performance
  * the getInstance call should be made in an initialization method.
  */
-public class JCS
-    extends GroupCacheAccess
+public class JCS<K extends Serializable, V extends Serializable>
+    extends GroupCacheAccess<K, V>
 {
     /** cache.ccf alternative. */
     private static String configFilename = null;
@@ -51,7 +52,7 @@ public class JCS
      * <p>
      * @param cacheControl Cache which the instance will provide access to
      */
-    protected JCS( CompositeCache cacheControl )
+    protected JCS( CompositeCache<K, V> cacheControl )
     {
         super( cacheControl );
     }
@@ -63,10 +64,11 @@ public class JCS
      * @return A JCS which provides access to a given region.
      * @exception CacheException
      */
-    public static JCS getInstance( String region )
+    public static <K extends Serializable, V extends Serializable> JCS<K, V> getInstance( String region )
         throws CacheException
     {
-        return new JCS( getCacheManager().getCache( region ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region );
+        return new JCS<K, V>( cache );
     }
 
     /**
@@ -77,10 +79,11 @@ public class JCS
      * @return A JCS which provides access to a given region.
      * @exception CacheException
      */
-    public static JCS getInstance( String region, ICompositeCacheAttributes icca )
+    public static <K extends Serializable, V extends Serializable> JCS<K, V> getInstance( String region, ICompositeCacheAttributes icca )
         throws CacheException
     {
-        return new JCS( getCacheManager().getCache( region, icca ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region, icca );
+        return new JCS<K, V>( cache );
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java Wed May 30 18:14:43 2012
@@ -51,8 +51,8 @@ import org.apache.jcs.engine.stats.behav
  * <p>
  * The JCS class is the preferred way to access these methods.
  */
-public class CacheAccess
-    implements ICacheAccess<Serializable, Serializable>
+public class CacheAccess<K extends Serializable, V extends Serializable>
+    implements ICacheAccess<K, V>
 {
     /** The logger. */
     private static final Log log = LogFactory.getLog( CacheAccess.class );
@@ -65,14 +65,14 @@ public class CacheAccess
      * <p>
      * @TODO Should this be the interface?
      */
-    protected CompositeCache cacheControl;
+    protected CompositeCache<K, V> cacheControl;
 
     /**
      * Constructor for the CacheAccess object.
      * <p>
      * @param cacheControl The cache which the created instance accesses
      */
-    public CacheAccess( CompositeCache cacheControl )
+    public CacheAccess( CompositeCache<K, V> cacheControl )
     {
         this.cacheControl = cacheControl;
     }
@@ -90,12 +90,11 @@ public class CacheAccess
      * @return CacheAccess instance for the new region
      * @exception CacheException
      */
-    public static CacheAccess defineRegion( String name )
+    public static <K extends Serializable, V extends Serializable> CacheAccess<K, V> defineRegion( String name )
         throws CacheException
     {
-        getCacheManager();
-
-        return new CacheAccess( getCacheManager().getCache( name ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( name );
+        return new CacheAccess<K, V>( cache );
     }
 
     /**
@@ -106,10 +105,11 @@ public class CacheAccess
      * @return CacheAccess instance for the new region
      * @exception CacheException
      */
-    public static CacheAccess defineRegion( String name, ICompositeCacheAttributes cattr )
+    public static <K extends Serializable, V extends Serializable> CacheAccess<K, V> defineRegion( String name, ICompositeCacheAttributes cattr )
         throws CacheException
     {
-        return new CacheAccess( getCacheManager().getCache( name, cattr ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( name, cattr );
+        return new CacheAccess<K, V>( cache );
     }
 
     /**
@@ -122,10 +122,11 @@ public class CacheAccess
      * @return CacheAccess instance for the new region
      * @exception CacheException
      */
-    public static CacheAccess defineRegion( String name, ICompositeCacheAttributes cattr, IElementAttributes attr )
+    public static <K extends Serializable, V extends Serializable> CacheAccess<K, V> defineRegion( String name, ICompositeCacheAttributes cattr, IElementAttributes attr )
         throws CacheException
     {
-        return new CacheAccess( getCacheManager().getCache( name, cattr, attr ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( name, cattr, attr );
+        return new CacheAccess<K, V>( cache );
     }
 
     /**
@@ -135,10 +136,11 @@ public class CacheAccess
      * @return CacheAccess instance for region
      * @exception CacheException
      */
-    public static CacheAccess getAccess( String region )
+    public static <K extends Serializable, V extends Serializable> CacheAccess<K, V> getAccess( String region )
         throws CacheException
     {
-        return new CacheAccess( getCacheManager().getCache( region ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region );
+        return new CacheAccess<K, V>( cache );
     }
 
     /**
@@ -149,10 +151,11 @@ public class CacheAccess
      * @return CacheAccess instance for region
      * @exception CacheException
      */
-    public static CacheAccess getAccess( String region, ICompositeCacheAttributes icca )
+    public static <K extends Serializable, V extends Serializable> CacheAccess<K, V> getAccess( String region, ICompositeCacheAttributes icca )
         throws CacheException
     {
-        return new CacheAccess( getCacheManager().getCache( region, icca ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region, icca );
+        return new CacheAccess<K, V>( cache );
     }
 
     /**
@@ -182,9 +185,9 @@ public class CacheAccess
      * @param name Key the object is stored as
      * @return The object if found or null
      */
-    public Serializable get( Serializable name )
+    public V get( K name )
     {
-        ICacheElement element = this.cacheControl.get( name );
+        ICacheElement<K, V> element = this.cacheControl.get( name );
 
         return ( element != null ) ? element.getVal() : null;
     }
@@ -195,16 +198,16 @@ public class CacheAccess
      * @param pattern - a key pattern for the objects stored
      * @return A map of key to values.  These are stripped from the wrapper.
      */
-    public Map<Serializable, Serializable> getMatching( String pattern )
+    public Map<K, V> getMatching( String pattern )
     {
-        HashMap<Serializable, Serializable> unwrappedResults = new HashMap<Serializable, Serializable>();
+        HashMap<K, V> unwrappedResults = new HashMap<K, V>();
 
-        Map<Serializable, ICacheElement> wrappedResults = this.cacheControl.getMatching( pattern );
+        Map<K, ICacheElement<K, V>> wrappedResults = this.cacheControl.getMatching( pattern );
         if ( wrappedResults != null )
         {
-            for (Map.Entry<Serializable, ICacheElement> entry : wrappedResults.entrySet())
+            for (Map.Entry<K, ICacheElement<K, V>> entry : wrappedResults.entrySet())
             {
-                ICacheElement element = wrappedResults.get( entry.getKey() );
+                ICacheElement<K, V> element = entry.getValue();
                 if ( element != null )
                 {
                     unwrappedResults.put( entry.getKey(), element.getVal() );
@@ -215,7 +218,7 @@ public class CacheAccess
     }
 
     /**
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -227,9 +230,9 @@ public class CacheAccess
      * The last access time in the ElementAttributes should be current.
      * <p>
      * @param name Key the Serializable is stored as
-     * @return The ICacheElement if the object is found or null
+     * @return The ICacheElement<K, V> if the object is found or null
      */
-    public ICacheElement getCacheElement( Serializable name )
+    public ICacheElement<K, V> getCacheElement( K name )
     {
         return this.cacheControl.get( name );
     }
@@ -237,7 +240,7 @@ public class CacheAccess
     /**
      * Get multiple elements from the cache based on a set of cache keys.
      * <p>
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -249,9 +252,9 @@ public class CacheAccess
      * The last access time in the ElementAttributes should be current.
      * <p>
      * @param names set of Serializable cache keys
-     * @return a map of Serializable key to ICacheElement element, or empty map if none of the keys are present
+     * @return a map of K key to ICacheElement<K, V> element, or empty map if none of the keys are present
      */
-    public Map<Serializable, ICacheElement> getCacheElements( Set<Serializable> names )
+    public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names )
     {
         return this.cacheControl.getMultiple( names );
     }
@@ -259,7 +262,7 @@ public class CacheAccess
     /**
      * Get multiple elements from the cache based on a set of cache keys.
      * <p>
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -271,9 +274,9 @@ public class CacheAccess
      * The last access time in the ElementAttributes should be current.
      * <p>
      * @param pattern key search pattern
-     * @return a map of Serializable key to ICacheElement element, or empty map if no keys match the pattern
+     * @return a map of K key to ICacheElement<K, V> element, or empty map if no keys match the pattern
      */
-    public Map<Serializable, ICacheElement> getMatchingCacheElements( String pattern )
+    public Map<K, ICacheElement<K, V>> getMatchingCacheElements( String pattern )
     {
         return this.cacheControl.getMatching( pattern );
     }
@@ -288,7 +291,7 @@ public class CacheAccess
      * @exception CacheException and ObjectExistsException is thrown if the item is already in the
      *                cache.
      */
-    public void putSafe( Serializable key, Serializable value )
+    public void putSafe( K key, V value )
         throws CacheException
     {
         if ( this.cacheControl.get( key ) != null )
@@ -307,7 +310,7 @@ public class CacheAccess
      * @param obj Object to store
      * @exception CacheException
      */
-    public void put( Serializable name, Serializable obj )
+    public void put( K name, V obj )
         throws CacheException
     {
         // Call put with a copy of the contained caches default attributes.
@@ -323,14 +326,15 @@ public class CacheAccess
      * @see org.apache.jcs.access.behavior.ICacheAccess#put(java.lang.Object, java.lang.Object,
      *      org.apache.jcs.engine.behavior.IElementAttributes)
      */
-    public void put( Serializable key, Serializable val, IElementAttributes attr )
+    public void put( K key, V val, IElementAttributes attr )
         throws CacheException
     {
         if ( key == null )
         {
             throw new InvalidArgumentException( "Key must not be null" );
         }
-        else if ( val == null )
+
+        if ( val == null )
         {
             throw new InvalidArgumentException( "Value must not be null" );
         }
@@ -339,7 +343,7 @@ public class CacheAccess
         // should be wrapped by cache access.
         try
         {
-            CacheElement ce = new CacheElement( this.cacheControl.getCacheName(), key,
+            CacheElement<K, V> ce = new CacheElement<K, V>( this.cacheControl.getCacheName(), key,
                                                 val );
 
             ce.setElementAttributes( attr );
@@ -413,7 +417,7 @@ public class CacheAccess
      * @deprecated use remove
      */
     @Deprecated
-    public void destroy( Serializable name )
+    public void destroy( K name )
         throws CacheException
     {
         this.cacheControl.remove( name );
@@ -425,7 +429,7 @@ public class CacheAccess
      * @param name the name of the item to remove.
      * @throws CacheException
      */
-    public void remove( Serializable name )
+    public void remove( K name )
         throws CacheException
     {
         this.cacheControl.remove( name );
@@ -483,10 +487,10 @@ public class CacheAccess
      * @exception CacheException
      * @exception InvalidHandleException if the item does not exist.
      */
-    public void resetElementAttributes( Serializable name, IElementAttributes attr )
+    public void resetElementAttributes( K name, IElementAttributes attr )
         throws CacheException, InvalidHandleException
     {
-        ICacheElement element = this.cacheControl.get( name );
+        ICacheElement<K, V> element = this.cacheControl.get( name );
 
         if ( element == null )
         {
@@ -544,7 +548,7 @@ public class CacheAccess
      * @return Attributes for the object, null if object not in cache
      * @exception CacheException
      */
-    public IElementAttributes getElementAttributes( Serializable name )
+    public IElementAttributes getElementAttributes( K name )
         throws CacheException
     {
         IElementAttributes attr = null;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java Wed May 30 18:14:43 2012
@@ -20,10 +20,13 @@ package org.apache.jcs.access;
  */
 
 import java.io.Serializable;
+import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.jcs.access.behavior.IGroupCacheAccess;
 import org.apache.jcs.access.exception.CacheException;
+import org.apache.jcs.access.exception.InvalidArgumentException;
+import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
 import org.apache.jcs.engine.behavior.IElementAttributes;
@@ -34,18 +37,25 @@ import org.apache.jcs.engine.control.gro
 /**
  * Access for groups.
  */
-public class GroupCacheAccess
-    extends CacheAccess
-    implements IGroupCacheAccess<Serializable, Serializable>
+public class GroupCacheAccess<K extends Serializable, V extends Serializable>
+    extends CacheAccess<K, V>
+    implements IGroupCacheAccess<K, V>
 {
+    /** a typesafe copy of the group cache */
+    private final CompositeCache<GroupAttrName<K>, V> groupCache;
+
     /**
      * Constructor for the GroupCacheAccess object
      * <p>
      * @param cacheControl
      */
-    public GroupCacheAccess( CompositeCache cacheControl )
+    @SuppressWarnings("unchecked")
+    public GroupCacheAccess( CompositeCache<K, V> cacheControl )
     {
         super( cacheControl );
+
+        // This is a HACK to allow different types of keys in group caches
+        this.groupCache = (CompositeCache<GroupAttrName<K>, V>) this.cacheControl;
     }
 
     /**
@@ -55,10 +65,11 @@ public class GroupCacheAccess
      * @return The groupAccess value
      * @throws CacheException
      */
-    public static GroupCacheAccess getGroupAccess( String region )
+    public static <K extends Serializable, V extends Serializable> GroupCacheAccess<K, V> getGroupAccess( String region )
         throws CacheException
     {
-        return new GroupCacheAccess( getCacheManager().getCache( region ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region );
+        return new GroupCacheAccess<K, V>( cache );
     }
 
     /**
@@ -69,10 +80,11 @@ public class GroupCacheAccess
      * @return The groupAccess value
      * @throws CacheException
      */
-    public static GroupCacheAccess getGroupAccess( String region, ICompositeCacheAttributes icca )
+    public static <K extends Serializable, V extends Serializable> GroupCacheAccess<K, V> getGroupAccess( String region, ICompositeCacheAttributes icca )
         throws CacheException
     {
-        return new GroupCacheAccess( getCacheManager().getCache( region, icca ) );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region, icca );
+        return new GroupCacheAccess<K, V>( cache );
     }
 
     /**
@@ -84,9 +96,9 @@ public class GroupCacheAccess
      *            The group name.
      * @return The cached value, null if not found.
      */
-    public Serializable getFromGroup( Serializable name, String group )
+    public V getFromGroup( K name, String group )
     {
-        ICacheElement element = this.cacheControl.get( getGroupAttrName( group, name ) );
+        ICacheElement<GroupAttrName<K>, V> element = this.groupCache.get( getGroupAttrName( group, name ) );
         return ( element != null ) ? element.getVal() : null;
     }
 
@@ -97,10 +109,10 @@ public class GroupCacheAccess
      * @param name
      * @return GroupAttrName
      */
-    private GroupAttrName getGroupAttrName( String group, Serializable name )
+    private GroupAttrName<K> getGroupAttrName( String group, K name )
     {
         GroupId gid = new GroupId( this.cacheControl.getCacheName(), group );
-        return new GroupAttrName( gid, name );
+        return new GroupAttrName<K>( gid, name );
     }
 
     /**
@@ -116,7 +128,7 @@ public class GroupCacheAccess
      *            The object to cache
      * @throws CacheException
      */
-    public void putInGroup( Serializable name, String groupName, Serializable value )
+    public void putInGroup( K name, String groupName, V value )
         throws CacheException
     {
         putInGroup( name, groupName, value, null );
@@ -137,30 +149,50 @@ public class GroupCacheAccess
      *            The objects attributes.
      * @throws CacheException
      */
-    public void putInGroup( Serializable name, String groupName, Serializable value, IElementAttributes attr )
+    public void putInGroup( K name, String groupName, V value, IElementAttributes attr )
         throws CacheException
     {
+        if ( name == null )
+        {
+            throw new InvalidArgumentException( "Key must not be null" );
+        }
+
+        if ( value == null )
+        {
+            throw new InvalidArgumentException( "Value must not be null" );
+        }
+
         // unbind object first if any.
         remove( name, groupName );
 
-        if ( attr == null )
+        // Create the element and update. This may throw an IOException which
+        // should be wrapped by cache access.
+        try
         {
-            put( getGroupAttrName( groupName, name ), value );
+            GroupAttrName<K> key = getGroupAttrName( groupName, name );
+            CacheElement<GroupAttrName<K>, V> ce =
+                new CacheElement<GroupAttrName<K>, V>( this.groupCache.getCacheName(), key, value );
+
+            IElementAttributes attributes = (attr == null) ? this.groupCache.getElementAttributes() : attr;
+            ce.setElementAttributes( attributes );
+
+            this.groupCache.update( ce );
         }
-        else
+        catch ( Exception e )
         {
-            put( getGroupAttrName( groupName, name ), value, attr );
+            throw new CacheException( e );
         }
+
     }
 
     /**
      * @param name
      * @param group
      */
-    public void remove( Serializable name, String group )
+    public void remove( K name, String group )
     {
-        GroupAttrName key = getGroupAttrName( group, name );
-        this.cacheControl.remove( key );
+        GroupAttrName<K> key = getGroupAttrName( group, name );
+        this.groupCache.remove( key );
     }
 
     /**
@@ -169,9 +201,16 @@ public class GroupCacheAccess
      * @param group
      * @return A Set of keys.
      */
-    public Set<Serializable> getGroupKeys( String group )
+    public Set<K> getGroupKeys( String group )
     {
-        return this.cacheControl.getGroupKeys( group );
+        Set<K> groupKeys = new HashSet<K>();
+
+        for (GroupAttrName<K> gan : this.groupCache.getGroupKeys( group ))
+        {
+            groupKeys.add(gan.attrName);
+        }
+
+        return groupKeys;
     }
 
     /**
@@ -182,6 +221,6 @@ public class GroupCacheAccess
      */
     public void invalidateGroup( String group )
     {
-        this.cacheControl.remove( new GroupId( this.cacheControl.getCacheName(), group ) );
+        this.groupCache.remove(getGroupAttrName(group, null));
     }
 }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java Wed May 30 18:14:43 2012
@@ -19,6 +19,7 @@ package org.apache.jcs.access;
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -53,7 +54,7 @@ import org.apache.jcs.utils.props.Abstra
  * <p>
  * @author Aaron Smuts
  */
-public class PartitionedCacheAccess<K, V>
+public class PartitionedCacheAccess<K extends Serializable, V extends Serializable>
     extends AbstractPropertyContainer
     implements ICacheAccess<K, V>
 {
@@ -191,12 +192,12 @@ public class PartitionedCacheAccess<K, V
     }
 
     /**
-     * Gets the ICacheElement (the wrapped object) for the key from the desired partition.
+     * Gets the ICacheElement<K, V> (the wrapped object) for the key from the desired partition.
      * <p>
      * @param key key
      * @return result, null if not found.
      */
-    public ICacheElement getCacheElement( K key )
+    public ICacheElement<K, V> getCacheElement( K key )
     {
         if ( key == null )
         {
@@ -225,7 +226,7 @@ public class PartitionedCacheAccess<K, V
      * @param names
      * @return Map of keys to ICacheElement
      */
-    public Map<K, ICacheElement> getCacheElements( Set<K> names )
+    public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names )
     {
         if ( names == null )
         {
@@ -245,7 +246,7 @@ public class PartitionedCacheAccess<K, V
             dividedNames[partition].add( key );
         }
 
-        Map<K, ICacheElement> result = new HashMap<K, ICacheElement>();
+        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
         for ( int i = 0; i < partitions.length; i++ )
         {
             if ( dividedNames[i] != null && !dividedNames[i].isEmpty() )
@@ -283,7 +284,7 @@ public class PartitionedCacheAccess<K, V
             return null;
         }
 
-        Map<K, V> result = new HashMap<K,V>();
+        Map<K, V> result = new HashMap<K, V>();
         for ( int i = 0; i < partitions.length; i++ )
         {
             result.putAll( partitions[i].getMatching( pattern ) );
@@ -297,7 +298,7 @@ public class PartitionedCacheAccess<K, V
      * @param pattern
      * @return HashMap key to ICacheElement
      */
-    public Map<K, ICacheElement> getMatchingCacheElements( String pattern )
+    public Map<K, ICacheElement<K, V>> getMatchingCacheElements( String pattern )
     {
         if ( pattern == null )
         {
@@ -315,7 +316,7 @@ public class PartitionedCacheAccess<K, V
             return null;
         }
 
-        Map<K, ICacheElement> result = new HashMap<K, ICacheElement>();
+        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
         for ( int i = 0; i < partitions.length; i++ )
         {
             result.putAll( partitions[i].getMatchingCacheElements( pattern ) );
@@ -596,7 +597,7 @@ public class PartitionedCacheAccess<K, V
             String regionName = this.getPartitionRegionNamePrefix() + "_" + i;
             try
             {
-                tempPartitions[i] = (ICacheAccess<K, V>) CacheAccess.getAccess( regionName );
+                tempPartitions[i] = CacheAccess.getAccess( regionName );
             }
             catch ( CacheException e )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/ICacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/ICacheAccess.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/ICacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/ICacheAccess.java Wed May 30 18:14:43 2012
@@ -19,6 +19,7 @@ package org.apache.jcs.access.behavior;
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.Map;
 import java.util.Set;
 
@@ -30,7 +31,7 @@ import org.apache.jcs.engine.behavior.IE
 /**
  * ICacheAccess defines the behavior for client access.
  */
-public interface ICacheAccess<K, V>
+public interface ICacheAccess<K extends Serializable, V extends Serializable>
 {
     /**
      * Basic get method.
@@ -80,7 +81,7 @@ public interface ICacheAccess<K, V>
         throws CacheException;
 
     /**
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -92,14 +93,14 @@ public interface ICacheAccess<K, V>
      * The last access time in the ElementAttributes should be current.
      * <p>
      * @param name Key the object is stored as
-     * @return The ICacheElement if the object is found or null
+     * @return The ICacheElement<K, V> if the object is found or null
      */
-    ICacheElement getCacheElement( K name );
+    ICacheElement<K, V> getCacheElement( K name );
 
     /**
      * Get multiple elements from the cache based on a set of cache keys.
      * <p>
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -111,15 +112,15 @@ public interface ICacheAccess<K, V>
      * The last access time in the ElementAttributes should be current.
      * <p>
      * @param names set of Object cache keys
-     * @return a map of Object key to ICacheElement element, or empty map if none of the keys are
+     * @return a map of Object key to ICacheElement<K, V> element, or empty map if none of the keys are
      *         present
      */
-    Map<K, ICacheElement> getCacheElements( Set<K> names );
+    Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names );
 
     /**
      * Get multiple elements from the cache based on a set of cache keys.
      * <p>
-     * This method returns the ICacheElement wrapper which provides access to element info and other
+     * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other
      * attributes.
      * <p>
      * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No
@@ -130,11 +131,11 @@ public interface ICacheAccess<K, V>
      * <p>
      * The last access time in the ElementAttributes should be current.
      * <p>
-     * @param pattern key search patern
-     * @return a map of Object key to ICacheElement element, or empty map if no keys match the
+     * @param pattern key search pattern
+     * @return a map of Object key to ICacheElement<K, V> element, or empty map if no keys match the
      *         pattern
      */
-    Map<K, ICacheElement> getMatchingCacheElements( String pattern );
+    Map<K, ICacheElement<K, V>> getMatchingCacheElements( String pattern );
 
     /**
      * Old remove all method.

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java Wed May 30 18:14:43 2012
@@ -19,6 +19,7 @@ package org.apache.jcs.access.behavior;
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.Set;
 
 import org.apache.jcs.access.exception.CacheException;
@@ -28,8 +29,7 @@ import org.apache.jcs.engine.behavior.IE
  * IGroupCacheAccess defines group specific behavior for the client access
  * classes.
  */
-public interface IGroupCacheAccess<K, V>
-    extends ICacheAccess<K, V>
+public interface IGroupCacheAccess<K extends Serializable, V extends Serializable>
 {
     /**
      * Gets the g attribute of the IGroupCacheAccess object
@@ -37,12 +37,12 @@ public interface IGroupCacheAccess<K, V>
      * @param name
      * @param group
      *            the name of the group to associate this with.
-     * @return The teh object that is keyed by the name in the group
+     * @return The object that is keyed by the name in the group
      */
     V getFromGroup( K name, String group );
 
     /**
-     * Puts an item int eh cache associated with this group.
+     * Puts an item in the cache associated with this group.
      * <p>
      * @param key
      * @param group

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java Wed May 30 18:14:43 2012
@@ -28,7 +28,7 @@ import org.apache.jcs.engine.control.Com
 public class CacheRegionInfo
 {
     /** The cache region we are getting info on. */
-    CompositeCache cache = null;
+    CompositeCache<?,?> cache = null;
 
     /** number of bytes counted so far, will be a total of all items. */
     long byteCount = 0;
@@ -36,7 +36,7 @@ public class CacheRegionInfo
     /**
      * @return the underlying region
      */
-    public CompositeCache getCache()
+    public CompositeCache<?, ?> getCache()
     {
         return this.cache;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/JCSAdminBean.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/JCSAdminBean.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/JCSAdminBean.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/admin/JCSAdminBean.java Wed May 30 18:14:43 2012
@@ -28,6 +28,7 @@ import java.util.Date;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.jcs.access.exception.CacheException;
 import org.apache.jcs.auxiliary.remote.server.RemoteCacheServer;
@@ -77,9 +78,9 @@ public class JCSAdminBean
     public LinkedList<CacheElementInfo> buildElementInfo( String cacheName )
         throws Exception
     {
-        CompositeCache cache = cacheHub.getCache( cacheName );
+        CompositeCache<Serializable, Serializable> cache = cacheHub.getCache( cacheName );
 
-        Object[] keys = cache.getMemoryCache().getKeyArray();
+        Serializable[] keys = cache.getMemoryCache().getKeySet().toArray(new Serializable[0]);
 
         // Attempt to sort keys according to their natural ordering. If that
         // fails, get the key array again and continue unsorted.
@@ -89,12 +90,12 @@ public class JCSAdminBean
         }
         catch ( Exception e )
         {
-            keys = cache.getMemoryCache().getKeyArray();
+            keys = cache.getMemoryCache().getKeySet().toArray(new Serializable[0]);
         }
 
         LinkedList<CacheElementInfo> records = new LinkedList<CacheElementInfo>();
 
-        ICacheElement element;
+        ICacheElement<Serializable, Serializable> element;
         IElementAttributes attributes;
         CacheElementInfo elementInfo;
 
@@ -102,15 +103,15 @@ public class JCSAdminBean
 
         long now = System.currentTimeMillis();
 
-        for ( int i = 0; i < keys.length; i++ )
+        for (Serializable key : keys)
         {
-            element = cache.getMemoryCache().getQuiet( (Serializable) keys[i] );
+            element = cache.getMemoryCache().getQuiet( key );
 
             attributes = element.getElementAttributes();
 
             elementInfo = new CacheElementInfo();
 
-            elementInfo.key = String.valueOf( keys[i] );
+            elementInfo.key = String.valueOf( key );
             elementInfo.eternal = attributes.getIsEternal();
             elementInfo.maxLifeSeconds = attributes.getMaxLifeSeconds();
 
@@ -143,7 +144,7 @@ public class JCSAdminBean
         LinkedList<CacheRegionInfo> cacheInfo = new LinkedList<CacheRegionInfo>();
 
         CacheRegionInfo regionInfo;
-        CompositeCache cache;
+        CompositeCache<?, ?> cache;
 
         for ( int i = 0; i < cacheNames.length; i++ )
         {
@@ -167,7 +168,7 @@ public class JCSAdminBean
      *
      * @return int The size of the region in bytes.
      */
-    public int getByteCount(CompositeCache cache) throws Exception
+    public <K extends Serializable, V extends Serializable> int getByteCount(CompositeCache<K, V> cache) throws Exception
     {
         if (cache == null)
         {
@@ -177,17 +178,17 @@ public class JCSAdminBean
         long size = 0;
         try
         {
-            IMemoryCache memCache = cache.getMemoryCache();
+            IMemoryCache<K, V> memCache = cache.getMemoryCache();
 
-            Iterator<Map.Entry<Serializable, MemoryElementDescriptor>> iter = memCache.getIterator();
+            Iterator<Map.Entry<K, MemoryElementDescriptor<K, V>>> iter = memCache.getIterator();
             while (iter.hasNext())
             {
-                MemoryElementDescriptor me = iter.next().getValue();
-                ICacheElement ice = me.ce;
+                MemoryElementDescriptor<K, V> me = iter.next().getValue();
+                ICacheElement<K, V> ice = me.ce;
 
                 if (ice instanceof CacheElementSerialized)
                 {
-                    size = size + ((CacheElementSerialized) ice).getSerializedValue().length;
+                    size = size + ((CacheElementSerialized<K, V>) ice).getSerializedValue().length;
                 }
                 else
                 {
@@ -254,7 +255,7 @@ public class JCSAdminBean
                 String[] cacheNames = cacheHub.getCacheNames();
 
                 // Call remoteCacheServer.removeAll(String) for each cacheName...
-                RemoteCacheServer remoteCacheServer = RemoteCacheServerFactory.getRemoteCacheServer();
+                RemoteCacheServer<?, ?> remoteCacheServer = RemoteCacheServerFactory.getRemoteCacheServer();
                 for (int i = 0; i < cacheNames.length; i++)
                 {
                     String cacheName = cacheNames[i];
@@ -294,7 +295,7 @@ public class JCSAdminBean
             try
             {
                 // Call remoteCacheServer.removeAll(String)...
-                RemoteCacheServer remoteCacheServer = RemoteCacheServerFactory.getRemoteCacheServer();
+                RemoteCacheServer<?, ?> remoteCacheServer = RemoteCacheServerFactory.getRemoteCacheServer();
                 remoteCacheServer.removeAll(cacheName);
             }
             catch (IOException e)
@@ -339,16 +340,15 @@ public class JCSAdminBean
             try
             {
                 Object keyToRemove = null;
-                CompositeCache cache = CompositeCacheManager.getInstance().getCache(cacheName);
+                CompositeCache<? extends Serializable, ? extends Serializable> cache = CompositeCacheManager.getInstance().getCache(cacheName);
 
                 // A String key was supplied, but to remove elements via the RemoteCacheServer API, we need the
                 // actual key object as stored in the cache (i.e. a Serializable object). To find the key in this form,
                 // we iterate through all keys stored in the memory cache until we find one whose toString matches
                 // the string supplied...
-                Object[] allKeysInCache = cache.getMemoryCache().getKeyArray();
-                for (int i = 0; i < allKeysInCache.length; i++)
+                Set<? extends Serializable> allKeysInCache = cache.getMemoryCache().getKeySet();
+                for (Serializable keyInCache : allKeysInCache)
                 {
-                    Object keyInCache = allKeysInCache[i];
                     if (keyInCache.toString().equals(key))
                     {
                         if (keyToRemove == null)
@@ -370,7 +370,7 @@ public class JCSAdminBean
                 {
                     throw new IllegalStateException("Found key [" + keyToRemove + ", " + keyToRemove.getClass() + "] in cache matching key specified, however key found in cache is unexpectedly not serializable.");
                 }
-                // At this point, we have retrieved the matching Serializable key.
+                // At this point, we have retrieved the matching K key.
 
                 // Call remoteCacheServer.remove(String, Serializable)...
                 RemoteCacheServer remoteCacheServer = RemoteCacheServerFactory.getRemoteCacheServer();



Mime
View raw message