/** * Gets the secondary keys that are registered with the class in CacheMap. * * @param clazz the class * @param a the array to receive the keys. * @return the secondary keys. */ public K[] getKeys(Class<?> clazz, K[] a) { Cache<K, T> cache = getCache(clazz); if (cache != null) { Set<K> set = cache.keySet(); return set.toArray(a); } else { return a; } }
/** * Remove all registrations for the designated class. * * @param clazz the class */ @SuppressWarnings("unchecked") public void remove(Class<?> clazz) { Cache<K, T> cache = getCache(clazz); if (cache != null) { Object[] keys = cache.keySet().toArray(); for (Object context : keys) { cache.setObject((K) context, null); } } _cache.remove(clazz); }