Search in sources :

Example 1 with BundlePermissions

use of org.eclipse.osgi.internal.permadmin.BundlePermissions in project rt.equinox.framework by eclipse.

the class EquinoxContainerAdaptor method invalidateWiring.

@Override
public void invalidateWiring(ModuleWiring moduleWiring, ModuleLoader current) {
    if (current instanceof BundleLoader) {
        BundleLoader bundleLoader = (BundleLoader) current;
        bundleLoader.close();
    }
    long updatedTimestamp = storage.getModuleDatabase().getRevisionsTimestamp();
    if (System.getSecurityManager() != null && updatedTimestamp != lastSecurityAdminFlush.getAndSet(updatedTimestamp)) {
        storage.getSecurityAdmin().clearCaches();
        List<Module> modules = storage.getModuleContainer().getModules();
        for (Module module : modules) {
            for (ModuleRevision revision : module.getRevisions().getModuleRevisions()) {
                Generation generation = (Generation) revision.getRevisionInfo();
                if (generation != null) {
                    ProtectionDomain domain = generation.getDomain();
                    if (domain != null) {
                        ((BundlePermissions) domain.getPermissions()).clearPermissionCache();
                    }
                }
            }
        }
    }
    clearManifestCache(moduleWiring);
}
Also used : ProtectionDomain(java.security.ProtectionDomain) Generation(org.eclipse.osgi.storage.BundleInfo.Generation) BundlePermissions(org.eclipse.osgi.internal.permadmin.BundlePermissions) SystemModule(org.eclipse.osgi.container.SystemModule) Module(org.eclipse.osgi.container.Module) ModuleRevision(org.eclipse.osgi.container.ModuleRevision) SystemBundleLoader(org.eclipse.osgi.internal.loader.SystemBundleLoader) BundleLoader(org.eclipse.osgi.internal.loader.BundleLoader)

Aggregations

ProtectionDomain (java.security.ProtectionDomain)1 Module (org.eclipse.osgi.container.Module)1 ModuleRevision (org.eclipse.osgi.container.ModuleRevision)1 SystemModule (org.eclipse.osgi.container.SystemModule)1 BundleLoader (org.eclipse.osgi.internal.loader.BundleLoader)1 SystemBundleLoader (org.eclipse.osgi.internal.loader.SystemBundleLoader)1 BundlePermissions (org.eclipse.osgi.internal.permadmin.BundlePermissions)1 Generation (org.eclipse.osgi.storage.BundleInfo.Generation)1