use of org.eclipse.osgi.internal.permadmin.SecurityAdmin in project rt.equinox.framework by eclipse.
the class SystemBundleActivator method start.
@SuppressWarnings("deprecation")
public void start(BundleContext bc) throws Exception {
registrations.clear();
EquinoxBundle bundle = (EquinoxBundle) bc.getBundle();
bundle.getEquinoxContainer().systemStart(bc);
EquinoxConfiguration configuration = bundle.getEquinoxContainer().getConfiguration();
installSecurityManager(configuration);
bundle.getEquinoxContainer().getLogServices().start(bc);
urlFactoryManager = new EquinoxFactoryManager(bundle.getEquinoxContainer());
urlFactoryManager.installHandlerFactories(bc);
FrameworkDebugOptions dbgOptions = (FrameworkDebugOptions) configuration.getDebugOptions();
dbgOptions.start(bc);
SecurityAdmin sa = bundle.getEquinoxContainer().getStorage().getSecurityAdmin();
ClassLoader tccl = bundle.getEquinoxContainer().getContextFinder();
registerLocations(bc, bundle.getEquinoxContainer().getLocations());
register(bc, EnvironmentInfo.class, bundle.getEquinoxContainer().getConfiguration(), null);
register(bc, PackageAdmin.class, bundle.getEquinoxContainer().getPackageAdmin(), null);
register(bc, StartLevel.class, bundle.getEquinoxContainer().getStartLevel(), null);
register(bc, PermissionAdmin.class, sa, null);
register(bc, ConditionalPermissionAdmin.class, sa, null);
Hashtable<String, Object> props = new Hashtable<>(7);
props.clear();
props.put(Constants.SERVICE_RANKING, Integer.MIN_VALUE);
register(bc, Resolver.class, new ResolverImpl(new Logger(0), null), false, props);
register(bc, DebugOptions.class, dbgOptions, null);
if (tccl != null) {
props.clear();
// $NON-NLS-1$ //$NON-NLS-2$
props.put("equinox.classloader.type", "contextClassLoader");
register(bc, ClassLoader.class, tccl, props);
}
props.clear();
// $NON-NLS-1$
props.put("protocol", new String[] { BundleResourceHandler.OSGI_ENTRY_URL_PROTOCOL, BundleResourceHandler.OSGI_RESOURCE_URL_PROTOCOL });
register(bc, URLConverter.class, new BundleURLConverter(), props);
register(bc, BundleLocalization.class, new BundleLocalizationImpl(), null);
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean setTccl = "true".equals(bundle.getEquinoxContainer().getConfiguration().getConfiguration("eclipse.parsers.setTCCL", "true"));
try {
// $NON-NLS-1$
register(bc, "javax.xml.parsers.SAXParserFactory", new XMLParsingServiceFactory(true, setTccl), false, null);
// $NON-NLS-1$
register(bc, "javax.xml.parsers.DocumentBuilderFactory", new XMLParsingServiceFactory(false, setTccl), false, null);
} catch (NoClassDefFoundError e) {
// ignore; on a platform with no javax.xml (Java 8 SE compact1 profile)
}
bundle.getEquinoxContainer().getStorage().getExtensionInstaller().startExtensionActivators(bc);
// Add an options listener; we already read the options on initialization.
// Here we are just allowing the options to change
props.clear();
props.put(DebugOptions.LISTENER_SYMBOLICNAME, EquinoxContainer.NAME);
register(bc, DebugOptionsListener.class, bundle.getEquinoxContainer().getConfiguration().getDebug(), props);
register(bc, DebugOptionsListener.class, bundle.getModule().getContainer(), props);
}
Aggregations