1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package org.objectledge.pico.customization;
30
31 import org.picocontainer.PicoContainer;
32 import org.picocontainer.PicoInitializationException;
33 import org.picocontainer.PicoIntrospectionException;
34 import org.picocontainer.PicoVerificationException;
35
36 /***
37 * Provides customized component adapters, based on requesting component's key and implementation
38 * class.
39 *
40 * @author <a href="Rafal.Krzewski">rafal@caltha.pl</a>
41 * @version $Id: CustomizedComponentProvider.java,v 1.10 2005/02/04 02:28:15 rafal Exp $
42 */
43 public interface CustomizedComponentProvider
44 {
45 /***
46 * Returns a customized component instance.
47 *
48 * @param container the container.
49 * @param componentKey requesting component's key.
50 * @param componentImplementaion requesting component's implmenetation class.
51 * @return customized component.
52 * @throws PicoInitializationException if the customized component cannot be initialized.
53 * @throws PicoIntrospectionException if the customized component cannot be initialized.
54 * @throws UnsupportedKeyTypeException if the componentKey has unsupported type.
55 */
56 public Object getCustomizedComponentInstance(PicoContainer container, Object componentKey,
57 Class componentImplementaion)
58 throws PicoInitializationException, PicoIntrospectionException, UnsupportedKeyTypeException;
59
60 /***
61 * Returns the type of the customized components.
62 *
63 * @return the type of the customized components.
64 */
65 public Class getCustomizedComponentImplementation();
66
67 /***
68 * Verifies if the customized component can be instantiated using the dependencies present
69 * in the associated container.
70 *
71 * @param container the container.
72 * @throws PicoVerificationException if the container does not contain required
73 * dependencies.
74 */
75 public void verify(PicoContainer container)
76 throws PicoVerificationException;
77 }