/** * After popping the current <code>RegionCreation</code> off the stack, if * the element on top of the stack is a <code>RegionCreation</code>, then * it is the parent region. */ private void endRegion() throws RegionExistsException { RegionCreation region = (RegionCreation) stack.pop(); boolean isRoot = false; if (stack.isEmpty()) { isRoot = true; } else if (!(stack.peek() instanceof RegionCreation)) { isRoot = true; } if (isRoot) { this.cache.addRootRegion(region); } else { RegionCreation parent = (RegionCreation) stack.peek(); parent.addSubregion(region.getName(), region); } }
/** * After popping the current <code>RegionCreation</code> off the stack, if * the element on top of the stack is a <code>RegionCreation</code>, then * it is the parent region. */ private void endRegion() throws RegionExistsException { RegionCreation region = (RegionCreation) stack.pop(); boolean isRoot = false; if (stack.isEmpty()) { isRoot = true; } else if (!(stack.peek() instanceof RegionCreation)) { isRoot = true; } if (isRoot) { this.cache.addRootRegion(region); } else { RegionCreation parent = (RegionCreation) stack.peek(); parent.addSubregion(region.getName(), region); } }
public Region createSubregion(String subregionName, RegionAttributes attrs) throws RegionExistsException, TimeoutException { RegionCreation subregion = new RegionCreation(this.cache, this, subregionName, null); subregion.setAttributes(attrs); this.addSubregion(subregionName, subregion); return subregion; }
public Region createSubregion(String subregionName, RegionAttributes attrs) throws RegionExistsException, TimeoutException { RegionCreation subregion = new RegionCreation(this.cache, this, subregionName, null); subregion.setAttributes(attrs); this.addSubregion(subregionName, subregion); return subregion; }