Commit 758618e7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Refactoring work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8311 b35dd754-fafc-0310-a699-88a17e54d16e
parent fff63a2a
......@@ -19,12 +19,13 @@ import org.jivesoftware.openfire.roster.RosterManager;
import org.jivesoftware.openfire.user.User;
import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.util.cache.Cache;
import org.jivesoftware.util.cache.CacheManager;
import org.jivesoftware.util.cache.CacheFactory;
import java.io.*;
import java.net.URL;
import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
/**
* A utility bean for Openfire admin console pages.
......
......@@ -11,13 +11,6 @@
package org.jivesoftware.util.cache;
import org.jivesoftware.util.*;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.*;
/**
* General purpose cache. It stores objects associated with unique keys in
* memory for fast access. All keys and values added to the cache must
......@@ -64,7 +57,7 @@ public interface Cache<K,V> extends java.util.Map<K,V> {
*
* @return the maximum size of the cache in bytes.
*/
int getMaxCacheSize();
long getMaxCacheSize();
/**
* Sets the maximum size of the cache in bytes. If the cache grows larger
......
......@@ -7,7 +7,9 @@
*/
package org.jivesoftware.util.cache;
import java.util.*;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
/**
* Acts as a proxy for a Cache implementation. The Cache implementation can be switched on the fly,
......@@ -39,7 +41,7 @@ public class CacheWrapper<K, V> implements Cache<K, V> {
cache.setName(name);
}
public int getMaxCacheSize() {
public long getMaxCacheSize() {
return cache.getMaxCacheSize();
}
......
......@@ -7,13 +7,13 @@
*/
package org.jivesoftware.util.cache;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.LinkedListNode;
import org.jivesoftware.util.Log;
import java.util.*;
import java.io.ObjectOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.*;
/**
* Default, non-distributed implementation of the Cache interface.
......@@ -62,7 +62,7 @@ public class DefaultCache<K, V> implements Cache<K, V> {
/**
* Maximum size in bytes that the cache can grow to.
*/
private int maxCacheSize;
private long maxCacheSize;
/**
* Maintains the current size of the cache in bytes.
......@@ -99,7 +99,7 @@ public class DefaultCache<K, V> implements Cache<K, V> {
* @param maxLifetime the maximum amount of time objects can exist in
* cache before being deleted. -1 means objects never expire.
*/
public DefaultCache(String name, int maxSize, long maxLifetime) {
public DefaultCache(String name, long maxSize, long maxLifetime) {
this.name = name;
this.maxCacheSize = maxSize;
this.maxLifetime = maxLifetime;
......@@ -468,7 +468,7 @@ public class DefaultCache<K, V> implements Cache<K, V> {
*
* @return the maximum size of the cache (-1 indicates unlimited max size).
*/
public int getMaxCacheSize() {
public long getMaxCacheSize() {
return maxCacheSize;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment