1 10 11 package org.picocontainer.defaults; 12 13 import org.picocontainer.PicoIntrospectionException; 14 15 import java.util.LinkedList ; 16 import java.util.List ; 17 18 23 public class CyclicDependencyException extends PicoIntrospectionException { 24 private final List stack; 25 26 29 public CyclicDependencyException(Class element) { 30 super((Throwable )null); 31 this.stack = new LinkedList (); 32 push(element); 33 } 34 35 38 public void push(Class element) { 39 stack.add(element); 40 } 41 42 public Class [] getDependencies() { 43 return (Class []) stack.toArray(new Class [stack.size()]); 44 } 45 46 public String getMessage() { 47 return "Cyclic dependency: " + stack.toString(); 48 } 49 } 50 | Popular Tags |