1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| package org.picocontainer.defaults; |
11 |
| |
12 |
| import org.picocontainer.ComponentAdapter; |
13 |
| import org.picocontainer.Parameter; |
14 |
| import org.picocontainer.PicoIntrospectionException; |
15 |
| |
16 |
| import java.util.HashMap; |
17 |
| import java.util.Map; |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class BeanPropertyComponentAdapterFactory extends DecoratingComponentAdapterFactory { |
28 |
| private Map adapterCache = new HashMap(); |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
18
| public BeanPropertyComponentAdapterFactory(ComponentAdapterFactory delegate) {
|
36 |
18
| super(delegate);
|
37 |
| } |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
18
| public ComponentAdapter createComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
|
43 |
18
| ComponentAdapter decoratedAdapter = super.createComponentAdapter(componentKey, componentImplementation, parameters);
|
44 |
18
| BeanPropertyComponentAdapter propertyAdapter = new BeanPropertyComponentAdapter(decoratedAdapter);
|
45 |
18
| adapterCache.put(componentKey, propertyAdapter);
|
46 |
18
| return propertyAdapter;
|
47 |
| } |
48 |
| |
49 |
| |
50 |
| |
51 |
| |
52 |
| |
53 |
0
| public BeanPropertyComponentAdapter getComponentAdapter(Object key) {
|
54 |
0
| return (BeanPropertyComponentAdapter) adapterCache.get(key);
|
55 |
| } |
56 |
| } |