KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > SotoMain


1 package org.sapia.soto;
2
3 import java.io.File JavaDoc;
4
5
6 /**
7  * @author Yanick Duchesne
8  *
9  * <dl>
10  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
11  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
12  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
13  * </dl>
14  */

15 public class SotoMain {
16   public static void main(String JavaDoc[] args) {
17     if (args.length == 0) {
18       help();
19     }
20
21     try {
22       final SotoContainer cont = new SotoContainer();
23       cont.load(new File JavaDoc(args[0]), null);
24       cont.start();
25
26       Runtime.getRuntime().addShutdownHook(new Thread JavaDoc() {
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 JavaDoc 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