protected BundleEntry findBundleEntry(URL url, Module module) throws IOException { ModuleRevision revision = module.getCurrentRevision(); BundleInfo.Generation revisionInfo = (BundleInfo.Generation) revision.getRevisionInfo(); BundleEntry entry = revisionInfo == null ? null : revisionInfo.getBundleFile().getEntry(url.getPath()); if (entry == null) throw new FileNotFoundException(url.getPath()); return entry; } }
public synchronized void loadFragments(Collection<ModuleRevision> addedFragments) { List<FragmentClasspath> result = new ArrayList<>(Arrays.asList(fragments)); for (ModuleRevision addedFragment : addedFragments) { Generation fragGeneration = (Generation) addedFragment.getRevisionInfo(); String[] cp = getClassPath(addedFragment); ClasspathEntry[] fragEntries = buildClasspath(cp, this, fragGeneration); FragmentClasspath fragClasspath = new FragmentClasspath(fragGeneration, fragEntries); insertFragment(fragClasspath, result); } fragments = result.toArray(new FragmentClasspath[result.size()]); }
private Collection<Module> refreshMRJarBundles() throws BundleException { Collection<Module> mrJarBundles = new ArrayList<>(); for (Module m : moduleContainer.getModules()) { Generation generation = (Generation) m.getCurrentRevision().getRevisionInfo(); // Note that we check the raw headers here incase we are working off an old version of the persistent storage if (Boolean.parseBoolean(generation.getRawHeaders().get(BundleInfo.MULTI_RELEASE_HEADER))) { refresh(m); mrJarBundles.add(m); } } return mrJarBundles; }
String getUpdateLocation0(Module module) { ModuleRevision current = module.getCurrentRevision(); Generation generation = (Generation) current.getRevisionInfo(); String updateLocation = generation.getHeaders().get(Constants.BUNDLE_UPDATELOCATION); return updateLocation == null ? module.getLocation() : updateLocation; }
protected void clearManifestLocalizationCache() { Generation hostGen = (Generation) wiring.getRevision().getRevisionInfo(); hostGen.clearManifestCache(); List<ModuleWire> hostWires = wiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE); // doing a null check because there is no lock on the module database here if (hostWires != null) { for (ModuleWire fragmentWire : hostWires) { Generation fragGen = (Generation) fragmentWire.getRequirer().getRevisionInfo(); fragGen.clearManifestCache(); } } }
protected void clearManifestLocalizationCache() { Generation hostGen = (Generation) wiring.getRevision().getRevisionInfo(); hostGen.clearManifestCache(); for (ModuleWire fragmentWire : wiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) { Generation fragGen = (Generation) fragmentWire.getRequirer().getRevisionInfo(); fragGen.clearManifestCache(); } }
protected void clearManifestLocalizationCache() { Generation hostGen = (Generation) wiring.getRevision().getRevisionInfo(); hostGen.clearManifestCache(); for (ModuleWire fragmentWire : wiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) { Generation fragGen = (Generation) fragmentWire.getRequirer().getRevisionInfo(); fragGen.clearManifestCache(); } }
@Override public Dictionary<String, String> getHeaders(String locale) { equinoxContainer.checkAdminPermission(this, AdminPermission.METADATA); Generation current = (Generation) module.getCurrentRevision().getRevisionInfo(); return current.getHeaders(locale); }
private SignedContentImpl getSignedContent(Bundle bundle) { Generation generation = (Generation) ((EquinoxBundle) bundle).getModule().getCurrentRevision().getRevisionInfo(); StorageHookImpl hook = generation.getStorageHook(SignedStorageHook.class); return hook != null ? hook.signedContent : null; } }
@Override protected void cleanup(ModuleRevision revision) { Generation generation = (Generation) revision.getRevisionInfo(); generation.delete(); if (revision.equals(getCurrentRevision())) { // uninstall case generation.getBundleInfo().delete(); } } }
@Override protected void cleanup(ModuleRevision revision) { Generation generation = (Generation) revision.getRevisionInfo(); generation.delete(); if (revision.equals(getCurrentRevision())) { // uninstall case generation.getBundleInfo().delete(); } } }
@Override protected void cleanup(ModuleRevision revision) { Generation generation = (Generation) revision.getRevisionInfo(); generation.delete(); if (revision.equals(getCurrentRevision())) { // uninstall case generation.getBundleInfo().delete(); } } }
private SignedContentImpl getSignedContent(Bundle bundle) { Generation generation = (Generation) ((EquinoxBundle) bundle).getModule().getCurrentRevision().getRevisionInfo(); StorageHookImpl hook = generation.getStorageHook(SignedStorageHook.class); return hook != null ? hook.signedContent : null; } }
@Override protected void cleanup(ModuleRevision revision) { Generation generation = (Generation) revision.getRevisionInfo(); generation.delete(); if (revision.equals(getCurrentRevision())) { // uninstall case generation.getBundleInfo().delete(); } } }
@Override public File getDataFile(String filename) { checkValid(); Generation current = (Generation) module.getCurrentRevision().getRevisionInfo(); return current.getBundleInfo().getDataFile(filename); }
@Override public URL getEntry(String path) { try { equinoxContainer.checkAdminPermission(this, AdminPermission.RESOURCE); } catch (SecurityException e) { return null; } checkValid(); Generation current = (Generation) getModule().getCurrentRevision().getRevisionInfo(); return current.getEntry(path); }
@Override public Enumeration<String> getEntryPaths(String path) { try { equinoxContainer.checkAdminPermission(this, AdminPermission.RESOURCE); } catch (SecurityException e) { return null; } checkValid(); Generation current = (Generation) getModule().getCurrentRevision().getRevisionInfo(); return current.getBundleFile().getEntryPaths(path); }
@Override public Enumeration<String> getEntryPaths(String path) { try { equinoxContainer.checkAdminPermission(this, AdminPermission.RESOURCE); } catch (SecurityException e) { return null; } checkValid(); Generation current = (Generation) getModule().getCurrentRevision().getRevisionInfo(); return current.getBundleFile().getEntryPaths(path); }
private void clearManifestCache(ModuleWiring moduleWiring) { boolean frameworkActive = Module.ACTIVE_SET.contains(storage.getModuleContainer().getModule(0).getState()); ModuleRevision revision = moduleWiring.getRevision(); Module module = revision.getRevisions().getModule(); boolean isUninstallingOrUninstalled = State.UNINSTALLED.equals(module.getState()) ^ module.holdsTransitionEventLock(ModuleEvent.UNINSTALLED); if (!frameworkActive || !isUninstallingOrUninstalled) { // only do this when the framework is not active or when the bundle is not uninstalled Generation generation = (Generation) moduleWiring.getRevision().getRevisionInfo(); generation.clearManifestCache(); } }
private void clearManifestCache(ModuleWiring moduleWiring) { boolean frameworkActive = Module.ACTIVE_SET.contains(storage.getModuleContainer().getModule(0).getState()); ModuleRevision revision = moduleWiring.getRevision(); Module module = revision.getRevisions().getModule(); boolean isUninstallingOrUninstalled = State.UNINSTALLED.equals(module.getState()) ^ module.holdsTransitionEventLock(ModuleEvent.UNINSTALLED); if (!frameworkActive || !isUninstallingOrUninstalled) { // only do this when the framework is not active or when the bundle is not uninstalled Generation generation = (Generation) moduleWiring.getRevision().getRevisionInfo(); generation.clearManifestCache(); } }