use of org.eclipse.osgi.storage.BundleInfo.Generation 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);
}
use of org.eclipse.osgi.storage.BundleInfo.Generation in project rt.equinox.framework by eclipse.
the class BundleContextImpl method getDataFile.
/**
* Creates a <code>File</code> object for a file in the
* persistent storage area provided for the bundle by the framework.
* If the adaptor does not have file system support, this method will
* return <code>null</code>.
*
* <p>A <code>File</code> object for the base directory of the
* persistent storage area provided for the context bundle by the framework
* can be obtained by calling this method with the empty string ("")
* as the parameter.
* See {@link #getBundle()} for a definition of context bundle.
*
* <p>If the Java runtime environment supports permissions,
* the framework the will ensure that the bundle has
* <code>java.io.FilePermission</code> with actions
* "read","write","execute","delete" for all files (recursively) in the
* persistent storage area provided for the context bundle by the framework.
*
* @param filename A relative name to the file to be accessed.
* @return A <code>File</code> object that represents the requested file or
* <code>null</code> if the adaptor does not have file system support.
* @exception java.lang.IllegalStateException
* If the bundle context has stopped.
*/
public File getDataFile(String filename) {
checkValid();
Generation generation = (Generation) bundle.getModule().getCurrentRevision().getRevisionInfo();
return generation.getBundleInfo().getDataFile(filename);
}
use of org.eclipse.osgi.storage.BundleInfo.Generation in project rt.equinox.framework by eclipse.
the class EquinoxBundle method getResource.
@Override
public URL getResource(String name) {
try {
equinoxContainer.checkAdminPermission(this, AdminPermission.RESOURCE);
} catch (SecurityException e) {
return null;
}
checkValid();
if (isFragment()) {
return null;
}
ModuleClassLoader classLoader = getModuleClassLoader(false);
if (classLoader != null) {
return classLoader.getResource(name);
}
return new ClasspathManager((Generation) module.getCurrentRevision().getRevisionInfo(), null).findLocalResource(name);
}
use of org.eclipse.osgi.storage.BundleInfo.Generation in project rt.equinox.framework by eclipse.
the class EquinoxBundle method getDataFile.
@Override
public File getDataFile(String filename) {
checkValid();
Generation current = (Generation) module.getCurrentRevision().getRevisionInfo();
return current.getBundleInfo().getDataFile(filename);
}
use of org.eclipse.osgi.storage.BundleInfo.Generation in project rt.equinox.framework by eclipse.
the class EquinoxBundle method getEntryPaths.
@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);
}
Aggregations