1 package de.webman.generator; 2 3 import de.webman.generator.*; 4 5 import org.apache.log4j.Category; 6 7 12 public class ReferenceCycleDetector 13 { 14 15 private static Category cat = Category.getInstance(ReferenceCycleDetector.class); 16 17 public static boolean isCycle(Integer instanceId) 18 { 19 GeneratorContext context = GeneratorContext.setup(); 21 Object o = context.getCycle(instanceId); 23 if (o != null) 24 { 25 cat.warn("Detected Cycle for Instance : " + instanceId); 26 return true; 27 } 28 context.setCycle(instanceId); 29 return false; 30 } 31 } 32 33 | Popular Tags |