X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=osgi%2Fruntime%2Forg.argeo.osgi.boot%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBoot.java;h=63e5d059b39cbd9b8d928aa21bd5755737e035ac;hb=3f6778125ace0c2cf816a8cf532ef8210f24394e;hp=7c37986974f3be30ccb0679dd642b49ab417396c;hpb=9047fe4c52b416bf5168838565ab2ded119a80b7;p=lgpl%2Fargeo-commons.git diff --git a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java index 7c3798697..63e5d059b 100644 --- a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java +++ b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBoot.java @@ -43,6 +43,7 @@ import org.osgi.framework.ServiceReference; import org.osgi.service.packageadmin.ExportedPackage; import org.osgi.service.packageadmin.PackageAdmin; +/** Core component, performing basic provisioning of an OSGi runtime. */ public class OsgiBoot { public final static String SYMBOLIC_NAME_OSGI_BOOT = "org.argeo.osgi.boot"; public final static String SYMBOLIC_NAME_EQUINOX = "org.eclipse.osgi"; @@ -62,36 +63,11 @@ public class OsgiBoot { public final static String PROP_ARGEO_OSGI_BOOT_APPCLASS = "argeo.osgi.boot.appclass"; public final static String PROP_ARGEO_OSGI_BOOT_APPARGS = "argeo.osgi.boot.appargs"; - /** @deprecated */ - public final static String PROP_SLC_OSGI_START = "slc.osgi.start"; - /** @deprecated */ - public final static String PROP_SLC_OSGI_BUNDLES = "slc.osgi.bundles"; - /** @deprecated */ - public final static String PROP_SLC_OSGI_LOCATIONS = "slc.osgi.locations"; - /** @deprecated */ - public final static String PROP_SLC_OSGI_BASE_URL = "slc.osgi.baseUrl"; - /** @deprecated */ - public final static String PROP_SLC_OSGI_MODULES_URL = "slc.osgi.modulesUrl"; - - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_DEBUG = "slc.osgiboot.debug"; - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_DEFAULT_TIMEOUT = "slc.osgiboot.defaultTimeout"; - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_MODULES_URL_SEPARATOR = "slc.osgiboot.modulesUrlSeparator"; - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_SYSTEM_PROPERTIES_FILE = "slc.osgiboot.systemPropertiesFile"; - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_APPCLASS = "slc.osgiboot.appclass"; - /** @deprecated */ - public final static String PROP_SLC_OSGIBOOT_APPARGS = "slc.osgiboot.appargs"; - public final static String DEFAULT_BASE_URL = "reference:file:"; public final static String EXCLUDES_SVN_PATTERN = "**/.svn/**"; private boolean debug = Boolean.valueOf( - System.getProperty(PROP_ARGEO_OSGI_BOOT_DEBUG, - System.getProperty(PROP_SLC_OSGIBOOT_DEBUG, "false"))) + System.getProperty(PROP_ARGEO_OSGI_BOOT_DEBUG, "false")) .booleanValue(); /** Default is 10s (set in constructor) */ private long defaultTimeout; @@ -104,12 +80,10 @@ public class OsgiBoot { public OsgiBoot(BundleContext bundleContext) { this.bundleContext = bundleContext; - defaultTimeout = Long.parseLong(OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BOOT_DEFAULT_TIMEOUT, - PROP_SLC_OSGIBOOT_DEFAULT_TIMEOUT, "10000")); - modulesUrlSeparator = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BOOT_MODULES_URL_SEPARATOR, - PROP_SLC_OSGIBOOT_MODULES_URL_SEPARATOR, ","); + defaultTimeout = Long.parseLong(OsgiBootUtils.getProperty( + PROP_ARGEO_OSGI_BOOT_DEFAULT_TIMEOUT, "10000")); + modulesUrlSeparator = OsgiBootUtils.getProperty( + PROP_ARGEO_OSGI_BOOT_MODULES_URL_SEPARATOR, ","); initSystemProperties(); } @@ -262,8 +236,8 @@ public class OsgiBoot { } public void startBundles() { - String bundlesToStart = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_START, PROP_SLC_OSGI_START); + String bundlesToStart = OsgiBootUtils + .getProperty(PROP_ARGEO_OSGI_START); startBundles(bundlesToStart); } @@ -342,6 +316,7 @@ public class OsgiBoot { } } + /** List packages exported twice. */ public Map findPackagesExportedTwice() { ServiceReference paSr = bundleContext .getServiceReference(PackageAdmin.class.getName()); @@ -445,23 +420,21 @@ public class OsgiBoot { } public List getLocationsUrls() { - String baseUrl = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BASE_URL, PROP_SLC_OSGI_BASE_URL, + String baseUrl = OsgiBootUtils.getProperty(PROP_ARGEO_OSGI_BASE_URL, DEFAULT_BASE_URL); - String bundleLocations = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_LOCATIONS, PROP_SLC_OSGI_LOCATIONS); + String bundleLocations = OsgiBootUtils + .getProperty(PROP_ARGEO_OSGI_LOCATIONS); return getLocationsUrls(baseUrl, bundleLocations); } public List getModulesUrls() { List urls = new ArrayList(); - String modulesUrlStr = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_MODULES_URL, PROP_SLC_OSGI_MODULES_URL); + String modulesUrlStr = OsgiBootUtils + .getProperty(PROP_ARGEO_OSGI_MODULES_URL); if (modulesUrlStr == null) return urls; - String baseUrl = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BASE_URL, PROP_SLC_OSGI_BASE_URL); + String baseUrl = OsgiBootUtils.getProperty(PROP_ARGEO_OSGI_BASE_URL); Map installedBundles = getBundles(); @@ -586,11 +559,10 @@ public class OsgiBoot { } public List getBundlesUrls() { - String baseUrl = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BASE_URL, PROP_SLC_OSGI_BASE_URL, + String baseUrl = OsgiBootUtils.getProperty(PROP_ARGEO_OSGI_BASE_URL, DEFAULT_BASE_URL); - String bundlePatterns = OsgiBootUtils.getPropertyCompat( - PROP_ARGEO_OSGI_BUNDLES, PROP_SLC_OSGI_BUNDLES); + String bundlePatterns = OsgiBootUtils + .getProperty(PROP_ARGEO_OSGI_BUNDLES); return getBundlesUrls(baseUrl, bundlePatterns); }