1 package org.sapia.soto; 2 3 import java.io.File ; 4 5 6 15 public class SotoMain { 16 public static void main(String [] args) { 17 if (args.length == 0) { 18 help(); 19 } 20 21 try { 22 final SotoContainer cont = new SotoContainer(); 23 cont.load(new File (args[0]), null); 24 cont.start(); 25 26 Runtime.getRuntime().addShutdownHook(new Thread () { 27 public void run() { 28 System.out.println("Shutting down Soto app..."); 29 cont.dispose(); 30 System.out.println("...Bye."); 31 } 32 }); 33 System.out.println(); 34 System.out.println("Soto app loaded; type CTRL-C to stop."); 35 36 while (true) { 37 Thread.sleep(100000); 38 } 39 } catch (Exception e) { 40 e.printStackTrace(); 41 } 42 } 43 44 private static void help() { 45 System.out.println("Expecting <filename> as argument"); 46 } 47 } 48 | Popular Tags |