@Override public Void run() throws BundleException { addExtensionContent0(revisions, systemModule); return null; } });
private static Method findAddURLMethod(ClassLoader cl, String name) { if (cl == null) return null; return findMethod(cl.getClass(), name, new Class[] {URL.class}); }
File[] files = getExtensionFiles(revision); if (files == null) { return; continue; try { callAddURLMethod(StorageUtil.encodeFileURL(files[i])); } catch (InvocationTargetException e) { throw new BundleException("Error adding extension content.", e); //$NON-NLS-1$ BundleContext systemContext = systemModule.getBundle().getBundleContext(); if (systemContext != null) { startExtensionActivator(revision, systemContext);
public void startExtensionActivators(BundleContext context) { // First start the hook registry activators // TODO not sure we really need these anymore HookRegistry hookRegistry = configuration.getHookRegistry(); List<ActivatorHookFactory> activatorHookFactories = hookRegistry.getActivatorHookFactories(); for (ActivatorHookFactory activatorFactory : activatorHookFactories) { BundleActivator activator = activatorFactory.createActivator(); try { startActivator(activator, context, null); } catch (Exception e) { configuration.getHookRegistry().getContainer().getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, null, e); } } // start the extension bundle activators. In Equinox we let // framework extensions define Bundle-Activator headers. ModuleWiring systemWiring = (ModuleWiring) context.getBundle().adapt(BundleWiring.class); if (systemWiring != null) { List<ModuleWire> extensionWires = systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE); for (ModuleWire extensionWire : extensionWires) { ModuleRevision extensionRevision = extensionWire.getRequirer(); startExtensionActivator(extensionRevision, context); } } }
private void installExtensions() { Module systemModule = moduleContainer.getModule(0); ModuleRevision systemRevision = systemModule == null ? null : systemModule.getCurrentRevision(); ModuleWiring systemWiring = systemRevision == null ? null : systemRevision.getWiring(); if (systemWiring == null) { return; } Collection<ModuleRevision> fragments = new ArrayList<ModuleRevision>(); for (ModuleWire hostWire : systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) { fragments.add(hostWire.getRequirer()); } try { getExtensionInstaller().addExtensionContent(fragments, null); } catch (BundleException e) { getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, e.getMessage(), e); } }
public void stop(BundleContext bc) throws Exception { EquinoxBundle bundle = (EquinoxBundle) bc.getBundle(); bundle.getEquinoxContainer().getStorage().getExtensionInstaller().stopExtensionActivators(bc); FrameworkDebugOptions dbgOptions = (FrameworkDebugOptions) bundle.getEquinoxContainer().getConfiguration().getDebugOptions(); dbgOptions.stop(bc); urlFactoryManager.uninstallHandlerFactories(); // unregister services for (ServiceRegistration<?> registration : registrations) registration.unregister(); registrations.clear(); bundle.getEquinoxContainer().getLogServices().stop(bc); unintallSecurityManager(); bundle.getEquinoxContainer().systemStop(bc); }
private void startExtensionActivator(ModuleRevision extensionRevision, BundleContext context) { List<Capability> metadata = extensionRevision.getCapabilities(EquinoxModuleDataNamespace.MODULE_DATA_NAMESPACE); if (metadata.isEmpty()) { return; } String activatorName = (String) metadata.get(0).getAttributes().get(EquinoxModuleDataNamespace.CAPABILITY_ACTIVATOR); if (activatorName == null) { return; } BundleActivator activator = null; try { Class<?> activatorClass = Class.forName(activatorName); activator = (BundleActivator) activatorClass.newInstance(); startActivator(activator, context, extensionRevision.getBundle()); } catch (Exception e) { BundleException eventException; if (activator == null) { eventException = new BundleException(Msg.BundleContextImpl_LoadActivatorError, BundleException.ACTIVATOR_ERROR, e); } else { eventException = new BundleException(NLS.bind(Msg.BUNDLE_ACTIVATOR_EXCEPTION, new Object[] {activator.getClass(), "start", extensionRevision.getSymbolicName()}), BundleException.ACTIVATOR_ERROR, e); //$NON-NLS-1$ } configuration.getHookRegistry().getContainer().getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, extensionRevision.getBundle(), eventException); } }
bundle.getEquinoxContainer().getStorage().getExtensionInstaller().startExtensionActivators(bc);
mruList = new MRUBundleFileList(getBundleFileLimit(container.getConfiguration()), container.getConfiguration().getDebug()); equinoxContainer = container; extensionInstaller = new FrameworkExtensionInstaller(container.getConfiguration()); allowRestrictedProvides = Boolean.parseBoolean(container.getConfiguration().getConfiguration(EquinoxConfiguration.PROP_ALLOW_RESTRICTED_PROVIDES));
File[] files = getExtensionFiles(revision); if (files == null) { return; continue; try { callAddURLMethod(StorageUtil.encodeFileURL(files[i])); } catch (InvocationTargetException e) { throw new BundleException("Error adding extension content.", e); //$NON-NLS-1$ for (ModuleRevision revision : revisions) { if (systemContext != null) { startExtensionActivator(revision, systemContext);
public void startExtensionActivators(BundleContext context) { // First start the hook registry activators // TODO not sure we really need these anymore HookRegistry hookRegistry = configuration.getHookRegistry(); List<ActivatorHookFactory> activatorHookFactories = hookRegistry.getActivatorHookFactories(); for (ActivatorHookFactory activatorFactory : activatorHookFactories) { BundleActivator activator = activatorFactory.createActivator(); try { startActivator(activator, context, null); } catch (Exception e) { configuration.getHookRegistry().getContainer().getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, null, e); } } // start the extension bundle activators. In Equinox we let // framework extensions define Bundle-Activator headers. ModuleWiring systemWiring = (ModuleWiring) context.getBundle().adapt(BundleWiring.class); if (systemWiring != null) { List<ModuleWire> extensionWires = systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE); for (ModuleWire extensionWire : extensionWires) { ModuleRevision extensionRevision = extensionWire.getRequirer(); startExtensionActivator(extensionRevision, context); } } }
private void installExtensions() { Module systemModule = moduleContainer.getModule(0); ModuleRevision systemRevision = systemModule == null ? null : systemModule.getCurrentRevision(); ModuleWiring systemWiring = systemRevision == null ? null : systemRevision.getWiring(); if (systemWiring == null) { return; } Collection<ModuleRevision> fragments = new ArrayList<>(); for (ModuleWire hostWire : systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) { fragments.add(hostWire.getRequirer()); } try { getExtensionInstaller().addExtensionContent(fragments, null); } catch (BundleException e) { getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, e.getMessage(), e); } }
public void stop(BundleContext bc) throws Exception { EquinoxBundle bundle = (EquinoxBundle) bc.getBundle(); bundle.getEquinoxContainer().getStorage().getExtensionInstaller().stopExtensionActivators(bc); FrameworkDebugOptions dbgOptions = (FrameworkDebugOptions) bundle.getEquinoxContainer().getConfiguration().getDebugOptions(); dbgOptions.stop(bc); urlFactoryManager.uninstallHandlerFactories(); // unregister services for (ServiceRegistration<?> registration : registrations) registration.unregister(); registrations.clear(); bundle.getEquinoxContainer().getLogServices().stop(bc); unintallSecurityManager(); bundle.getEquinoxContainer().systemStop(bc); }
private void startExtensionActivator(ModuleRevision extensionRevision, BundleContext context) { List<Capability> metadata = extensionRevision.getCapabilities(EquinoxModuleDataNamespace.MODULE_DATA_NAMESPACE); if (metadata.isEmpty()) { return; } String activatorName = (String) metadata.get(0).getAttributes().get(EquinoxModuleDataNamespace.CAPABILITY_ACTIVATOR); if (activatorName == null) { return; } BundleActivator activator = null; try { Class<?> activatorClass = Class.forName(activatorName); activator = (BundleActivator) activatorClass.newInstance(); startActivator(activator, context, extensionRevision.getBundle()); } catch (Throwable e) { BundleException eventException; if (activator == null) { eventException = new BundleException(Msg.BundleContextImpl_LoadActivatorError, BundleException.ACTIVATOR_ERROR, e); } else { eventException = new BundleException(NLS.bind(Msg.BUNDLE_ACTIVATOR_EXCEPTION, new Object[] {activator.getClass(), "start", extensionRevision.getSymbolicName()}), BundleException.ACTIVATOR_ERROR, e); //$NON-NLS-1$ } configuration.getHookRegistry().getContainer().getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, extensionRevision.getBundle(), eventException); } }
bundle.getEquinoxContainer().getStorage().getExtensionInstaller().startExtensionActivators(bc);
mruList = new MRUBundleFileList(getBundleFileLimit(container.getConfiguration()), container.getConfiguration().getDebug()); equinoxContainer = container; extensionInstaller = new FrameworkExtensionInstaller(container.getConfiguration()); allowRestrictedProvides = Boolean.parseBoolean(container.getConfiguration().getConfiguration(EquinoxConfiguration.PROP_ALLOW_RESTRICTED_PROVIDES));
File[] files = getExtensionFiles(revision); if (files == null) { return; continue; try { callAddURLMethod(StorageUtil.encodeFileURL(files[i])); } catch (InvocationTargetException e) { throw new BundleException("Error adding extension content.", e); //$NON-NLS-1$ BundleContext systemContext = systemModule.getBundle().getBundleContext(); if (systemContext != null) { startExtensionActivator(revision, systemContext);
public void startExtensionActivators(BundleContext context) { // First start the hook registry activators // TODO not sure we really need these anymore HookRegistry hookRegistry = configuration.getHookRegistry(); List<ActivatorHookFactory> activatorHookFactories = hookRegistry.getActivatorHookFactories(); for (ActivatorHookFactory activatorFactory : activatorHookFactories) { BundleActivator activator = activatorFactory.createActivator(); try { startActivator(activator, context, null); } catch (Exception e) { configuration.getHookRegistry().getContainer().getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, null, e); } } // start the extension bundle activators. In Equinox we let // framework extensions define Bundle-Activator headers. ModuleWiring systemWiring = (ModuleWiring) context.getBundle().adapt(BundleWiring.class); if (systemWiring != null) { List<ModuleWire> extensionWires = systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE); for (ModuleWire extensionWire : extensionWires) { ModuleRevision extensionRevision = extensionWire.getRequirer(); startExtensionActivator(extensionRevision, context); } } }
@Override public Void run() throws BundleException { addExtensionContent0(revision, systemModule); return null; } });
private void installExtensions() { Module systemModule = moduleContainer.getModule(0); ModuleRevision systemRevision = systemModule == null ? null : systemModule.getCurrentRevision(); ModuleWiring systemWiring = systemRevision == null ? null : systemRevision.getWiring(); if (systemWiring == null) { return; } Collection<ModuleRevision> fragments = new ArrayList<ModuleRevision>(); for (ModuleWire hostWire : systemWiring.getProvidedModuleWires(HostNamespace.HOST_NAMESPACE)) { fragments.add(hostWire.getRequirer()); } try { getExtensionInstaller().addExtensionContent(fragments, null); } catch (BundleException e) { getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, e.getMessage(), e); } }