package picoContainer.test2;

import org.picocontainer.DefaultPicoContainer;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.behaviors.Caching;

public class Main {
	public static void main(String[] args) throws InterruptedException {
		MutablePicoContainer pico = new DefaultPicoContainer(new Caching());
		pico.addComponent("boy", Boy.class);
		pico.addComponent("girl1", Girl.class);
		pico.addComponent("girl2", Girl.class);
		
		System.out.println(pico.getComponent("girl1"));
		System.out.println(pico.getComponent("girl2"));
		
		pico.start();
		Thread.sleep(1000);
		pico.stop();
		pico.dispose();
		
//		Girl girl = (Girl) pico.getComponent(Girl.class);
//		girl.kissSomeone();
//		
//		Girl girl2 = (Girl) pico.getComponent(Girl.class);
//		girl.kissSomeone();
	}
}
