KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > script > FooDecoratingPicoContainer


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