KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*****************************************************************************
2  * Copyright (C) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Original code by *
9  *****************************************************************************/

10 package org.picocontainer.defaults;
11
12 import org.picocontainer.ComponentAdapter;
13 import org.picocontainer.Parameter;
14 import org.picocontainer.PicoIntrospectionException;
15
16 /**
17  * @author Aslak Hellesøy
18  * @see org.picocontainer.gems.HotSwappingComponentAdapterFactory for a more feature-rich version of the class
19  * @since 1.2, moved from package {@link org.picocontainer.alternatives}
20  */

21 public class ImplementationHidingComponentAdapterFactory extends DecoratingComponentAdapterFactory {
22     private final boolean strict;
23
24     /**
25      * For serialisation only. Do not use this constructor explicitly.
26      */

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