]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/Launcher.java
Update license headers
[lgpl/argeo-commons.git] / osgi / runtime / org.argeo.osgi.boot / src / main / java / org / argeo / osgi / boot / Launcher.java
index 98d7503e31b2f9f6ad0cba21244e137800bc785d..4d08b76edf3a0a75bb4c65a1fc6b231f1a5bd17c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Mathieu Baudier
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.osgi.boot;
 
 import java.io.FileInputStream;
@@ -25,13 +24,13 @@ import java.util.Vector;
 import org.eclipse.core.runtime.adaptor.EclipseStarter;
 import org.osgi.framework.BundleContext;
 
+/** Command line interface. */
 public class Launcher {
 
        public static void main(String[] args) {
                // Try to load system properties
-               String systemPropertiesFilePath = OsgiBootUtils.getPropertyCompat(
-                               OsgiBoot.PROP_ARGEO_OSGI_BOOT_SYSTEM_PROPERTIES_FILE,
-                               OsgiBoot.PROP_SLC_OSGIBOOT_SYSTEM_PROPERTIES_FILE);
+               String systemPropertiesFilePath = OsgiBootUtils
+                               .getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_SYSTEM_PROPERTIES_FILE);
                if (systemPropertiesFilePath != null) {
                        FileInputStream in;
                        try {
@@ -68,23 +67,16 @@ public class Launcher {
        }
 
        protected static void startMainClass() {
-               // Properties config = System.getProperties();
-               // String className = config.getProperty("slc.osgiboot.appclass");
-               String className = OsgiBootUtils.getPropertyCompat(
-                               OsgiBoot.PROP_ARGEO_OSGI_BOOT_APPCLASS,
-                               OsgiBoot.PROP_SLC_OSGIBOOT_APPCLASS);
+               String className = OsgiBootUtils
+                               .getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_APPCLASS);
                if (className == null)
                        return;
 
-               // should use OsgiBootUtils.getPropertyCompat(), but it does not 
-               // work for "" as default value
-               // so no warning displayed if PROP_SLC_OSGIBOOT_APPARGS is used
-               // FIXME: change OsgiBootUtils.getPropertyCompat()
-               String line = System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_APPARGS, 
-                               System.getProperty(OsgiBoot.PROP_SLC_OSGIBOOT_APPARGS, ""));            
-               
+               String line = System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BOOT_APPARGS,
+                               "");
+
                String[] uiArgs = readArgumentsFromLine(line);
-               
+
                try {
                        // Launch main method using reflection
                        Class clss = Class.forName(className);
@@ -103,9 +95,7 @@ public class Launcher {
         * arguments. (nested \" are not supported)
         */
        private static String[] readArgumentsFromLine(String lineOrig) {
-
                String line = lineOrig.trim();// remove trailing spaces
-               // System.out.println("line=" + line);
                List args = new Vector();
                StringBuffer curr = new StringBuffer("");
                boolean inQuote = false;
@@ -139,7 +129,6 @@ public class Launcher {
                String[] res = new String[args.size()];
                for (int i = 0; i < args.size(); i++) {
                        res[i] = args.get(i).toString();
-                       // System.out.println("res[i]=" + res[i]);
                }
                return res;
        }