Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rest/META-INF/MANIFEST.MF1
-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/OSGI-INF/permissions.perm2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java53
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/META-INF/MANIFEST.MF1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.xmpp/META-INF/MANIFEST.MF1
7 files changed, 39 insertions, 22 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rest/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice.rest/META-INF/MANIFEST.MF
index 3740a190c..28dccc975 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rest/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.rest/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-SymbolicName: org.eclipse.ecf.remoteservice.rest;singleton:=true
Automatic-Module-Name: org.eclipse.ecf.remoteservice.rest
Bundle-Version: 2.7.200.qualifier
Bundle-Activator: org.eclipse.ecf.internal.remoteservice.rest.Activator
+Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: global
DynamicImport-Package: *
Bundle-RequiredExecutionEnvironment: J2SE-1.4
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 43676e81b..0dc236530 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
@@ -29,9 +29,11 @@ Import-Package: javax.xml.parsers,
org.osgi.framework;version="1.3.0",
org.osgi.framework.hooks.service;version="1.1.0",
org.osgi.framework.wiring;version="[1.0,2.0)",
+ org.osgi.resource;version="1.0.0",
org.osgi.service.event,
org.osgi.service.log,
org.osgi.service.remoteserviceadmin;version="1.1",
+ org.osgi.service.remoteserviceadmin.namespace;version="1.0.0",
org.osgi.util.tracker,
org.xml.sax
DynamicImport-Package: *
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/OSGI-INF/permissions.perm b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/OSGI-INF/permissions.perm
index 57ed99092..c91be5f7f 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/OSGI-INF/permissions.perm
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/OSGI-INF/permissions.perm
@@ -17,11 +17,13 @@
(org.osgi.framework.PackagePermission "org.eclipse.equinox.concurrent.future" "import")
(org.osgi.framework.PackagePermission "org.eclipse.osgi.framework.eventmgr" "import")
(org.osgi.framework.PackagePermission "org.osgi.framework" "import")
+(org.osgi.framework.PackagePermission "org.osgi.resource" "import")
(org.osgi.framework.PackagePermission "org.osgi.framework.hooks.service" "import")
(org.osgi.framework.PackagePermission "org.osgi.framework.wiring" "import")
(org.osgi.framework.PackagePermission "org.osgi.service.event" "import")
(org.osgi.framework.PackagePermission "org.osgi.service.log" "import")
(org.osgi.framework.PackagePermission "org.osgi.service.remoteserviceadmin" "import")
+(org.osgi.framework.PackagePermission "org.osgi.service.remoteserviceadmin.namespace" "import")
(org.osgi.framework.PackagePermission "org.osgi.util.tracker" "import")
(org.osgi.framework.PackagePermission "org.eclipse.ecf.core.jobs" "import")
(org.osgi.framework.PackagePermission "javax.xml.parsers" "import")
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java
index e1ab9e357..7e7525f41 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.ecf.internal.osgi.services.remoteserviceadmin;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;
@@ -20,7 +22,6 @@ import java.util.UUID;
import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.core.ContainerTypeDescription;
@@ -32,18 +33,21 @@ import org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocat
import org.eclipse.ecf.osgi.services.remoteserviceadmin.IServiceInfoFactory;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.ServiceInfoFactory;
-import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.Version;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.resource.Capability;
import org.osgi.service.log.LogService;
import org.osgi.service.remoteserviceadmin.ExportRegistration;
import org.osgi.service.remoteserviceadmin.ImportRegistration;
+import org.osgi.service.remoteserviceadmin.namespace.DistributionNamespace;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
@@ -103,6 +107,24 @@ public class Activator implements BundleActivator {
+ RSA_PROXY_BUNDLE_SYMBOLIC_ID + "') cannot be found, so RSA cannot be started"); //$NON-NLS-1$
}
+ private void initializeDistributionProviders() {
+ for (final Bundle b : context.getBundles()) {
+ BundleRevision rb = AccessController.doPrivileged(new PrivilegedAction<BundleRevision>() {
+ public BundleRevision run() {
+ return b.adapt(BundleRevision.class);
+ }
+ });
+ List<Capability> capabilities = rb.getCapabilities(DistributionNamespace.DISTRIBUTION_NAMESPACE);
+ if (capabilities != null && capabilities.size() > 0)
+ try {
+ b.start();
+ } catch (BundleException e) {
+ LogUtility.logError("RemoteServiceAdmin.initializeDistributionProviders", DebugOptions.REMOTE_SERVICE_ADMIN, //$NON-NLS-1$
+ Activator.class, "Cannot start distribution provider bundle=" + b.getSymbolicName(), e); //$NON-NLS-1$
+ }
+ }
+ }
+
private void stopProxyServiceFactoryBundle() {
if (proxyServiceFactoryBundleContext != null) {
// stop it
@@ -141,7 +163,7 @@ public class Activator implements BundleActivator {
rcs.remove(descSupportedConfigs[j]);
String[] descSupportedIntents = ctd.getSupportedIntents();
for (int j = 0; j < descSupportedIntents.length; j++)
- ris.remove(descSupportedIntents);
+ ris.remove(descSupportedIntents[j]);
}
// set rsaProps to new values
rsaProps.put(org.osgi.service.remoteserviceadmin.RemoteConstants.REMOTE_CONFIGS_SUPPORTED,
@@ -210,35 +232,22 @@ public class Activator implements BundleActivator {
// approach/using the ServiceFactory extender approach for this purpose:
// https://mail.osgi.org/pipermail/osgi-dev/2011-February/003000.html
initializeProxyServiceFactoryBundle();
-
+ // Start distribution providers if not already started
+ initializeDistributionProviders();
// make remote service admin available
rsaProps = new Properties();
rsaProps.put(RemoteServiceAdmin.SERVICE_PROP, new Boolean(true));
-
- IContainerManager containerManager = getContainerManager();
- Assert.isNotNull(containerManager,
- "Container manager service must be present to start ECF Remote Service Admin"); //$NON-NLS-1$
-
- ContainerTypeDescription[] remoteServiceDescriptions = containerManager.getContainerFactory()
- .getDescriptionsForContainerAdapter(IRemoteServiceContainerAdapter.class);
- // The following adds the standard supported configs and supported
- // intents
- // values for all remote service descriptions to rsaProps
- for (int i = 0; i < remoteServiceDescriptions.length; i++)
- addSupportedConfigsAndIntents(remoteServiceDescriptions[i]);
-
// Register Remote Service Admin factory, with rsaProps
remoteServiceAdminRegistration = context.registerService(
org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class.getName(), new ServiceFactory() {
public Object getService(Bundle bundle, ServiceRegistration registration) {
RemoteServiceAdmin result = null;
synchronized (remoteServiceAdmins) {
- RemoteServiceAdmin rsa = remoteServiceAdmins.get(bundle);
- if (rsa == null) {
- rsa = new RemoteServiceAdmin(bundle, exportedRegistrations, importedRegistrations);
- remoteServiceAdmins.put(bundle, rsa);
+ result = remoteServiceAdmins.get(bundle);
+ if (result == null) {
+ result = new RemoteServiceAdmin(bundle, exportedRegistrations, importedRegistrations);
+ remoteServiceAdmins.put(bundle, result);
}
- result = rsa;
}
return result;
}
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 e7769e256..6deb2e94c 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
@@ -20,6 +20,7 @@ Eclipse-LazyStart: true
Export-Package: org.eclipse.ecf.provider.r_osgi.identity;version="3.2.0"
Bundle-Vendor: %plugin.provider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
DynamicImport-Package: *
Provide-Capability: osgi.remoteserviceadmin.distribution; configs:List<String>="ecf.r_osgi.peer,ecf.r_osgi.peer.ws,ecf.r_osgi.peer.wss"; version:Version=1.1
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 a715520f7..4a278cb94 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
@@ -24,3 +24,4 @@ Import-Package: org.eclipse.core.runtime.jobs,
org.osgi.service.log,
org.osgi.util.tracker
Provide-Capability: osgi.remoteserviceadmin.distribution; configs:List<String>="ecf.generic.server,ecf.generic.client,ecf.generic.ssl.server,ecf.generic.ssl.client"; version:Version=1.1
+Bundle-ActivationPolicy: lazy
diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.xmpp/META-INF/MANIFEST.MF
index 4dd5bf2f0..ce072f6f4 100644
--- a/providers/bundles/org.eclipse.ecf.provider.xmpp/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/META-INF/MANIFEST.MF
@@ -30,3 +30,4 @@ Import-Package: org.eclipse.core.runtime.jobs,
org.osgi.service.log;version="1.3.0",
org.osgi.service.url,
org.osgi.util.tracker;version="1.3.2"
+Bundle-ActivationPolicy: lazy

Back to the top