/** * Copies this evicted event node to create a new one with the same values, except with a new Fqn root. * * @param newRoot new Fqn root to use * @return a new EvictedEventNode instance * @see org.jboss.cache.Region#copy(org.jboss.cache.Fqn) */ public EvictionEvent copy(Fqn newRoot) { return new EvictionEvent(Fqn.fromRelativeFqn(newRoot, fqn), type, elementDifference, command, transaction); } }
@SuppressWarnings("unchecked") private Fqn fqnFor(Object o) { return Fqn.fromRelativeFqn(node.getFqn(), selector.childName((K) o)); }
public Node<K, V> getChild(Fqn f) { assertValid(); return spi.getNode(Fqn.fromRelativeFqn(getFqn(), f)); }
/** * Creates a new Fqn whose ancestor has been replaced with the new ancestor passed in. * * @param oldAncestor old ancestor to replace * @param newAncestor nw ancestor to replace with * @return a new Fqn with ancestors replaced. */ public Fqn<E> replaceAncestor(Fqn<E> oldAncestor, Fqn<E> newAncestor) { if (!isChildOf(oldAncestor)) throw new IllegalArgumentException("Old ancestor must be an ancestor of the current Fqn!"); Fqn<E> subFqn = this.getSubFqn(oldAncestor.size(), size()); return Fqn.fromRelativeFqn(newAncestor, subFqn); } }
public boolean removeChild(Fqn f) { assertValid(); return spi.removeNode(Fqn.fromRelativeFqn(getFqn(), f)); }
result.add(Fqn.fromRelativeFqn(base, coreFqn));
Fqn integrationRoot = Fqn.fromRelativeFqn(integrationBase, fqn);
public Node<K, V> addChild(Fqn f) { // TODO: Revisit. Is this really threadsafe? See comment in putIfAbsent() - same solution should be applied here too. assertValid(); Fqn nf = Fqn.fromRelativeFqn(getFqn(), f); Option o1 = spi.getInvocationContext().getOptionOverrides().copy(); Node<K, V> child = getChild(f); if (child == null) { if (trace) log.trace("Child is null; creating."); Option o2 = o1.copy(); spi.getInvocationContext().setOptionOverrides(o1); spi.put(nf, null); if (trace) log.trace("Created. Now getting again."); spi.getInvocationContext().setOptionOverrides(o2); child = getChild(f); if (trace) log.trace("Got child " + child); } return child; }
public Region copy(Fqn newRoot) { RegionImpl clone; clone = new RegionImpl(evictionRegionConfig, Fqn.fromRelativeFqn(newRoot, fqn), regionManager); clone.status = status; // we also need to copy all of the eviction event nodes to the clone's queue clone.createQueue(); for (EvictionEvent een : this.evictionEventQueue) { clone.registerEvictionEvent(een.getFqn(), een.getEventType(), een.getElementDifference(), een.getCommand(), een.getTransaction()); } return clone; }
backupNodeFqn = Fqn.fromRelativeFqn(Fqn.fromRelativeElements(backupRoot, versionOfDefunctData), fqn); backupNodeFqn = Fqn.fromRelativeFqn(backupRoot, fqn);
@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; } }
fqn = Fqn.fromRelativeFqn(parentFqn.getAncestor(offset), fqn);
fqn = Fqn.fromRelativeFqn(parent.getFqn().getAncestor(offset), fqn);