aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-09-12 06:24:36 (EDT)
committerJohn Ross2013-09-12 06:24:36 (EDT)
commit210b46ddf07da5aa7a24fc973a58042e98125692 (patch)
treea1dbe1b0ca9ffa13b36ebf7e790bbb5baf1df64f
parent7ef2e7181820e5c43a35867dcc57d079f5c7d47f (diff)
downloadrt.equinox.bundles-210b46ddf07da5aa7a24fc973a58042e98125692.zip
rt.equinox.bundles-210b46ddf07da5aa7a24fc973a58042e98125692.tar.gz
rt.equinox.bundles-210b46ddf07da5aa7a24fc973a58042e98125692.tar.bz2
Bug 417024 - Remove use of DS from coordinator impl
Remove all traces of DS support. Update copyright. Bump bundle version from 1.2.0 to 1.3.0.
-rw-r--r--bundles/org.eclipse.equinox.coordinator/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.coordinator/OSGI-INF/component.xml7
-rw-r--r--bundles/org.eclipse.equinox.coordinator/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/Activator.java15
-rw-r--r--bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorComponent.java64
5 files changed, 5 insertions, 87 deletions
diff --git a/bundles/org.eclipse.equinox.coordinator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.coordinator/META-INF/MANIFEST.MF
index 0b27e5d..59712ab 100644
--- a/bundles/org.eclipse.equinox.coordinator/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.coordinator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.equinox.coordinator
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.equinox.coordinator.Activator
Bundle-Vendor: %bundleVendor
Import-Package: org.eclipse.osgi.util;version="[1.1,2.0)",
@@ -13,6 +13,4 @@ Import-Package: org.eclipse.osgi.util;version="[1.1,2.0)",
org.osgi.util.tracker;version="[1.5,2.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
Export-Package: org.osgi.service.coordinator;version="1.0.1"
-Service-Component: OSGI-INF/component.xml
diff --git a/bundles/org.eclipse.equinox.coordinator/OSGI-INF/component.xml b/bundles/org.eclipse.equinox.coordinator/OSGI-INF/component.xml
deleted file mode 100644
index 861248e..0000000
--- a/bundles/org.eclipse.equinox.coordinator/OSGI-INF/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" immediate="false" name="org.eclipse.equinox.coordinator">
- <implementation class="org.eclipse.equinox.coordinator.CoordinatorComponent"/>
- <service servicefactory="true">
- <provide interface="org.osgi.service.coordinator.Coordinator"/>
- </service>
-</scr:component>
diff --git a/bundles/org.eclipse.equinox.coordinator/pom.xml b/bundles/org.eclipse.equinox.coordinator/pom.xml
index 358e220..4ecce99 100644
--- a/bundles/org.eclipse.equinox.coordinator/pom.xml
+++ b/bundles/org.eclipse.equinox.coordinator/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.coordinator</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/Activator.java b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/Activator.java
index 86ae4b3..d0e87e9 100644
--- a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/Activator.java
+++ b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,19 +19,12 @@ import org.osgi.framework.ServiceRegistration;
import org.osgi.service.coordinator.Coordinator;
public class Activator implements BundleActivator {
- // Static so the factory can be used by both DS and standard OSGi.
- static volatile CoordinatorServiceFactory factory;
-
+ private CoordinatorServiceFactory factory;
private ServiceRegistration<Coordinator> registration;
public void start(BundleContext bundleContext) throws Exception {
- // Instantiate the factory to be used by both DS and standard OSGi. In the case of DS, the
- // start method is guaranteed to be called before any components are created.
factory = new CoordinatorServiceFactory(bundleContext);
- if (Boolean.valueOf(bundleContext.getProperty("equinox.use.ds")).booleanValue()) //$NON-NLS-1$
- return; // If this property is set we assume DS is being used.
Dictionary<String, Object> properties = new Hashtable<String, Object>();
- // TODO Add desired properties (bundle vendor, etc.).
@SuppressWarnings({"unchecked"})
// Use local variable to avoid suppressing unchecked warnings at method level.
ServiceRegistration<Coordinator> reg = (ServiceRegistration<Coordinator>) bundleContext.registerService(Coordinator.class.getName(), factory, properties);
@@ -39,9 +32,7 @@ public class Activator implements BundleActivator {
}
public void stop(BundleContext bundleContext) throws Exception {
- // Will be null when using DS.
- if (registration != null)
- registration.unregister();
+ registration.unregister();
factory.shutdown();
CoordinationWeakReference.processOrphanedCoordinations();
}
diff --git a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorComponent.java b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorComponent.java
deleted file mode 100644
index 31b8e3e..0000000
--- a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorComponent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.coordinator;
-
-import java.util.Collection;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.service.component.ComponentContext;
-import org.osgi.service.coordinator.Coordination;
-import org.osgi.service.coordinator.CoordinationException;
-import org.osgi.service.coordinator.Coordinator;
-import org.osgi.service.coordinator.Participant;
-
-public class CoordinatorComponent implements Coordinator {
- private volatile Coordinator coordinator;
-
- public boolean addParticipant(Participant participant) throws CoordinationException {
- return coordinator.addParticipant(participant);
- }
-
- public Coordination begin(String name, long timeout) {
- return coordinator.begin(name, timeout);
- }
-
- public Coordination create(String name, long timeout) {
- return coordinator.create(name, timeout);
- }
-
- public boolean fail(Throwable reason) {
- return coordinator.fail(reason);
- }
-
- public Coordination getCoordination(long id) {
- return coordinator.getCoordination(id);
- }
-
- public Collection<Coordination> getCoordinations() {
- return coordinator.getCoordinations();
- }
-
- public Coordination peek() {
- return coordinator.peek();
- }
-
- public Coordination pop() {
- return coordinator.pop();
- }
-
- void activate(ComponentContext componentContext) {
- coordinator = Activator.factory.getService(componentContext.getUsingBundle(), null);
- }
-
- void deactivate(BundleContext context) {
- ((CoordinatorImpl) coordinator).shutdown();
- }
-}