private Fqn extractFqnRegion(ReplicableCommand cmd) throws Exception { Fqn fqn = extractFqn(cmd); Region r = regionManager.getValidMarshallingRegion(fqn); return r == null ? null : r.getFqn(); }
public int compareTo(Region other) { return getFqn().compareTo(other.getFqn()); }
protected Object regionAwareUnmarshall(Fqn fqn, Object toUnmarshall) throws Exception { Region r = regionManager == null ? null : regionManager.getValidMarshallingRegion(fqn); ClassLoader originalClassLoader = null; boolean needToResetLoader = false; Thread current = null; if (r != null) { if (trace) { log.trace("Using region " + r.getFqn() + ", which has registered class loader " + r.getClassLoader() + " as a context class loader."); } // set the region's class loader as the thread's context classloader needToResetLoader = true; current = Thread.currentThread(); originalClassLoader = current.getContextClassLoader(); current.setContextClassLoader(r.getClassLoader()); } try { return doUnmarshall(fqn, toUnmarshall); } finally { if (needToResetLoader) current.setContextClassLoader(originalClassLoader); } }
Fqn f = r.getFqn(); state = acquireState(f); if (state != null) stateMap.put(f, state);
if (type == EVICTION && nextBestThing != null && nextBestThing.getFqn().isRoot() && !regionsRegistry.containsKey(Fqn.ROOT))
@Override protected Region getRegion(Fqn fqn) { Region r = super.getRegion(fqn); if (r != null) return r; else if (buddyFqnTransformer.isBackupFqn(fqn)) { // try and grab a backup region, creating one if need be. Fqn actualFqn = buddyFqnTransformer.getActualFqn(fqn); Fqn backupRoot = buddyFqnTransformer.getBackupRootFromFqn(fqn); // the actual region could be a few levels higher than actualFqn Region actualRegion = regionManager.getRegion(actualFqn, Region.Type.EVICTION, false); if (actualRegion == null) return null; //create a new region for this backup Region newRegion = regionManager.getRegion(Fqn.fromRelativeFqn(backupRoot, actualRegion.getFqn()), Region.Type.EVICTION, true); newRegion.setEvictionRegionConfig(actualRegion.getEvictionRegionConfig()); return newRegion; } else return null; } }