1 /* 2 * Replica is published under the terms 3 * of the Apache Software License. 4 */ 5 package replica.server; 6 7 import org.springframework.context.support.FileSystemXmlApplicationContext; 8 import org.springframework.context.support.StaticApplicationContext; 9 10 /*** 11 * Starts the server aplication. 12 * 13 * @author Pedro Costa 14 * @author Helder Silva 15 * @since 18/Jan/2004 16 */ 17 public class Startup { 18 19 20 static String configFileLocation = "conf/applicationContext.xml"; 21 22 public static void main(String[] args) { 23 24 if( args != null && args.length > 0 ) 25 configFileLocation = args[0]; 26 27 FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(configFileLocation); 28 29 StaticApplicationContext staticApp = (StaticApplicationContext)appContext.getBean("applicationContext"); 30 31 staticApp.setParent( appContext ); 32 33 staticApp.getBeanFactory().setParentBeanFactory( appContext.getBeanFactory() ); 34 35 Listener listener = (Listener)staticApp.getBean("serverListener"); 36 37 new Thread( listener ).start(); 38 } 39 }

This page was automatically generated by Maven