public RemoteEntrySnapshot(Region.Entry entry, boolean statsEnabled) throws CacheException { Object entryName = entry.getKey(); if (entryName instanceof String || entryName instanceof Number) { name = entryName; } else { name = new RemoteObjectName(entryName); } Object val = entry.getValue(); if (val != null) { this.value = val.getClass().getName() + "\"" + val.toString() + "\""; } else { this.value = null; } Object attr = entry.getUserAttribute(); if (attr != null) { this.userAttribute = attr.getClass().getName() + "\"" + attr.toString() + "\""; } else { this.userAttribute = null; } if (statsEnabled) { this.stats = new RemoteCacheStatistics(entry.getStatistics()); } else { this.stats = new RemoteCacheStatistics(); } }
entry.getStatistics(); fail("Should have thrown an EntryDestroyedException");
entry.getStatistics(); fail("Should have thrown an EntryDestroyedException");
void buildDetails(Region r, Object objName, int inspectionType) { try { objName = getObjectName(r, objName); if (cancelled) return; if (r.containsKey(objName)) { if (cancelled) return; // @todo darrel: race condition; could be unloaded between isPresent and get call. Region.Entry e = r.getEntry(objName); Object v = e.getValue(); if (cancelled) return; objectValue = CacheDisplay.getCachedObjectDisplay(v, inspectionType); if (cancelled) return; userAttribute = CacheDisplay.getCachedObjectDisplay(e.getUserAttribute(), inspectionType); if (cancelled) return; try { stats = new RemoteCacheStatistics(e.getStatistics()); } catch (StatisticsDisabledException ignore) { } } } catch (CacheException ex) { throw new GemFireCacheException(ex); } }