+/*
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ *
+ * 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;
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 {
}
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);