Search in sources :

Example 1 with Storage

use of org.eclipse.osgi.storage.Storage in project rt.equinox.framework by eclipse.

the class EquinoxBundle method update.

@Override
public void update(InputStream input) throws BundleException {
    try {
        Storage storage = equinoxContainer.getStorage();
        storage.update(module, storage.getContentConnection(module, null, input));
        signerInfos = null;
    } catch (IOException e) {
        // $NON-NLS-1$
        throw new BundleException("Error reading bundle content.", e);
    }
}
Also used : Storage(org.eclipse.osgi.storage.Storage) IOException(java.io.IOException) BundleException(org.osgi.framework.BundleException)

Example 2 with Storage

use of org.eclipse.osgi.storage.Storage in project rt.equinox.framework by eclipse.

the class EquinoxBundle method uninstall.

@Override
public void uninstall() throws BundleException {
    // be sure to prime the headers with default local; calling priv method to avoid permission check
    privGetHeaders(null);
    Storage storage = equinoxContainer.getStorage();
    storage.getModuleContainer().uninstall(module);
}
Also used : Storage(org.eclipse.osgi.storage.Storage)

Example 3 with Storage

use of org.eclipse.osgi.storage.Storage in project rt.equinox.framework by eclipse.

the class ClasspathEntry method getMRBundleFiles.

private static List<BundleFile> getMRBundleFiles(BundleFile bundlefile, Generation generation) {
    Storage storage = generation.getBundleInfo().getStorage();
    if (storage.getRuntimeVersion().getMajor() < 9) {
        return Collections.emptyList();
    }
    List<BundleFile> mrBundleFiles = new ArrayList<>();
    for (int i = storage.getRuntimeVersion().getMajor(); i > 8; i--) {
        String versionPath = BundleInfo.MULTI_RELEASE_VERSIONS + i + '/';
        BundleEntry versionEntry = bundlefile.getEntry(versionPath);
        if (versionEntry != null) {
            mrBundleFiles.add(storage.createNestedBundleFile(versionPath, bundlefile, generation, BundleInfo.MULTI_RELEASE_FILTER_PREFIXES));
        }
    }
    return Collections.unmodifiableList(mrBundleFiles);
}
Also used : Storage(org.eclipse.osgi.storage.Storage) ArrayList(java.util.ArrayList) BundleFile(org.eclipse.osgi.storage.bundlefile.BundleFile) BundleEntry(org.eclipse.osgi.storage.bundlefile.BundleEntry)

Example 4 with Storage

use of org.eclipse.osgi.storage.Storage in project rt.equinox.framework by eclipse.

the class EquinoxContainer method close.

void close() {
    StorageSaver currentSaver;
    Storage currentStorage;
    ScheduledExecutorService currentExecutor;
    synchronized (this.monitor) {
        serviceRegistry = null;
        currentSaver = storageSaver;
        currentStorage = storage;
        currentExecutor = executor;
    }
    // do this outside of the lock to avoid deadlock
    currentSaver.close();
    currentStorage.close();
    // Must be done last since it will result in termination of the
    // framework active thread.
    currentExecutor.shutdown();
}
Also used : Storage(org.eclipse.osgi.storage.Storage)

Aggregations

Storage (org.eclipse.osgi.storage.Storage)4 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 BundleEntry (org.eclipse.osgi.storage.bundlefile.BundleEntry)1 BundleFile (org.eclipse.osgi.storage.bundlefile.BundleFile)1 BundleException (org.osgi.framework.BundleException)1