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 13 public class OldLifecycleManager implements LifecycleManager { 14 15 public void start(PicoContainer node) { 16 List 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 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 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 |