|
From: Peter P. <pr...@us...> - 2006-11-20 17:38:00
|
Update of /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1591/src/edu/harvard/syrah/pyxida Modified Files: Pyxida.java Log Message: Started adding the overall class framework for Pyxida Index: Pyxida.java =================================================================== RCS file: /cvsroot/pyxida/Pyxida/src/edu/harvard/syrah/pyxida/Pyxida.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Pyxida.java 20 Nov 2006 13:33:24 -0000 1.2 --- Pyxida.java 20 Nov 2006 17:22:31 -0000 1.3 *************** *** 5,8 **** --- 5,16 ---- import edu.harvard.syrah.prp.ANSI; import edu.harvard.syrah.prp.Log; + import edu.harvard.syrah.pyxida.api.APIManager; + import edu.harvard.syrah.pyxida.api.APIManagerIF; + import edu.harvard.syrah.pyxida.nc.NCClient; + import edu.harvard.syrah.pyxida.nc.NCClientIF; + import edu.harvard.syrah.pyxida.ping.PingManager; + import edu.harvard.syrah.pyxida.ping.PingManagerIF; + import edu.harvard.syrah.sbon.async.EventLoop; + import edu.harvard.syrah.sbon.comm.AddressIF; public class Pyxida { *************** *** 10,18 **** --- 18,51 ---- private static final String PYXIDA_VERSION = "0.1"; + + // TODO read from config file + private static final int NC_NUM_DIMS = 3; private static Properties configProps = System.getProperties(); public static Properties getConfigProps() { return configProps; } public static void setConfigProps(Properties props) { configProps = props; } + + private static Pyxida pyxida = null; + private NCClientIF ncClient = null; + private APIManagerIF apiManager = null; + private PingManagerIF pingManager = null; + + private Pyxida() { /* empty */ } + + private void init() { + // Initialise the network coordinate calculation + ncClient = new NCClient<AddressIF>(NC_NUM_DIMS); + //ncClient.init(); + + // Initialise the measurement modules + pingManager = new PingManager(); + pingManager.init(); + + // Initialise the external APIs + apiManager = new APIManager(); + apiManager.init(); + } + /** * @param args *************** *** 30,33 **** --- 63,85 ---- ANSI.use(Boolean.valueOf(getConfigProps().getProperty("sbon.console.ansi", "true"))); + /* + * Create the event loop + */ + EventLoop.set(new EventLoop( + Long.valueOf(getConfigProps().getProperty("sbon.eventloop.statedump", "30000")), + Boolean.valueOf(getConfigProps().getProperty("sbon.eventloop.showidle", "false"))) + ); + + pyxida = new Pyxida(); + pyxida.init(); + + try { + EventLoop.get().main(); + } catch (OutOfMemoryError e) { + EventLoop.get().dumpState(true); + e.printStackTrace(); + log.error("Error: Out of memory: " + e); + } + log.main("Shutdown"); System.exit(0); |