KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.nanocontainer.script;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Vector JavaDoc;
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 JavaDoc componentKey, Class JavaDoc componentImplementation, Parameter[] parameters) throws PicoRegistrationException {
24         Assert.assertEquals(Vector JavaDoc.class, componentImplementation);
25         return super.registerComponentImplementation(HashMap JavaDoc.class, HashMap JavaDoc.class, parameters);
26     }
27
28     public ComponentAdapter registerComponentImplementation(Object JavaDoc componentKey, Class JavaDoc componentImplementation) throws PicoRegistrationException {
29         Assert.assertEquals(Vector JavaDoc.class, componentImplementation);
30         return super.registerComponentImplementation(HashMap JavaDoc.class, HashMap JavaDoc.class);
31     }
32
33 }
34
Popular Tags