commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1232165 - in /commons/proper/jcs/branches/generics-interface/src: changes/ experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/ experimental/org/apache/jcs/auxiliary/lateral/http/server/ experimental/org/apache/jcs/auxiliary/later...
Date Mon, 16 Jan 2012 21:08:50 GMT
Author: tv
Date: Mon Jan 16 21:08:49 2012
New Revision: 1232165

URL: http://svn.apache.org/viewvc?rev=1232165&view=rev
Log:
Switch to generics - Save the work done so far
This code does not compile.

Modified:
    commons/proper/jcs/branches/generics-interface/src/changes/changes.xml
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
    commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java

Modified: commons/proper/jcs/branches/generics-interface/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/changes/changes.xml?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/changes/changes.xml (original)
+++ commons/proper/jcs/branches/generics-interface/src/changes/changes.xml Mon Jan 16 21:08:49
2012
@@ -20,6 +20,9 @@
 	</properties>
 	<body>
 		<release version="2.0" date="unreleased" description="JDK 1.5 based major release">
+            <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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
Mon Jan 16 21:08:49 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/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java?rev=1232165&r1=1232164&r2=1232165&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java
(original)
+++ commons/proper/jcs/branches/generics-interface/src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java
Mon Jan 16 21:08:49 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() );
 



Mime
View raw message