X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=osgi%2Fruntime%2Forg.argeo.osgi.boot%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fosgiboot%2FLauncher.java;h=cd7b723b87459c4d4ee146a5163f1dc8a3962d55;hb=490d9907457c43acfa965e7979ce5974bc1ba6ca;hp=75925165553efaba4c1b4e7ef4080274d88f527e;hpb=e0e0571fe14abae72cb4ea8caab0cccd9fc62f1c;p=lgpl%2Fargeo-commons.git diff --git a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Launcher.java b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Launcher.java index 759251655..cd7b723b8 100644 --- a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Launcher.java +++ b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/slc/osgiboot/Launcher.java @@ -1,10 +1,25 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.argeo.slc.osgiboot; import java.io.FileInputStream; import java.io.IOException; import java.lang.reflect.Method; import java.util.List; -import java.util.Properties; import java.util.Vector; import org.eclipse.core.runtime.adaptor.EclipseStarter; @@ -14,8 +29,9 @@ public class Launcher { public static void main(String[] args) { // Try to load system properties - String systemPropertiesFilePath = System - .getProperty(OsgiBoot.PROP_SLC_OSGIBOOT_SYSTEM_PROPERTIES_FILE); + String systemPropertiesFilePath = OsgiBootUtils.getPropertyCompat( + OsgiBoot.PROP_ARGEO_OSGI_BOOT_SYSTEM_PROPERTIES_FILE, + OsgiBoot.PROP_SLC_OSGIBOOT_SYSTEM_PROPERTIES_FILE); if (systemPropertiesFilePath != null) { FileInputStream in; try { @@ -52,13 +68,23 @@ public class Launcher { } protected static void startMainClass() { - Properties config = System.getProperties(); - String className = config.getProperty("slc.osgiboot.appclass"); + // 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); if (className == null) return; - String[] uiArgs = readArgumentsFromLine(config.getProperty( - "slc.osgiboot.appargs", "")); + // 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[] uiArgs = readArgumentsFromLine(line); + try { // Launch main method using reflection Class clss = Class.forName(className);