1 6 7 package org.jfox.ioc; 8 9 import org.jfox.ioc.depend.ComponentRefDependency; 10 import org.jfox.ioc.depend.Dependency; 11 import org.jfox.ioc.depend.ObjectDependency; 12 import org.jfox.ioc.deploy.ComponentDeployer; 13 import org.jfox.ioc.deploy.DeployMonitor; 14 15 23 24 public class Startup { 25 26 31 public static void main(String [] args) throws Exception { 32 String moduleDir = "./modules"; 33 if(args !=null && args.length !=0){ 34 if(!args[0].trim().equals("")) { 35 moduleDir = args[0].trim(); 36 } 37 } 38 39 Registry registry = Registry.getInstance(); 40 registry.registerComponent(ComponentDeployer.class); 41 ComponentMeta meta = registry.registerComponent(DeployMonitor.class, 42 new Dependency[]{ 43 new ComponentRefDependency(ComponentName.newInstance(ComponentDeployer.class)), 44 new ObjectDependency(moduleDir)}); 45 registry.getComponentInstance(meta.getComponentName()); 46 registry.start(); 48 } 49 } 50 | Popular Tags |