public Bundle installBundle(String location, InputStream input) throws BundleException { throw new BundleException("pojosr can't do that"); }
@Override public void update() throws BundleException { throw new BundleException("pojosr bundles can't be updated"); }
@Override public void uninstall() throws BundleException { throw new BundleException("pojosr bundles can't be uninstalled"); }
/** * Internal worker to stop a bundle. * * @param options */ protected void stopWorker(int options) throws BundleException { throw new BundleException(NLS.bind(Msg.BUNDLE_FRAGMENT_STOP, this), BundleException.INVALID_OPERATION); }
public void update(InputStream in) throws BundleException { try { in.close(); } catch (IOException e) { // ignore } throw new BundleException("Cannot update composite bundles", BundleException.INVALID_OPERATION); //$NON-NLS-1$ } }
void handleHookException(Throwable t, Object hook, String method) { if (debug.DEBUG_HOOKS) { Debug.println(hook.getClass().getName() + "." + method + "() exception:"); //$NON-NLS-1$ //$NON-NLS-2$ if (t != null) Debug.printStackTrace(t); } String message = NLS.bind(Msg.SERVICE_FACTORY_EXCEPTION, hook.getClass().getName(), method); throw new RuntimeException(message, new BundleException(message, BundleException.REJECTED_BY_HOOK, t)); }
void handleHookException(Throwable t, Object hook, String method) { if (debug.DEBUG_HOOKS) { Debug.println(hook.getClass().getName() + "." + method + "() exception:"); //$NON-NLS-1$ //$NON-NLS-2$ if (t != null) Debug.printStackTrace(t); } String message = NLS.bind(Msg.SERVICE_FACTORY_EXCEPTION, hook.getClass().getName(), method); throw new RuntimeException(message, new BundleException(message, BundleException.REJECTED_BY_HOOK, t)); }
private ResolverHook checkActiveRemoved(TrackedResolverHookFactory rhf) throws BundleException { ResolverHook rh = rhf.getResolverHook(); if (null == rh) { throw new BundleException("Resolver hook service was unregistered", BundleException.REJECTED_BY_HOOK); } return rh; }
void handleHookException(Throwable t, Object hook, String method) { if (debug.DEBUG_HOOKS) { Debug.println(hook.getClass().getName() + "." + method + "() exception:"); //$NON-NLS-1$ //$NON-NLS-2$ if (t != null) Debug.printStackTrace(t); } String message = NLS.bind(Msg.SERVICE_FACTORY_EXCEPTION, hook.getClass().getName(), method); throw new RuntimeException(message, new BundleException(message, BundleException.REJECTED_BY_HOOK, t)); }
@Override public void updateBundle(Bundle bundle, String uri, InputStream is) throws BundleException { // We need to wrap the bundle to insert a Bundle-UpdateLocation header try { File file = BundleUtils.fixBundleWithUpdateLocation(is, uri); bundle.update(new FileInputStream(file)); file.delete(); } catch (IOException e) { throw new BundleException("Unable to update bundle", e); } }
@Override public void uninstall() throws BundleException { getEquinoxContainer().checkAdminPermission(this, AdminPermission.LIFECYCLE); throw new BundleException(Msg.BUNDLE_SYSTEMBUNDLE_UNINSTALL_EXCEPTION, BundleException.INVALID_OPERATION); }
private static void checkExtensionBundle(String headerKey, ManifestElement[] elements) throws BundleException { if (elements.length == 0 || elements[0].getDirective(Constants.EXTENSION_DIRECTIVE) == null) return; String hostName = elements[0].getValue(); // XXX: The extension bundle check is done against system.bundle and org.eclipse.osgi if (!hostName.equals(Constants.SYSTEM_BUNDLE_SYMBOLICNAME) && !hostName.equals(Constants.getInternalSymbolicName())) { String message = NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, headerKey, elements[0].toString()); throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_EXTENSION_ERROR, hostName), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ } }
private void checkFragment() throws BundleException { ModuleRevision current = getCurrentRevision(); if ((current.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) { throw new BundleException(Msg.Module_Fragment_InvalidOperation, BundleException.INVALID_OPERATION); } }
@Override public void uninstall() throws BundleException { getEquinoxContainer().checkAdminPermission(this, AdminPermission.LIFECYCLE); throw new BundleException(Msg.BUNDLE_SYSTEMBUNDLE_UNINSTALL_EXCEPTION, BundleException.INVALID_OPERATION); }
@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) { throw new BundleException("Error reading bundle content.", e); //$NON-NLS-1$ } }
public static Headers<String, String> parseManifest(InputStream in) throws BundleException { Headers<String, String> headers = new Headers<>(10); try { ManifestElement.parseBundleManifest(in, headers); } catch (IOException e) { throw new BundleException(Msg.MANIFEST_IOEXCEPTION, BundleException.MANIFEST_ERROR, e); } headers.setReadOnly(); return headers; }
public static Headers<String, String> parseManifest(InputStream in) throws BundleException { Headers<String, String> headers = new Headers<String, String>(10); try { ManifestElement.parseBundleManifest(in, headers); } catch (IOException e) { throw new BundleException(Msg.MANIFEST_IOEXCEPTION, BundleException.MANIFEST_ERROR, e); } headers.setReadOnly(); return headers; }
@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) { throw new BundleException("Error reading bundle content.", e); //$NON-NLS-1$ } }
public Bundle installBundle(String location, InputStream in) throws BundleException { checkValid(); try { URLConnection content = container.getStorage().getContentConnection(null, location, in); Generation generation = container.getStorage().install(bundle.getModule(), location, content); return generation.getRevision().getBundle(); } catch (IOException e) { throw new BundleException("Error reading bundle content.", e); //$NON-NLS-1$ } }
public Bundle installBundle(String location, InputStream in) throws BundleException { checkValid(); try { URLConnection content = container.getStorage().getContentConnection(null, location, in); Generation generation = container.getStorage().install(bundle.getModule(), location, content); return generation.getRevision().getBundle(); } catch (IOException e) { throw new BundleException("Error reading bundle content.", e); //$NON-NLS-1$ } }