Index: topia-security/src/java/org/codelutin/topia/security/util/TopiaSecurityCaching.java diff -u topia-security/src/java/org/codelutin/topia/security/util/TopiaSecurityCaching.java:1.3 topia-security/src/java/org/codelutin/topia/security/util/TopiaSecurityCaching.java:1.4 --- topia-security/src/java/org/codelutin/topia/security/util/TopiaSecurityCaching.java:1.3 Thu Oct 5 14:21:27 2006 +++ topia-security/src/java/org/codelutin/topia/security/util/TopiaSecurityCaching.java Wed Oct 25 09:13:29 2006 @@ -22,6 +22,9 @@ import static org.apache.commons.collections.map.AbstractReferenceMap.SOFT; +import java.util.Collections; +import java.util.Map; + import org.apache.commons.collections.map.ReferenceMap; /** @@ -38,7 +41,7 @@ /** * Map pour le stockage du première niveau */ - protected ReferenceMap map; + protected Map map; /** * Contruit un TopiaSecurityCaching en précisant le nombre d'élément de la clé @@ -46,7 +49,7 @@ */ public TopiaSecurityCaching(int level) { this.level = level; - map = new ReferenceMap(SOFT, SOFT); + map = Collections.synchronizedMap(new ReferenceMap(SOFT, SOFT)); } /** @@ -67,12 +70,12 @@ throw new ArrayIndexOutOfBoundsException(); } - ReferenceMap current = map; + Map current = map; for (int i = 0; i < keys.length -1 ; i++) { Object key = keys[i]; - ReferenceMap next = (ReferenceMap) current.get(key); + Map next = (Map) current.get(key); if (next == null) { - next = new ReferenceMap(SOFT, SOFT); + next = Collections.synchronizedMap(new ReferenceMap(SOFT, SOFT)); current.put(key, next); } current = next; @@ -85,12 +88,12 @@ * @param keys clé de la valeur */ public void clear(Object ... keys) { - ReferenceMap current = map; + Map current = map; for (int i = 0; i < keys.length -1 ; i++) { Object key = keys[i]; - ReferenceMap next = (ReferenceMap) current.get(key); + Map next = (Map) current.get(key); if (next == null) { - next = new ReferenceMap(SOFT, SOFT); + next = Collections.synchronizedMap(new ReferenceMap(SOFT, SOFT)); current.put(key, next); } current = next; @@ -109,10 +112,10 @@ throw new ArrayIndexOutOfBoundsException(); } - ReferenceMap current = map; + Map current = map; for (int i = 0; i < keys.length -1 ; i++) { Object key = keys[i]; - ReferenceMap next = (ReferenceMap) current.get(key); + Map next = (Map) current.get(key); if (next == null) { return null; } else {