1 package org.nanocontainer.script; 2 3 import java.util.HashMap ; 4 import java.util.Vector ; 5 6 import junit.framework.Assert; 7 8 import org.picocontainer.ComponentAdapter; 9 import org.picocontainer.MutablePicoContainer; 10 import org.picocontainer.Parameter; 11 import org.picocontainer.PicoRegistrationException; 12 import org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer; 13 14 public class BarDecoratingPicoContainer extends AbstractDelegatingMutablePicoContainer { 15 public BarDecoratingPicoContainer(MutablePicoContainer delegate) { 16 super(delegate); 17 } 18 19 public MutablePicoContainer makeChildContainer() { 20 return null; 21 } 22 23 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException { 24 Assert.assertEquals(Vector .class, componentImplementation); 25 return super.registerComponentImplementation(HashMap .class, HashMap .class, parameters); 26 } 27 28 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException { 29 Assert.assertEquals(Vector .class, componentImplementation); 30 return super.registerComponentImplementation(HashMap .class, HashMap .class); 31 } 32 33 } 34 | Popular Tags |