KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > buchuki > ensmer > Ensmer


1 /*
2  * Copyright 2004 Dusty Phillips
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.buchuki.ensmer;
17
18 import java.util.Properties JavaDoc;
19
20 /**
21  * Class not meant to be instantiated containing Ensmer's main entry method.
22  * This method simply loads the <code>EnsmerManager</code> and lets it do its
23  * job.
24  *
25  * @author Dusty Phillips [dusty@buchuki.com]
26  */

27 public class Ensmer {
28
29     /**
30      * Main entry point for the Ensmer project. Load the EnsmerManager singleton
31      * and let it take care of loading previous data and setting up the
32      * interface.
33      *
34      * @param arguments Array of String arguments passed into the project.
35      * These should be key=value pairs where the keys and values are
36      * arbitrary string properties. Arguments currently accepted include
37      * settingsDir=/path/to/dir and world = name/of/world
38      */

39     public static void main(String JavaDoc[] arguments) {
40         System.out.println("ENSMER_HOME: " + System.getenv("ENSMER_HOME"));
41         System.out.println("CLASSPATH: " + System.getProperty("java.class.path"));
42         Properties JavaDoc props = new Properties JavaDoc();
43         for (String JavaDoc s : arguments) {
44             int equals = s.indexOf("=");
45             if (equals > 0) {
46                 String JavaDoc key = s.substring(0, equals);
47                 String JavaDoc value = s.substring(equals + 1, s.length());
48                 props.setProperty(key, value);
49             }
50         }
51         EnsmerManager.instance(props);
52     }
53
54     /**
55      * Private constructor, as this class is not meant to be instantiated.
56      */

57     private Ensmer() { }
58 }
59
60
Popular Tags