diff options
author | Lars Vogel | 2021-02-04 14:17:22 +0000 |
---|---|---|
committer | Lars Vogel | 2021-02-04 18:31:36 +0000 |
commit | 36199fab0abc9ab23d30a7ddfc401c7249a8b84f (patch) | |
tree | c86b71746f83d8330793ee33e51b93092a566121 | |
parent | 1ca15698cf34484b505448d7ba9c3a0d8244c42c (diff) | |
download | rt.equinox.bundles-36199fab0abc9ab23d30a7ddfc401c7249a8b84f.tar.gz rt.equinox.bundles-36199fab0abc9ab23d30a7ddfc401c7249a8b84f.tar.xz rt.equinox.bundles-36199fab0abc9ab23d30a7ddfc401c7249a8b84f.zip |
Bug 570902 - Remove PROP_USE_DS and activator fromY20210205-1200I20210207-1800I20210206-1800I20210206-0720I20210206-0050I20210205-1800I20210204-2320I20210204-1800I20210204-1430
org.eclipse.equinox.event
This code was in place to allow equinox.event to work without DS. We
should enforce that one is installed along with equinox.event.
Also removes activation from test code.
Change-Id: I24efbf466dba9ae4a8629cf2093cf84ace1adc06
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
3 files changed, 2 insertions, 56 deletions
diff --git a/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/event/tests/EventAdminTest.java b/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/event/tests/EventAdminTest.java index 3d8039e89..0f9256f85 100644 --- a/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/event/tests/EventAdminTest.java +++ b/bundles/org.eclipse.equinox.compendium.tests/src/org/eclipse/equinox/event/tests/EventAdminTest.java @@ -29,7 +29,6 @@ public class EventAdminTest { @Before public void setUp() throws Exception { - Activator.getBundle(Activator.BUNDLE_EVENT).start(); eventAdminReference = Activator.getBundleContext().getServiceReference(EventAdmin.class); eventAdmin = Activator.getBundleContext().getService(eventAdminReference); } @@ -37,7 +36,6 @@ public class EventAdminTest { @After public void tearDown() throws Exception { Activator.getBundleContext().ungetService(eventAdminReference); - Activator.getBundle(Activator.BUNDLE_EVENT).stop(); } /* diff --git a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF index 3b8e7a50c..c92a7cd38 100644 --- a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF @@ -2,7 +2,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-Version: 1.6.0.qualifier Bundle-SymbolicName: org.eclipse.equinox.event -Bundle-Activator: org.eclipse.equinox.internal.event.Activator Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.1.0", org.eclipse.osgi.util;version="1.1.0", org.osgi.framework;version="1.6.0", @@ -24,4 +23,6 @@ Provide-Capability: osgi.implementation="osgi.event"; uses:="org.osgi.service.event"; version:Version="1.4" +Require-Capability: osgi.extender; + filter:="(&(osgi.extender=osgi.component)(version>=1.0)(!(version>=2.0)))" Automatic-Module-Name: org.eclipse.equinox.event diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java deleted file mode 100644 index 042fae27e..000000000 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2018 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.equinox.internal.event; - -import org.osgi.framework.*; -import org.osgi.service.event.EventAdmin; - -public class Activator implements BundleActivator { - private static final String PROP_USE_DS = "equinox.use.ds"; //$NON-NLS-1$ - private ServiceRegistration<EventAdmin> eventAdminService; - private EventComponent eventAdmin; - - @Override - public void start(BundleContext bundleContext) throws InvalidSyntaxException { - if (Boolean.valueOf(bundleContext.getProperty(PROP_USE_DS)).booleanValue()) - return; // If this property is set we assume DS is being used. - String serviceName = EventAdmin.class.getName(); - Filter serviceFilter = bundleContext.createFilter("(objectclass=" + serviceName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - //don't register the service if this bundle has already registered it declaratively - ServiceReference<?>[] refs = bundleContext.getBundle().getRegisteredServices(); - if (refs != null) { - for (ServiceReference<?> ref : refs) { - if (serviceFilter.match(ref)) { - return; // We found a service registered by this bundle already - } - } - } - - eventAdmin = new EventComponent(); - eventAdmin.activate(bundleContext); - eventAdminService = bundleContext.registerService(EventAdmin.class, eventAdmin, null); - } - - @Override - public void stop(BundleContext bundleContext) { - if (eventAdmin != null) { - eventAdminService.unregister(); - eventAdmin.deactivate(bundleContext); - } - } -} |