@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); }
@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); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
/** * Check for permission to listen to a service. */ static boolean hasListenServicePermission(ServiceEvent event, BundleContextImpl context) { ModuleRevision revision = context.getBundleImpl().getModule().getCurrentRevision(); if (revision == null) { return false; } ProtectionDomain domain = ((Generation) revision.getRevisionInfo()).getDomain(); if (domain == null) { return true; } return domain.implies(new ServicePermission(event.getServiceReference(), ServicePermission.GET)); }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }
private void addImpliedImportPackagePermissions(ManifestElement[] importElements) { ProtectionDomain wovenDomain = ((Generation) ((ModuleRevision) getBundleWiring().getRevision()).getRevisionInfo()).getDomain(); if (wovenDomain != null) { // security is enabled; add the permissions for (ManifestElement clause : importElements) for (String pkg : clause.getValueComponents()) ((BundlePermissions) wovenDomain.getPermissions()).addWovenPermission(new PackagePermission(pkg, PackagePermission.IMPORT)); } }
private ClasspathEntry createClassPathEntry(BundleFile bundlefile, Generation source) { ClasspathEntry entry; if (classloader != null) entry = classloader.createClassPathEntry(bundlefile, source); else entry = new ClasspathEntry(bundlefile, source.getDomain(), source); return entry; }