public long getElementCountInMemory() { try { Set children = cache.getChildrenNames(regionFqn); return children == null ? 0 : children.size(); } catch (Exception e) { throw new CacheException(e); } }
@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); } }