Update of /var/cvs/src/org/mmbase/cache
In directory james.mmbase.org:/tmp/cvs-serv8766
Modified Files:
CacheManager.java
Log Message:
made getCaches return the caches in alphabetical order, which looks a lot
better in the admin pages
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/cache
Index: CacheManager.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/cache/CacheManager.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- CacheManager.java 20 Aug 2008 17:55:42 -0000 1.38
+++ CacheManager.java 20 Aug 2008 22:18:08 -0000 1.39
@@ -27,7 +27,7 @@
* Cache manager manages the static methods of [EMAIL PROTECTED] Cache}. If
you prefer you can call them on this in stead.
*
* @since MMBase-1.8
- * @version $Id: CacheManager.java,v 1.38 2008/08/20 17:55:42 michiel Exp $
+ * @version $Id: CacheManager.java,v 1.39 2008/08/20 22:18:08 michiel Exp $
*/
public abstract class CacheManager {
@@ -59,7 +59,7 @@
return new Bean(getCache(name));
}
public static Set<Bean> getCaches(String className) {
- Set<Bean> result = new HashSet<Bean>();
+ SortedSet<Bean> result = new TreeSet<Bean>();
for (Cache c : caches.values()) {
try {
if (className == null ||
Class.forName(className).isInstance(c)) {
@@ -318,7 +318,7 @@
return cache.remove(key);
}
- public static class Bean<K, V> {
+ public static class Bean<K, V> implements Comparable<Bean<?, ?>> {
/* private final Cache<K, V> cache; // this line prevents building in
Java 1.5.0_07 probably because of
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4916620 */
private final Cache cache;
public Bean(Cache<K, V> c) {
@@ -375,5 +375,8 @@
public int hashCode() {
return cache.hashCode();
}
+ public int compareTo(Bean<?, ?> bean) {
+ return getName().compareTo(bean.getName());
+ }
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs