Package org.apache.jackrabbit.core
Class HierarchyManagerImpl.CycleDetector
- java.lang.Object
-
- org.apache.jackrabbit.core.HierarchyManagerImpl.CycleDetector
-
- Enclosing class:
- HierarchyManagerImpl
protected static class HierarchyManagerImpl.CycleDetector extends Object
Utility class used to detect path cycles with as little overhead as possible. ThecheckCycle(ItemId)
method is called for each path element as theHierarchyManagerImpl.buildPath(PathBuilder, ItemState, CycleDetector)
method walks up the hierarchy. At first, during the first fifteen path elements, the detector does nothing in order to avoid introducing any unnecessary overhead to normal paths that seldom are deeper than that. After that initial threshold all item identifiers along the path are tracked, and a cycle is reported if an identifier is encountered that already occurred along the same path.