1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| package org.picocontainer.alternatives; |
11 |
| |
12 |
| import org.picocontainer.ComponentAdapter; |
13 |
| import org.picocontainer.MutablePicoContainer; |
14 |
| import org.picocontainer.Parameter; |
15 |
| import org.picocontainer.PicoContainer; |
16 |
| import org.picocontainer.PicoException; |
17 |
| import org.picocontainer.PicoRegistrationException; |
18 |
| import org.picocontainer.PicoVerificationException; |
19 |
| import org.picocontainer.PicoVisitor; |
20 |
| |
21 |
| import java.io.Serializable; |
22 |
| import java.util.Collection; |
23 |
| import java.util.List; |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| public abstract class AbstractDelegatingMutablePicoContainer implements MutablePicoContainer, Serializable { |
30 |
| |
31 |
| private MutablePicoContainer delegate; |
32 |
| |
33 |
374
| public AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate) {
|
34 |
374
| this.delegate = delegate;
|
35 |
| } |
36 |
| |
37 |
128
| protected MutablePicoContainer getDelegate() {
|
38 |
128
| return delegate;
|
39 |
| } |
40 |
| |
41 |
20
| public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
|
42 |
20
| return delegate.registerComponentImplementation(componentKey, componentImplementation);
|
43 |
| } |
44 |
| |
45 |
6
| public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException {
|
46 |
6
| return delegate.registerComponentImplementation(componentKey, componentImplementation, parameters);
|
47 |
| } |
48 |
| |
49 |
| |
50 |
148
| public ComponentAdapter registerComponentImplementation(Class componentImplementation) throws PicoRegistrationException {
|
51 |
148
| return delegate.registerComponentImplementation(componentImplementation);
|
52 |
| } |
53 |
| |
54 |
56
| public ComponentAdapter registerComponentInstance(Object componentInstance) throws PicoRegistrationException {
|
55 |
56
| return delegate.registerComponentInstance(componentInstance);
|
56 |
| } |
57 |
| |
58 |
54
| public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException {
|
59 |
54
| return delegate.registerComponentInstance(componentKey, componentInstance);
|
60 |
| } |
61 |
| |
62 |
92
| public ComponentAdapter registerComponent(ComponentAdapter componentAdapter) throws PicoRegistrationException {
|
63 |
92
| return delegate.registerComponent(componentAdapter);
|
64 |
| } |
65 |
| |
66 |
8
| public ComponentAdapter unregisterComponent(Object componentKey) {
|
67 |
8
| return delegate.unregisterComponent(componentKey);
|
68 |
| } |
69 |
| |
70 |
8
| public ComponentAdapter unregisterComponentByInstance(Object componentInstance) {
|
71 |
8
| return delegate.unregisterComponentByInstance(componentInstance);
|
72 |
| } |
73 |
| |
74 |
196
| public Object getComponentInstance(Object componentKey) {
|
75 |
196
| return delegate.getComponentInstance(componentKey);
|
76 |
| } |
77 |
| |
78 |
24
| public Object getComponentInstanceOfType(Class componentType) {
|
79 |
24
| return delegate.getComponentInstanceOfType(componentType);
|
80 |
| } |
81 |
| |
82 |
72
| public List getComponentInstances() {
|
83 |
72
| return delegate.getComponentInstances();
|
84 |
| } |
85 |
| |
86 |
16
| public PicoContainer getParent() {
|
87 |
16
| return delegate.getParent();
|
88 |
| } |
89 |
| |
90 |
72
| public ComponentAdapter getComponentAdapter(Object componentKey) {
|
91 |
72
| return delegate.getComponentAdapter(componentKey);
|
92 |
| } |
93 |
| |
94 |
8
| public ComponentAdapter getComponentAdapterOfType(Class componentType) {
|
95 |
8
| return delegate.getComponentAdapterOfType(componentType);
|
96 |
| } |
97 |
| |
98 |
16
| public Collection getComponentAdapters() {
|
99 |
16
| return delegate.getComponentAdapters();
|
100 |
| } |
101 |
| |
102 |
8
| public List getComponentAdaptersOfType(Class componentType) {
|
103 |
8
| return delegate.getComponentAdaptersOfType(componentType);
|
104 |
| } |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
0
| public void verify() throws PicoVerificationException {
|
110 |
0
| delegate.verify();
|
111 |
| } |
112 |
| |
113 |
76
| public void start() {
|
114 |
76
| delegate.start();
|
115 |
| } |
116 |
| |
117 |
50
| public void stop() {
|
118 |
50
| delegate.stop();
|
119 |
| } |
120 |
| |
121 |
50
| public void dispose() {
|
122 |
50
| delegate.dispose();
|
123 |
| } |
124 |
| |
125 |
24
| public boolean addChildContainer(PicoContainer child) {
|
126 |
24
| return delegate.addChildContainer(child);
|
127 |
| } |
128 |
| |
129 |
8
| public boolean removeChildContainer(PicoContainer child) {
|
130 |
8
| return delegate.removeChildContainer(child);
|
131 |
| } |
132 |
| |
133 |
28
| public void accept(PicoVisitor visitor) {
|
134 |
28
| delegate.accept(visitor);
|
135 |
| } |
136 |
| |
137 |
8
| public List getComponentInstancesOfType(Class type) throws PicoException {
|
138 |
8
| return delegate.getComponentInstancesOfType(type);
|
139 |
| } |
140 |
| |
141 |
18
| public boolean equals(Object obj) {
|
142 |
| |
143 |
18
| final boolean result = delegate.equals(obj) || this == obj;
|
144 |
18
| return result;
|
145 |
| } |
146 |
| |
147 |
| } |