KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > alternatives > ImplementationHidingComponentAdapterFactory


1 package org.picocontainer.alternatives;
2
3 import org.picocontainer.ComponentAdapter;
4 import org.picocontainer.Parameter;
5 import org.picocontainer.PicoIntrospectionException;
6 import org.picocontainer.defaults.AssignabilityRegistrationException;
7 import org.picocontainer.defaults.ComponentAdapterFactory;
8 import org.picocontainer.defaults.DecoratingComponentAdapterFactory;
9 import org.picocontainer.defaults.NotConcreteRegistrationException;
10
11 /**
12  * @author Aslak Hellesøy
13  * @version $Revision: 1651 $
14  */

15 public class ImplementationHidingComponentAdapterFactory extends DecoratingComponentAdapterFactory {
16     private final boolean strict;
17
18     /**
19      * For serialisation only. Do not use this constructor explicitly.
20      */

21     public ImplementationHidingComponentAdapterFactory() {
22         this(null);
23     }
24
25     public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate, boolean strict) {
26         super(delegate);
27         this.strict = strict;
28     }
29
30     public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate) {
31         this(delegate, true);
32     }
33
34     public ComponentAdapter createComponentAdapter(Object JavaDoc componentKey, Class JavaDoc componentImplementation, Parameter[] parameters) throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
35         return new ImplementationHidingComponentAdapter(super.createComponentAdapter(componentKey, componentImplementation, parameters), strict);
36     }
37 }
38
Popular Tags