Search in sources :

Example 1 with HookRegistry

use of org.eclipse.osgi.internal.hookregistry.HookRegistry in project rt.equinox.framework by eclipse.

the class FrameworkExtensionInstaller method startExtensionActivators.

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);
        }
    }
}
Also used : ModuleWire(org.eclipse.osgi.container.ModuleWire) ActivatorHookFactory(org.eclipse.osgi.internal.hookregistry.ActivatorHookFactory) BundleActivator(org.osgi.framework.BundleActivator) BundleWiring(org.osgi.framework.wiring.BundleWiring) ModuleWiring(org.eclipse.osgi.container.ModuleWiring) HookRegistry(org.eclipse.osgi.internal.hookregistry.HookRegistry) ModuleRevision(org.eclipse.osgi.container.ModuleRevision) BundleException(org.osgi.framework.BundleException) PrivilegedActionException(java.security.PrivilegedActionException) MalformedURLException(java.net.MalformedURLException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 PrivilegedActionException (java.security.PrivilegedActionException)1 ModuleRevision (org.eclipse.osgi.container.ModuleRevision)1 ModuleWire (org.eclipse.osgi.container.ModuleWire)1 ModuleWiring (org.eclipse.osgi.container.ModuleWiring)1 ActivatorHookFactory (org.eclipse.osgi.internal.hookregistry.ActivatorHookFactory)1 HookRegistry (org.eclipse.osgi.internal.hookregistry.HookRegistry)1 BundleActivator (org.osgi.framework.BundleActivator)1 BundleException (org.osgi.framework.BundleException)1 BundleWiring (org.osgi.framework.wiring.BundleWiring)1