1 |
| package org.picocontainer.alternatives; |
2 |
| |
3 |
| import org.picocontainer.LifecycleManager; |
4 |
| import org.picocontainer.PicoContainer; |
5 |
| import org.picocontainer.Startable; |
6 |
| |
7 |
| import java.util.List; |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| public class OldLifecycleManager implements LifecycleManager { |
14 |
| |
15 |
0
| public void start(PicoContainer node) {
|
16 |
0
| List startables = node.getComponentInstancesOfType(Startable.class);
|
17 |
0
| for (int i = 0; i < startables.size(); i++) {
|
18 |
0
| ((Startable) startables.get(i)).start();
|
19 |
| } |
20 |
| } |
21 |
| |
22 |
0
| public void stop(PicoContainer node) {
|
23 |
0
| List startables = node.getComponentInstancesOfType(Startable.class);
|
24 |
0
| for (int i = 0; i < startables.size(); i++) {
|
25 |
0
| ((Startable) startables.get(i)).start();
|
26 |
| } |
27 |
| } |
28 |
| |
29 |
0
| public void dispose(PicoContainer node) {
|
30 |
0
| List startables = node.getComponentInstancesOfType(Startable.class);
|
31 |
0
| for (int i = 0; i < startables.size(); i++) {
|
32 |
0
| ((Startable) startables.get(i)).start();
|
33 |
| } |
34 |
| } |
35 |
| |
36 |
| } |