You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2012/01/16 22:07:07 UTC
svn commit: r1232164 - in
/commons/proper/jcs/branches/generics-interface/auxiliary-builds:
javagroups/src/java/org/apache/jcs/auxiliary/javagroups/
jdk14/src/java/org/apache/jcs/auxiliary/javagroups/
jdk14/src/java/org/apache/jcs/auxiliary/lateral/jav...
Author: tv
Date: Mon Jan 16 21:07:06 2012
New Revision: 1232164
URL: http://svn.apache.org/viewvc?rev=1232164&view=rev
Log:
Switch to generics - Save the work done so far
This code does not compile.
Modified:
commons/proper/jcs/branches/generics-interface/auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java
commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java
Modified: commons/proper/jcs/branches/generics-interface/auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java Mon Jan 16 21:07:06 2012
@@ -109,7 +109,7 @@ public class JavaGroupsCache
log.info( "Initialized for cache: " + cacheName );
}
- public void send( ICacheElement element, int command )
+ public void send( ICacheElement<K, V> element, int command )
{
Request request = new Request( element, command );
@@ -136,7 +136,7 @@ public class JavaGroupsCache
* @param ce CacheElement to replicate
* @throws IOException Never thrown by this implementation
*/
- public void update( ICacheElement ce ) throws IOException
+ public void update( ICacheElement<K, V> ce ) throws IOException
{
send( ce, Request.UPDATE );
}
@@ -149,7 +149,7 @@ public class JavaGroupsCache
* @return
* @throws IOException Never thrown by this implementation
*/
- public ICacheElement get( Serializable key ) throws IOException
+ public ICacheElement<K, V> get( K key ) throws IOException
{
if ( getFromPeers )
{
@@ -176,7 +176,7 @@ public class JavaGroupsCache
if ( results.size() > 0 )
{
- return ( ICacheElement ) results.get( 0 );
+ return ( ICacheElement<K, V> ) results.get( 0 );
}
}
@@ -190,7 +190,7 @@ public class JavaGroupsCache
* @param key Key of element to be removed
* @throws IOException Never thrown by this implementation
*/
- public boolean remove( Serializable key ) throws IOException
+ public boolean remove( K key ) throws IOException
{
CacheElement ce = new CacheElement( cacheName, key, null );
@@ -270,7 +270,7 @@ public class JavaGroupsCache
* @param group Ignored
* @return Always reurns null
*/
- public Set<Serializable> getGroupKeys( String group )
+ public Set<K> getGroupKeys( String group )
{
return null;
}
@@ -365,16 +365,16 @@ public class JavaGroupsCache
public final static int REMOVE_ALL = 3;
public final static int GET = 5;
- private ICacheElement cacheElement;
+ private ICacheElement<K, V> cacheElement;
private int command;
- public Request( ICacheElement cacheElement, int command )
+ public Request( ICacheElement<K, V> cacheElement, int command )
{
this.cacheElement = cacheElement;
this.command = command;
}
- public ICacheElement getCacheElement()
+ public ICacheElement<K, V> getCacheElement()
{
return cacheElement;
}
Modified: commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java Mon Jan 16 21:07:06 2012
@@ -115,7 +115,7 @@ public class JavaGroupsCache
log.info( "Initialized for cache: " + cacheName );
}
- public void send( ICacheElement element, int command )
+ public void send( ICacheElement<K, V> element, int command )
{
Request request = new Request( element, command );
@@ -141,7 +141,7 @@ public class JavaGroupsCache
* @throws IOException
* Never thrown by this implementation
*/
- public void update( ICacheElement ce )
+ public void update( ICacheElement<K, V> ce )
throws IOException
{
send( ce, Request.UPDATE );
@@ -156,7 +156,7 @@ public class JavaGroupsCache
* @throws IOException
* Never thrown by this implementation
*/
- public ICacheElement get( Serializable key )
+ public ICacheElement<K, V> get( K key )
throws IOException
{
if ( getFromPeers )
@@ -197,7 +197,7 @@ public class JavaGroupsCache
* @throws IOException
* Never thrown by this implementation
*/
- public boolean remove( Serializable key )
+ public boolean remove( K key )
throws IOException
{
CacheElement ce = new CacheElement( cacheName, key, null );
@@ -282,7 +282,7 @@ public class JavaGroupsCache
* Ignored
* @return Always reurns null
*/
- public Set<Serializable> getGroupKeys( String group )
+ public Set<K> getGroupKeys( String group )
{
return null;
}
@@ -430,17 +430,17 @@ public class JavaGroupsCache
public final static int GET = 5;
- private ICacheElement cacheElement;
+ private ICacheElement<K, V> cacheElement;
private int command;
- public Request( ICacheElement cacheElement, int command )
+ public Request( ICacheElement<K, V> cacheElement, int command )
{
this.cacheElement = cacheElement;
this.command = command;
}
- public ICacheElement getCacheElement()
+ public ICacheElement<K, V> getCacheElement()
{
return cacheElement;
}
Modified: commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java Mon Jan 16 21:07:06 2012
@@ -171,7 +171,7 @@ public class LateralCacheJGListener
* @param cb
* @exception IOException
*/
- public void handlePut( ICacheElement element )
+ public void handlePut( ICacheElement<K, V> element )
throws IOException
{
if ( log.isDebugEnabled() )
@@ -199,7 +199,7 @@ public class LateralCacheJGListener
* @param key
* @exception IOException
*/
- public void handleRemove( String cacheName, Serializable key )
+ public void handleRemove( String cacheName, K key )
throws IOException
{
if ( log.isDebugEnabled() )
@@ -236,7 +236,7 @@ public class LateralCacheJGListener
* @param key
* @exception IOException
*/
- 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/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java Mon Jan 16 21:07:06 2012
@@ -127,7 +127,7 @@ public class LateralJGReceiverConnection
* @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/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java Mon Jan 16 21:07:06 2012
@@ -151,10 +151,10 @@ public class LateralJGSender
* @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" );
@@ -213,7 +213,7 @@ public class LateralJGSender
* @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 );
@@ -229,7 +229,7 @@ public class LateralJGSender
* @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 );
@@ -243,7 +243,7 @@ public class LateralJGSender
* @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/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java Mon Jan 16 21:07:06 2012
@@ -85,7 +85,7 @@ public class LateralJGService
* @param item
* @exception IOException
*/
- public void update( ICacheElement item )
+ public void update( ICacheElement<K, V> item )
throws IOException
{
update( item, LateralCacheInfo.listenerId );
@@ -96,7 +96,7 @@ public class LateralJGService
* @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 );
@@ -110,7 +110,7 @@ public class LateralJGService
* @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 );
@@ -122,7 +122,7 @@ public class LateralJGService
* @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 );
@@ -159,7 +159,7 @@ public class LateralJGService
* @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)" );
@@ -201,7 +201,7 @@ public class LateralJGService
* 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/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java Mon Jan 16 21:07:06 2012
@@ -37,7 +37,7 @@ public interface ILateralCacheJGListener
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/auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java?rev=1232164&r1=1232163&r2=1232164&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java Mon Jan 16 21:07:06 2012
@@ -72,7 +72,7 @@ public class LHMLRUMemoryCache
*@param ce Description of the Parameter
*@exception IOException
*/
- public void update(ICacheElement ce) throws IOException
+ public void update(ICacheElement<K, V> ce) throws IOException
{
// Asynchronisly create a MemoryElement
ce.getElementAttributes().setLastAccessTimeNow();
@@ -96,9 +96,9 @@ public class LHMLRUMemoryCache
*@return Element mathinh key if found, or null
*@exception IOException
*/
- public ICacheElement getQuiet(Serializable key) throws IOException
+ public ICacheElement<K, V> getQuiet(K key) throws IOException
{
- ICacheElement ce = null;
+ ICacheElement<K, V> ce = null;
ce = (ICacheElement) map.get(key);
@@ -122,12 +122,12 @@ public class LHMLRUMemoryCache
* Get an item from the cache
*
*@param key Identifies item to find
- *@return ICacheElement if found, else null
+ *@return ICacheElement<K, V> if found, else null
*@exception IOException
*/
- public synchronized ICacheElement get(Serializable key) throws IOException
+ public synchronized ICacheElement<K, V> get(K key) throws IOException
{
- ICacheElement ce = null;
+ ICacheElement<K, V> ce = null;
if (log.isDebugEnabled())
{
@@ -163,7 +163,7 @@ public class LHMLRUMemoryCache
*@return
*@exception IOException
*/
- public synchronized boolean remove(Serializable key) throws IOException
+ public synchronized boolean remove(K key) throws IOException
{
if (log.isDebugEnabled())
{
@@ -217,7 +217,7 @@ public class LHMLRUMemoryCache
else
{
// remove single item.
- ICacheElement ce = (ICacheElement) map.remove(key);
+ ICacheElement<K, V> ce = (ICacheElement) map.remove(key);
removed = true;
}