Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-05-16 18:13:56 -0400
committerslewis2018-05-16 18:13:56 -0400
commitd9dca4c6ffcb32f80523b16ed900598c90d667ef (patch)
treeeb91380154eeee49facc3d58c47124bdb8d3ed17
parent2a21185f2be654c769ab1b9908ca75280ad47cb2 (diff)
downloadorg.eclipse.ecf-d9dca4c6ffcb32f80523b16ed900598c90d667ef.tar.gz
org.eclipse.ecf-d9dca4c6ffcb32f80523b16ed900598c90d667ef.tar.xz
org.eclipse.ecf-d9dca4c6ffcb32f80523b16ed900598c90d667ef.zip
Final fix for bndtools-imposed start structure
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManagerImpl.java77
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/pom.xml2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/pom.xml2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java1
9 files changed, 61 insertions, 31 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
index bb5624e6a..94f26adf2 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundle.name
Bundle-SymbolicName: org.eclipse.ecf.osgi.services.remoteserviceadmin
Automatic-Module-Name: org.eclipse.ecf.osgi.services.remoteserviceadmin
-Bundle-Version: 4.6.600.qualifier
+Bundle-Version: 4.6.700.qualifier
Bundle-Activator: org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator
Bundle-Vendor: %bundle.provider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
index dc0adf92a..8a39760af 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.osgi.services.remoteserviceadmin</artifactId>
- <version>4.6.600-SNAPSHOT</version>
+ <version>4.6.700-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManagerImpl.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManagerImpl.java
index 332bdc2d9..555f6f70d 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManagerImpl.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManagerImpl.java
@@ -11,23 +11,31 @@ package org.eclipse.ecf.osgi.services.remoteserviceadmin;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractTopologyManager;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.BundleEvent;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceReference;
import org.osgi.service.remoteserviceadmin.EndpointEvent;
import org.osgi.service.remoteserviceadmin.EndpointEventListener;
import org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent;
+import org.osgi.util.tracker.BundleTracker;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
/**
* @since 4.6
*/
public class TopologyManagerImpl extends AbstractTopologyManager implements EndpointEventListener {
+ public static final int STARTUP_WAIT_TIME = Integer.getInteger("org.eclipse.ecf.osgi.services.remoteserviceadmin.startupWaitTime", 20000); //$NON-NLS-1$
+
public TopologyManagerImpl(BundleContext context) {
super(context);
}
@@ -56,7 +64,7 @@ public class TopologyManagerImpl extends AbstractTopologyManager implements Endp
}
// EventListenerHook impl
- protected void handleEvent(ServiceEvent event, @SuppressWarnings("rawtypes") Map listeners) {
+ protected void handleEvent(ServiceEvent event, Map listeners) {
super.handleEvent(event, listeners);
}
@@ -131,21 +139,41 @@ public class TopologyManagerImpl extends AbstractTopologyManager implements Endp
handleECFEndpointModified((EndpointDescription) endpoint);
}
- protected void exportRegisteredServices(String exportRegisteredSvcsFilter) {
- try {
- final ServiceReference[] existingServiceRefs = getContext()
- .getAllServiceReferences(null, exportRegisteredSvcsFilter);
- // Now export as if the service was registering right now...i.e.
- // perform
- // export
- if (existingServiceRefs != null && existingServiceRefs.length > 0) {
- // After having collected all pre-registered services (with
- // marker prop) we are going to asynchronously remote them.
- // Registering potentially is a long-running operation (due to
- // discovery I/O...) and thus should no be carried out in the
- // OSGi FW thread. (https://bugs.eclipse.org/405027)
- new Thread(new Runnable() {
- public void run() {
+ protected void exportRegisteredServices(final String exportRegisteredSvcsFilter) {
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ final CountDownLatch latch = new CountDownLatch(1);
+ BundleTracker bt = new BundleTracker<Bundle>(getContext(),Bundle.INSTALLED | Bundle.RESOLVED |
+ Bundle.STARTING | Bundle.START_TRANSIENT | Bundle.ACTIVE , new BundleTrackerCustomizer() {
+
+ public Bundle addingBundle(Bundle bundle, BundleEvent event) {
+ if (bundle.getSymbolicName().equals(Activator.PLUGIN_ID))
+ return bundle;
+ return null;
+ }
+
+ public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
+ if (event.getType() == BundleEvent.STARTED)
+ latch.countDown();
+ }
+
+ public void removedBundle(Bundle bundle, BundleEvent event, Object object) {}
+ });
+ bt.open();
+ latch.await(STARTUP_WAIT_TIME, TimeUnit.MILLISECONDS);
+ final ServiceReference[] existingServiceRefs = getContext().getAllServiceReferences(null,
+ exportRegisteredSvcsFilter);
+ // Now export as if the service was registering right now...i.e.
+ // perform
+ // export
+ if (existingServiceRefs != null && existingServiceRefs.length > 0) {
+ // After having collected all pre-registered services (with
+ // marker prop) we are going to asynchronously remote them.
+ // Registering potentially is a long-running operation (due to
+ // discovery I/O...) and thus should no be carried out in the
+ // OSGi FW thread. (https://bugs.eclipse.org/405027)
+
for (int i = 0; i < existingServiceRefs.length; i++) {
// This method will check the service properties for
// remote service props. If previously registered as
@@ -155,14 +183,15 @@ public class TopologyManagerImpl extends AbstractTopologyManager implements Endp
handleServiceRegistering(existingServiceRefs[i]);
}
}
- }, "BasicTopologyManagerPreRegSrvExporter").start(); //$NON-NLS-1$
+ } catch (Exception e) {
+ logError("exportRegisteredServices", //$NON-NLS-1$
+ "Could not retrieve existing service references for exportRegisteredSvcsFilter=" //$NON-NLS-1$
+ + exportRegisteredSvcsFilter,
+ e);
+ }
+
}
- } catch (InvalidSyntaxException e) {
- logError("exportRegisteredServices", //$NON-NLS-1$
- "Could not retrieve existing service references for exportRegisteredSvcsFilter=" //$NON-NLS-1$
- + exportRegisteredSvcsFilter,
- e);
- }
+ }, "BasicTopologyManagerPreRegSrvExporter").start(); //$NON-NLS-1$
}
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
index 49eb41df9..513b33cc1 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.provider.r_osgi;singleton:=true
Automatic-Module-Name: org.eclipse.ecf.provider.r_osgi
-Bundle-Version: 3.6.100.qualifier
+Bundle-Version: 3.6.200.qualifier
Import-Package: ch.ethz.iks.r_osgi;version="[1.0.1,2.0.0)",
org.eclipse.ecf.core.util.reflection,
org.eclipse.ecf.remoteservice.asyncproxy;version="[1.0.0,3.0.0)",
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/pom.xml b/providers/bundles/org.eclipse.ecf.provider.r_osgi/pom.xml
index e670e4421..1d0bf55be 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/pom.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.provider.r_osgi</artifactId>
- <version>3.6.100-SNAPSHOT</version>
+ <version>3.6.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
index 329cb211c..bfdfbc19a 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java
@@ -66,7 +66,7 @@ public final class Activator implements BundleActivator {
plugin = this;
this.context = bc;
// start ch.ethz.iks.r_osgi.remote bundle
- BundleStarter.startDependents(context, new String[] {"ch.ethz.iks.r_osgi.remote"}, Bundle.RESOLVED | Bundle.STARTING); //$NON-NLS-1$
+ BundleStarter.startDependents(context, new String[] {"ch.ethz.iks.r_osgi.remote", "org.eclipse.ecf.provider"}, Bundle.RESOLVED | Bundle.STARTING); //$NON-NLS-1$ //$NON-NLS-2$
r_osgi_tracker = new ServiceTracker(context, RemoteOSGiService.class.getName(), null);
r_osgi_tracker.open();
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
index 6c6898b83..c2e9126fd 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ecf.provider.remoteservice;singleton:=true
Automatic-Module-Name: org.eclipse.ecf.provider.remoteservice
-Bundle-Version: 4.4.0.qualifier
+Bundle-Version: 4.4.100.qualifier
Bundle-Activator: org.eclipse.ecf.internal.provider.remoteservice.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/pom.xml b/providers/bundles/org.eclipse.ecf.provider.remoteservice/pom.xml
index 5bae02316..592c6d3c6 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/pom.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.provider.remoteservice</artifactId>
- <version>4.4.0-SNAPSHOT</version>
+ <version>4.4.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java
index 30a6342e8..cda1e65d6 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java
@@ -54,6 +54,7 @@ public class Activator implements BundleActivator {
public void start(final BundleContext ctxt) throws Exception {
this.context = ctxt;
+ BundleStarter.startDependents(this.context, new String[] {"org.eclipse.ecf.provider", "org.eclipse.ecf.sharedobject"}, Bundle.RESOLVED | Bundle.STARTING); //$NON-NLS-1$ //$NON-NLS-2$
SafeRunner.run(new ExtensionRegistryRunnable(this.context) {
protected void runWithoutRegistry() throws Exception {
ctxt.registerService(Namespace.class, new RemoteServiceNamespace(org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace.NAME, "Generic remote service namespace"), null); //$NON-NLS-1$

Back to the top