KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > alternatives > OldLifecycleManager


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 JavaDoc;
8
9 /**
10  * @author Paul Hammant
11  * @version $Revision: 1870 $
12  */

13 public class OldLifecycleManager implements LifecycleManager {
14
15     public void start(PicoContainer node) {
16         List JavaDoc startables = node.getComponentInstancesOfType(Startable.class);
17         for (int i = 0; i < startables.size(); i++) {
18             ((Startable) startables.get(i)).start();
19         }
20     }
21
22     public void stop(PicoContainer node) {
23         List JavaDoc startables = node.getComponentInstancesOfType(Startable.class);
24         for (int i = 0; i < startables.size(); i++) {
25             ((Startable) startables.get(i)).start();
26         }
27     }
28
29     public void dispose(PicoContainer node) {
30         List JavaDoc startables = node.getComponentInstancesOfType(Startable.class);
31         for (int i = 0; i < startables.size(); i++) {
32             ((Startable) startables.get(i)).start();
33         }
34     }
35
36 }
37
Popular Tags