Search in sources :

Example 1 with ModuleDatabase

use of org.eclipse.osgi.container.ModuleDatabase in project rt.equinox.framework by eclipse.

the class PlatformAdminImpl method createSystemState.

private State createSystemState() {
    State state = factory.createState(true);
    StateConverter converter = new StateConverter(state);
    ModuleDatabase database = equinoxContainer.getStorage().getModuleDatabase();
    database.readLock();
    try {
        ModuleContainer container = equinoxContainer.getStorage().getModuleContainer();
        List<Module> modules = equinoxContainer.getStorage().getModuleContainer().getModules();
        for (Module module : modules) {
            ModuleRevision current = module.getCurrentRevision();
            BundleDescription description = converter.createDescription(current);
            state.addBundle(description);
        }
        state.setPlatformProperties(asDictionary(equinoxContainer.getConfiguration().getInitialConfig()));
        synchronizer = new PlatformBundleListener(state, converter, database, container);
        state.setResolverHookFactory(synchronizer);
        bc.addBundleListener(synchronizer);
        bc.addFrameworkListener(synchronizer);
        state.resolve();
        state.setTimeStamp(database.getRevisionsTimestamp());
    } finally {
        database.readUnlock();
    }
    return state;
}
Also used : ModuleContainer(org.eclipse.osgi.container.ModuleContainer) State(org.eclipse.osgi.service.resolver.State) BundleDescription(org.eclipse.osgi.service.resolver.BundleDescription) ModuleDatabase(org.eclipse.osgi.container.ModuleDatabase) Module(org.eclipse.osgi.container.Module) ModuleRevision(org.eclipse.osgi.container.ModuleRevision)

Aggregations

Module (org.eclipse.osgi.container.Module)1 ModuleContainer (org.eclipse.osgi.container.ModuleContainer)1 ModuleDatabase (org.eclipse.osgi.container.ModuleDatabase)1 ModuleRevision (org.eclipse.osgi.container.ModuleRevision)1 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)1 State (org.eclipse.osgi.service.resolver.State)1