Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2019-10-09 01:14:27 -0400
committerslewis2019-10-09 01:14:27 -0400
commitbeac2d63527012932d01c3fcbd6b32c21ca6dc21 (patch)
treeac14779361a78226bb1854aa276fcd27cfc59833
parentff54a5b31b58b38a9092b26e17e2e6ce461648ee (diff)
downloadorg.eclipse.ecf-beac2d63527012932d01c3fcbd6b32c21ca6dc21.tar.gz
org.eclipse.ecf-beac2d63527012932d01c3fcbd6b32c21ca6dc21.tar.xz
org.eclipse.ecf-beac2d63527012932d01c3fcbd6b32c21ca6dc21.zip
Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=551944
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF8
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/OSGI-INF/org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager.xml9
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/pom.xml2
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/Activator.java46
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java17
5 files changed, 61 insertions, 21 deletions
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
index dde418079..225960ff0 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
@@ -3,16 +3,16 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ecf.osgi.services.distribution
Automatic-Module-Name: org.eclipse.ecf.osgi.services.distribution
-Bundle-Version: 2.1.200.qualifier
+Bundle-Version: 2.1.300.qualifier
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.ecf.osgi.services.remoteserviceadmin;version="[1.0.0,2.0.0)",
+Import-Package: org.eclipse.ecf.core.util;version="3.6.0",
+ org.eclipse.ecf.osgi.services.remoteserviceadmin;version="[1.0.0,2.0.0)",
org.osgi.framework;version="[1.3.0,2.0.0)",
org.osgi.framework.hooks.service;version="[1.1.0,2.0.0)",
- org.osgi.service.component.annotations;version="[1.2.0,2.0.0)";resolution:=optional,
org.osgi.service.remoteserviceadmin;version="[1.0.0,2.0.0)"
Bundle-Localization: plugin
Export-Package: org.eclipse.ecf.osgi.services.distribution;version="2.0.0";x-internal:=true
Bundle-ActivationPolicy: lazy
Provide-Capability: osgi.remoteserviceadmin.topology; policy:List<String>="promiscuous"; version:Version=1.1
-Service-Component: OSGI-INF/org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager.xml
+Bundle-Activator: org.eclipse.ecf.internal.osgi.services.distribution.Activator
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/OSGI-INF/org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager.xml b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/OSGI-INF/org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager.xml
deleted file mode 100644
index 352d7358c..000000000
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/OSGI-INF/org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager.xml
+++ /dev/null
@@ -1,9 +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="true" name="org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager">
- <service>
- <provide interface="org.osgi.framework.hooks.service.EventListenerHook"/>
- <provide interface="org.osgi.service.remoteserviceadmin.RemoteServiceAdminListener"/>
- <provide interface="org.eclipse.ecf.osgi.services.remoteserviceadmin.ITopologyManager"/>
- </service>
- <implementation class="org.eclipse.ecf.internal.osgi.services.distribution.BasicTopologyManager"/>
-</scr:component> \ No newline at end of file
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/pom.xml b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/pom.xml
index c5120b974..053a25f0d 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/pom.xml
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.osgi.services.distribution</artifactId>
- <version>2.1.200-SNAPSHOT</version>
+ <version>2.1.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/Activator.java b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/Activator.java
new file mode 100644
index 000000000..1c3f2d547
--- /dev/null
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/Activator.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Composent, Inc. 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:
+ * Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.internal.osgi.services.distribution;
+
+import org.eclipse.ecf.core.util.BundleStarter;
+import org.eclipse.ecf.osgi.services.remoteserviceadmin.ITopologyManager;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.hooks.service.EventListenerHook;
+import org.osgi.service.remoteserviceadmin.RemoteServiceAdminListener;
+
+public class Activator implements BundleActivator {
+
+ private static final String[] DEPENDENTS = new String[] { "org.eclipse.ecf", //$NON-NLS-1$
+ "org.eclipse.ecf.osgi.services.remoteserviceadmin" }; //$NON-NLS-1$
+ private BasicTopologyManager topologyManager;
+ private ServiceRegistration topologyManagerRegistration;
+
+ public void start(BundleContext context) throws Exception {
+ BundleStarter.startDependents(context, DEPENDENTS, Bundle.RESOLVED | Bundle.STARTING);
+ this.topologyManager = new BasicTopologyManager();
+ this.topologyManager.start(context);
+ this.topologyManagerRegistration = context.registerService(new String[] { EventListenerHook.class.getName(),
+ RemoteServiceAdminListener.class.getName(), ITopologyManager.class.getName() }, this.topologyManager,
+ null);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ if (topologyManagerRegistration != null) {
+ topologyManagerRegistration.unregister();
+ topologyManagerRegistration = null;
+ this.topologyManager.deactivate();
+ this.topologyManager = null;
+ }
+ }
+
+}
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
index ab17a6e04..602b6d78c 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Composent, Inc. and others. All rights reserved. This
+ * Copyright (c) 2019 Composent, Inc. 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
@@ -9,27 +9,30 @@
******************************************************************************/
package org.eclipse.ecf.internal.osgi.services.distribution;
+import java.util.HashMap;
import java.util.Map;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.ITopologyManager;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.TopologyManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.hooks.service.EventListenerHook;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.remoteserviceadmin.RemoteServiceAdminListener;
-@Component(immediate = true)
public class BasicTopologyManager extends TopologyManager
implements EventListenerHook, RemoteServiceAdminListener, ITopologyManager {
- @Activate
+ public void start(BundleContext context) throws Exception {
+ activate(context, new HashMap<String, Object>());
+ }
+
@Override
protected void activate(BundleContext context, Map<String, ?> properties) throws Exception {
super.activate(context, properties);
}
- @Deactivate
+ public void stop() {
+ deactivate();
+ }
+
@Override
protected void deactivate() {
super.deactivate();

Back to the top