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";
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;
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();
}
}
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);
}
}
}
+ /** List packages exported twice. */
public Map findPackagesExportedTwice() {
ServiceReference paSr = bundleContext
.getServiceReference(PackageAdmin.class.getName());
}
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();
}
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);
}