Exemplo n.º 1
0
 public long getElementCountInMemory() {
   try {
     Set children = cache.getChildrenNames(regionFqn);
     return children == null ? 0 : children.size();
   } catch (Exception e) {
     throw new CacheException(e);
   }
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 public Map toMap() {
   try {
     Map result = new HashMap();
     Set childrenNames = cache.getChildrenNames(regionFqn);
     if (childrenNames != null) {
       Iterator iter = childrenNames.iterator();
       while (iter.hasNext()) {
         Object key = iter.next();
         result.put(key, cache.get(new Fqn(regionFqn, key), ITEM));
       }
     }
     return result;
   } catch (Exception e) {
     throw new CacheException(e);
   }
 }