@Override public void uninstall() throws BundleException { Storage storage = equinoxContainer.getStorage(); storage.getModuleContainer().uninstall(module); }
@Override public Module createModule(String location, long id, EnumSet<Settings> settings, int startlevel) { EquinoxBundle bundle = new EquinoxBundle(id, location, storage.getModuleContainer(), settings, startlevel, container); return bundle.getModule(); }
@Override public Module createModule(String location, long id, EnumSet<Settings> settings, int startlevel) { EquinoxBundle bundle = new EquinoxBundle(id, location, storage.getModuleContainer(), settings, startlevel, container); return bundle.getModule(); }
@Override public Module createModule(String location, long id, EnumSet<Settings> settings, int startlevel) { EquinoxBundle bundle = new EquinoxBundle(id, location, storage.getModuleContainer(), settings, startlevel, container); return bundle.getModule(); }
@Override public SystemModule createSystemModule() { return (SystemModule) new EquinoxBundle.SystemBundle(storage.getModuleContainer(), container).getModule(); }
public boolean hasAuthority(Class<?> clazz) { Bundle b = FrameworkUtil.getBundle(clazz); if (!(b instanceof EquinoxBundle)) { return false; } return (container.getStorage().getModuleContainer() == ((EquinoxBundle) b).getModule().getContainer()); }
public boolean hasAuthority(Class<?> clazz) { Bundle b = FrameworkUtil.getBundle(clazz); if (!(b instanceof EquinoxBundle)) { return false; } return (container.getStorage().getModuleContainer() == ((EquinoxBundle) b).getModule().getContainer()); }
public boolean hasAuthority(Class<?> clazz) { Bundle b = FrameworkUtil.getBundle(clazz); if (!(b instanceof EquinoxBundle)) { return false; } return (container.getStorage().getModuleContainer() == ((EquinoxBundle) b).getModule().getContainer()); }
private URLStreamHandler getFrameworkHandler(String protocol) { if (BundleResourceHandler.OSGI_ENTRY_URL_PROTOCOL.equals(protocol)) { return new org.eclipse.osgi.storage.url.bundleentry.Handler(container.getStorage().getModuleContainer(), null); } else if (BundleResourceHandler.OSGI_RESOURCE_URL_PROTOCOL.equals(protocol)) { return new org.eclipse.osgi.storage.url.bundleresource.Handler(container.getStorage().getModuleContainer(), null); } else if (PROTOCOL_REFERENCE.equals(protocol)) { return new org.eclipse.osgi.storage.url.reference.Handler(container.getConfiguration().getConfiguration(EquinoxLocations.PROP_INSTALL_AREA)); } return null; }
public URL getEntry(String path) { BundleEntry entry = getBundleFile().getEntry(path); if (entry == null) return null; path = BundleFile.fixTrailingSlash(path, entry); try { //use the constant string for the protocol to prevent duplication return Storage.secureAction.getURL(BundleResourceHandler.OSGI_ENTRY_URL_PROTOCOL, Long.toString(getBundleId()) + BundleResourceHandler.BID_FWKID_SEPARATOR + Integer.toString(getStorage().getModuleContainer().hashCode()), 0, path, new Handler(getStorage().getModuleContainer(), entry)); } catch (MalformedURLException e) { return null; } }
public URL getEntry(String path) { BundleEntry entry = getBundleFile().getEntry(path); if (entry == null) return null; path = BundleFile.fixTrailingSlash(path, entry); try { //use the constant string for the protocol to prevent duplication return Storage.secureAction.getURL(BundleResourceHandler.OSGI_ENTRY_URL_PROTOCOL, Long.toString(getBundleId()) + BundleResourceHandler.BID_FWKID_SEPARATOR + Integer.toString(getStorage().getModuleContainer().hashCode()), 0, path, new Handler(getStorage().getModuleContainer(), entry)); } catch (MalformedURLException e) { return null; } }
@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); }
@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); }
@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); }
public static Storage createStorage(EquinoxContainer container) throws IOException, BundleException { Storage storage = new Storage(container); // Do some operations that need to happen on the fully constructed Storage before returning it storage.checkSystemBundle(); storage.discardBundlesOnLoad(); storage.installExtensions(); // TODO hack to make sure all bundles are in UNINSTALLED state before system bundle init is called storage.getModuleContainer().setInitialModuleStates(); return storage; }
public static Storage createStorage(EquinoxContainer container) throws IOException, BundleException { Storage storage = new Storage(container); // Do some operations that need to happen on the fully constructed Storage before returning it storage.checkSystemBundle(); storage.discardBundlesOnLoad(); storage.installExtensions(); // TODO hack to make sure all bundles are in UNINSTALLED state before system bundle init is called storage.getModuleContainer().setInitialModuleStates(); return storage; }
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(); } }
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(); } }