Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-03-31 21:40:59 +0000
committerslewis2014-03-31 21:40:59 +0000
commitfe468456cfaab2707823d1587b2782d7086c2bc4 (patch)
treef98699305c284a2ac12a1c6dbe5e04809bfa6b78 /providers
parent27f62a65e46f9d1492a7ef0e31206b0465e89377 (diff)
parent8caf8c2de33df197a3416b48c7bb04efa71aa018 (diff)
downloadorg.eclipse.ecf-fe468456cfaab2707823d1587b2782d7086c2bc4.tar.gz
org.eclipse.ecf-fe468456cfaab2707823d1587b2782d7086c2bc4.tar.xz
org.eclipse.ecf-fe468456cfaab2707823d1587b2782d7086c2bc4.zip
Merge remote-tracking branch 'origin/master' into rfc1.1
Conflicts: examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer.launch Change-Id: Ib83f0393403af7d629aa6cbffe731b5b251eaf3b
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/plugin.xml18
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java42
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java18
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java14
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/internal/provider/jmdns/JMDNSPlugin.java26
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/ContainerInstantiator.java16
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/identity/JMDNSNamespace.java11
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/internal/provider/jslp/Activator.java17
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.local/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/internal/provider/local/Activator.java15
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/provider/local/identity/LocalNamespace.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/Activator.java13
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiContainerInstantiator.java1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/provider/r_osgi/identity/R_OSGiRemoteServiceNamespace.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.classpath7
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.gitignore1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.project28
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/META-INF/MANIFEST.MF20
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/about.html28
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/build.properties8
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.properties10
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml75
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/Activator.java67
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java67
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8RemoteServiceContainerAdapterFactory.java58
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java19
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java67
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java25
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPClientSOContainer.java19
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPServerSOContainer.java25
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java50
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java9
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.zookeeper/plugin.xml8
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/DiscoveryActivator.java14
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/ZooDiscoveryNamespace.java2
42 files changed, 792 insertions, 44 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
index 04cb9629d..c0c72691e 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.provider.datashare;singleton:=true
-Bundle-Version: 1.4.100.qualifier
+Bundle-Version: 1.5.0.qualifier
Bundle-Activator: org.eclipse.ecf.internal.provider.datashare.Activator
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.datashare/plugin.xml
index bf74e668b..38cd24e8c 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/plugin.xml
@@ -18,5 +18,23 @@
<adapter type="org.eclipse.ecf.datashare.IChannelContainerAdapter"/>
</factory>
</extension>
+
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.generic.SSLClientSOContainer"
+ class="org.eclipse.ecf.provider.datashare.DatashareContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.datashare.IChannelContainerAdapter"/>
+ </factory>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.generic.SSLServerSOContainer"
+ class="org.eclipse.ecf.provider.datashare.DatashareContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.datashare.IChannelContainerAdapter"/>
+ </factory>
+ </extension>
</plugin>
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
index 1c29ebfcf..035178190 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
@@ -11,11 +11,11 @@
package org.eclipse.ecf.internal.provider.datashare;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IStatus;
+import java.util.List;
+import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.IContainerManager;
-import org.eclipse.ecf.core.util.LogHelper;
-import org.eclipse.ecf.core.util.PlatformHelper;
+import org.eclipse.ecf.core.util.*;
+import org.eclipse.ecf.provider.datashare.DatashareContainerAdapterFactory;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
@@ -35,7 +35,7 @@ public class Activator implements BundleActivator {
private ServiceTracker logServiceTracker = null;
- private ServiceTracker adapterManagerTracker = null;
+ private AdapterManagerTracker adapterManagerTracker = null;
private ServiceTracker containerManagerTracker = null;
@@ -61,11 +61,32 @@ public class Activator implements BundleActivator {
}
}
+ List rscAdapterFactories;
+
/**
* This method is called upon plug-in activation
*/
- public void start(BundleContext ctxt) throws Exception {
+ public void start(final BundleContext ctxt) throws Exception {
this.context = ctxt;
+ SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {
+ protected void runWithoutRegistry() throws Exception {
+ IAdapterManager am = getAdapterManager();
+ if (am != null) {
+ IAdapterFactory af = new DatashareContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new DatashareContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new DatashareContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new DatashareContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ }
+ }
+ });
}
/**
@@ -103,15 +124,10 @@ public class Activator implements BundleActivator {
public IAdapterManager getAdapterManager() {
// First, try to get the adapter manager via
if (adapterManagerTracker == null) {
- adapterManagerTracker = new ServiceTracker(this.context, IAdapterManager.class.getName(), null);
+ adapterManagerTracker = new AdapterManagerTracker(this.context);
adapterManagerTracker.open();
}
- IAdapterManager adapterManager = (IAdapterManager) adapterManagerTracker.getService();
- // Then, if the service isn't there, try to get from Platform class via
- // PlatformHelper class
- if (adapterManager == null)
- adapterManager = PlatformHelper.getPlatformAdapterManager();
- return adapterManager;
+ return adapterManagerTracker.getAdapterManager();
}
/**
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
index 829b484c1..ced3201c6 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/Activator.java
@@ -12,12 +12,16 @@ package org.eclipse.ecf.internal.provider.discovery;
import java.util.HashSet;
import java.util.Properties;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.eclipse.ecf.discovery.service.IDiscoveryService;
-import org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer;
+import org.eclipse.ecf.provider.discovery.*;
import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -47,6 +51,17 @@ public class Activator implements BundleActivator {
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext context) throws Exception {
+
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(Namespace.class, new CompositeNamespace(), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container", true, false), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.singleton.discovery", new SingletonDiscoveryContainerInstantiator(), "Composite Discovery Container Locator", true, false), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite.locator", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container Locator"), null); //$NON-NLS-1$ //$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.composite.advertiser", new CompositeDiscoveryContainerInstantiator(), "Composite Discovery Container Advertiser"), null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+
final Properties props = new Properties();
props.put(IDiscoveryLocator.CONTAINER_NAME, CompositeDiscoveryContainer.NAME);
props.put(Constants.SERVICE_RANKING, new Integer(1000));
@@ -119,6 +134,7 @@ public class Activator implements BundleActivator {
((CompositeDiscoveryContainer) service).dispose();
}
}, props);
+
}
/*
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
index e37e23168..5ffc44e04 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/internal/provider/discovery/CompositeNamespace.java
@@ -20,6 +20,10 @@ public class CompositeNamespace extends Namespace {
private static final long serialVersionUID = -4774766051014928510L;
public static final String NAME = "ecf.namespace.composite"; //$NON-NLS-1$
+ public CompositeNamespace() {
+ super(NAME, "Composite Namespace"); //$NON-NLS-1$
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
index a93033e6b..43aac56d7 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/plugin.xml
@@ -5,7 +5,7 @@
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.eclipse.ecf.provider.dnssd.ContainerInstantiator"
- description="Discovery Locator Container "
+ description="Discovery Locator Container"
name="ecf.discovery.dnssd.locator">
</containerFactory>
</extension>
@@ -13,7 +13,7 @@
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.eclipse.ecf.provider.dnssd.ContainerInstantiator"
- description="Discovery Advertiser Container "
+ description="Discovery Advertiser Container"
name="ecf.discovery.dnssd.advertiser">
</containerFactory>
</extension>
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
index b60c52fbb..d5471c4e5 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/Activator.java
@@ -16,8 +16,12 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
+import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerTypeDescription;
import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.osgi.framework.Bundle;
@@ -46,9 +50,17 @@ public class Activator implements BundleActivator {
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
- public void start(BundleContext context) throws Exception {
+ public void start(final BundleContext context) throws Exception {
this.context = context;
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(Namespace.class, new DnsSdNamespace(), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + LOCATOR,new ContainerInstantiator(),"Discovery Locator Container"), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + ADVERTISER,new ContainerInstantiator(),"Discovery Advertiser Container"), null);
+ }
+ });
+
// register a managed factory for the locator service
final Properties locCmProps = new Properties();
locCmProps.put(Constants.SERVICE_PID, DISCOVERY_CONTAINER_NAME_VALUE + LOCATOR);
diff --git a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
index 57bb9a9ef..7c1c2ac41 100644
--- a/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.dnssd/src/org/eclipse/ecf/provider/dnssd/DnsSdNamespace.java
@@ -26,6 +26,10 @@ public class DnsSdNamespace extends Namespace {
public static final String SCHEME = "dnssd"; //$NON-NLS-1$
public static final String NAME = "ecf.namespace.dnssd"; //$NON-NLS-1$
+ public DnsSdNamespace() {
+ super(NAME,"Dns SD Namespace");
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/internal/provider/jmdns/JMDNSPlugin.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/internal/provider/jmdns/JMDNSPlugin.java
index 620ccbd69..0a1b56a84 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/internal/provider/jmdns/JMDNSPlugin.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/internal/provider/jmdns/JMDNSPlugin.java
@@ -12,14 +12,17 @@ package org.eclipse.ecf.internal.provider.jmdns;
import java.util.Properties;
import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.ecf.core.ContainerConnectException;
-import org.eclipse.ecf.core.IContainer;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.*;
import org.eclipse.ecf.core.identity.IDCreateException;
+import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.util.*;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.eclipse.ecf.discovery.service.IDiscoveryService;
+import org.eclipse.ecf.provider.jmdns.container.ContainerInstantiator;
import org.eclipse.ecf.provider.jmdns.container.JMDNSDiscoveryContainer;
+import org.eclipse.ecf.provider.jmdns.identity.JMDNSNamespace;
import org.osgi.framework.*;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
@@ -45,7 +48,7 @@ public class JMDNSPlugin implements BundleActivator {
plugin = this;
}
- private ServiceTracker adapterManagerTracker = null;
+ private AdapterManagerTracker adapterManagerTracker = null;
private ServiceRegistration serviceRegistration;
@@ -56,15 +59,10 @@ public class JMDNSPlugin implements BundleActivator {
public IAdapterManager getAdapterManager() {
// First, try to get the adapter manager via
if (adapterManagerTracker == null) {
- adapterManagerTracker = new ServiceTracker(this.context, IAdapterManager.class.getName(), null);
+ adapterManagerTracker = new AdapterManagerTracker(this.context);
adapterManagerTracker.open();
}
- IAdapterManager adapterManager = (IAdapterManager) adapterManagerTracker.getService();
- // Then, if the service isn't there, try to get from Platform class via
- // PlatformHelper class
- if (adapterManager == null)
- adapterManager = PlatformHelper.getPlatformAdapterManager();
- return adapterManager;
+ return adapterManagerTracker.getAdapterManager();
}
/**
@@ -78,6 +76,14 @@ public class JMDNSPlugin implements BundleActivator {
props.put(Constants.SERVICE_RANKING, new Integer(750));
String[] clazzes = new String[] {IDiscoveryService.class.getName(), IDiscoveryLocator.class.getName(), IDiscoveryAdvertiser.class.getName()};
serviceRegistration = context.registerService(clazzes, serviceFactory, props);
+ SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {
+ protected void runWithoutRegistry() throws Exception {
+ ctxt.registerService(Namespace.class, new JMDNSNamespace("JMDNS Discovery Namespace"), null);
+ ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_CONTAINER_NAME, new ContainerInstantiator(), "JMDNS Discovery Container", true, false), null);
+ ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_LOCATOR_NAME, new ContainerInstantiator(), "JMDNS Discovery Locator"), null);
+ ctxt.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(ContainerInstantiator.JMDNS_ADVERTISER_NAME, new ContainerInstantiator(), "JMDNS Discovery Advertiser"), null);
+ }
+ });
}
private final DiscoveryServiceFactory serviceFactory = new DiscoveryServiceFactory();
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/ContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/ContainerInstantiator.java
index 6fc8b3ce3..1fb03aa82 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/ContainerInstantiator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/ContainerInstantiator.java
@@ -17,13 +17,25 @@ import org.eclipse.ecf.discovery.IDiscoveryContainerAdapter;
public class ContainerInstantiator implements IContainerInstantiator {
+ /**
+ * @since 4.3
+ */
+ public static final String JMDNS_CONTAINER_NAME = "ecf.container.jmdns";
+ /**
+ * @since 4.3
+ */
+ public static final String JMDNS_LOCATOR_NAME = "ecf.container.jmdns.locator";
+ /**
+ * @since 4.3
+ */
+ public static final String JMDNS_ADVERTISER_NAME = "ecf.container.jmdns.advertiser";
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.provider.IContainerInstantiator#createInstance(org.eclipse.ecf.core.ContainerTypeDescription, java.lang.Object[])
*/
public IContainer createInstance(final ContainerTypeDescription description, final Object[] args) throws ContainerCreateException {
try {
- final AbstractContainer container = new JMDNSDiscoveryContainer();
- return container;
+ return new JMDNSDiscoveryContainer();
} catch (final IDCreateException e) {
final ContainerCreateException excep = new ContainerCreateException("Jmdns container create failed", e); //$NON-NLS-1$
excep.setStackTrace(e.getStackTrace());
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/identity/JMDNSNamespace.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/identity/JMDNSNamespace.java
index 5c2691495..ac6a046fa 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/identity/JMDNSNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/identity/JMDNSNamespace.java
@@ -23,6 +23,17 @@ public class JMDNSNamespace extends Namespace {
public static final String NAME = "ecf.namespace.jmdns"; //$NON-NLS-1$
+ public JMDNSNamespace() {
+ super();
+ }
+
+ /**
+ * @since 4.3
+ */
+ public JMDNSNamespace(String description) {
+ super(NAME, description);
+ }
+
private String getInitFromExternalForm(final Object[] args) {
if (args == null || args.length < 1 || args[0] == null)
return null;
diff --git a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/internal/provider/jslp/Activator.java b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/internal/provider/jslp/Activator.java
index 3a09c540b..49917c798 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/internal/provider/jslp/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/internal/provider/jslp/Activator.java
@@ -13,13 +13,17 @@ package org.eclipse.ecf.internal.provider.jslp;
import ch.ethz.iks.slp.Advertiser;
import ch.ethz.iks.slp.Locator;
import java.util.Properties;
-import org.eclipse.ecf.core.ContainerConnectException;
-import org.eclipse.ecf.core.IContainer;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.*;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.eclipse.ecf.discovery.service.IDiscoveryService;
+import org.eclipse.ecf.provider.jslp.container.ContainerInstantiator;
import org.eclipse.ecf.provider.jslp.container.JSLPDiscoveryContainer;
+import org.eclipse.ecf.provider.jslp.identity.JSLPNamespace;
import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -82,6 +86,15 @@ public class Activator implements BundleActivator {
public void start(final BundleContext context) throws Exception {
bundleContext = context;
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(Namespace.class, new JSLPNamespace(), null);
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.jslp", new ContainerInstantiator(), "JSLP Discovery Container", true, false), null); //$NON-NLS-1$//$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.jslp.locator", new ContainerInstantiator(), "JSLP Discovery Locator Container", true, false), null); //$NON-NLS-1$//$NON-NLS-2$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.discovery.jslp.advertiser", new ContainerInstantiator(), "JSLP Discovery Advertiser Container", true, false), null); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ });
+
// initially get the locator and add a life cycle listener
locatorSt = new ServiceTracker(context, Locator.class.getName(), null);
diff --git a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
index e0d45cc7e..505831d92 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jslp/src/org/eclipse/ecf/provider/jslp/identity/JSLPNamespace.java
@@ -23,6 +23,10 @@ public class JSLPNamespace extends Namespace {
public static final String NAME = "ecf.namespace.slp"; //$NON-NLS-1$
+ public JSLPNamespace() {
+ super(NAME, "JSLP Namespace"); //$NON-NLS-1$
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.core.identity.Namespace#createInstance(java.lang.Object[])
*/
diff --git a/providers/bundles/org.eclipse.ecf.provider.local/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.local/META-INF/MANIFEST.MF
index 060762c01..7aaddeb01 100644
--- a/providers/bundles/org.eclipse.ecf.provider.local/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.local/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ECF Local Remote Service Provider
Bundle-SymbolicName: org.eclipse.ecf.provider.local;singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.ecf.internal.provider.local.Activator
Bundle-Vendor: Eclipse.org - ECF
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
diff --git a/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/internal/provider/local/Activator.java b/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/internal/provider/local/Activator.java
index 5add95bcd..40c0f7b8b 100644
--- a/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/internal/provider/local/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/internal/provider/local/Activator.java
@@ -1,5 +1,11 @@
package org.eclipse.ecf.internal.provider.local;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
+import org.eclipse.ecf.internal.provider.local.container.LocalRemoteServiceContainerInstantiator;
+import org.eclipse.ecf.provider.local.identity.LocalNamespace;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
@@ -15,8 +21,15 @@ public class Activator implements BundleActivator {
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
- public void start(BundleContext bundleContext) throws Exception {
+ public void start(final BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
+
+ SafeRunner.run(new ExtensionRegistryRunnable(bundleContext) {
+ protected void runWithoutRegistry() throws Exception {
+ bundleContext.registerService(Namespace.class, new LocalNamespace(), null);
+ bundleContext.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.local", new LocalRemoteServiceContainerInstantiator(), "Local Container Instantiator", false, false), null); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ });
}
/*
diff --git a/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/provider/local/identity/LocalNamespace.java b/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/provider/local/identity/LocalNamespace.java
index cc4cdfa48..58355279c 100644
--- a/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/provider/local/identity/LocalNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.local/src/org/eclipse/ecf/provider/local/identity/LocalNamespace.java
@@ -19,6 +19,10 @@ public class LocalNamespace extends Namespace {
public static final String NAME = "ecf.namespace.local"; //$NON-NLS-1$
public static final String SCHEME = "local"; //$NON-NLS-1$
+ public LocalNamespace() {
+ super(NAME, "Local Namespace"); //$NON-NLS-1$
+ }
+
public ID createInstance(Object[] parameters) throws IDCreateException {
try {
final String init = getInitStringFromExternalForm(parameters);
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 e5d33c2bb..216b2fcad 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
@@ -12,6 +12,12 @@
package org.eclipse.ecf.internal.provider.r_osgi;
import ch.ethz.iks.r_osgi.RemoteOSGiService;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
+import org.eclipse.ecf.provider.r_osgi.identity.R_OSGiNamespace;
+import org.eclipse.ecf.provider.r_osgi.identity.R_OSGiRemoteServiceNamespace;
import org.eclipse.equinox.concurrent.future.IExecutor;
import org.osgi.framework.*;
import org.osgi.util.tracker.ServiceTracker;
@@ -64,6 +70,13 @@ public final class Activator implements BundleActivator {
this.context = bc;
r_osgi_tracker = new ServiceTracker(context, RemoteOSGiService.class.getName(), null);
r_osgi_tracker.open();
+ SafeRunner.run(new ExtensionRegistryRunnable(bc) {
+ protected void runWithoutRegistry() throws Exception {
+ bc.registerService(Namespace.class, new R_OSGiNamespace(), null);
+ bc.registerService(Namespace.class, new R_OSGiRemoteServiceNamespace(), null);
+ bc.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(R_OSGiContainerInstantiator.NAME, new R_OSGiContainerInstantiator(), "R_OSGi Container", true, false), null); //$NON-NLS-1$
+ }
+ });
}
/**
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiContainerInstantiator.java
index db3bd9eaa..4e88fd40f 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiContainerInstantiator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/internal/provider/r_osgi/R_OSGiContainerInstantiator.java
@@ -104,6 +104,7 @@ public final class R_OSGiContainerInstantiator implements IContainerInstantiator
}
private static final String ROSGI_CONFIG = "ecf.r_osgi.peer"; //$NON-NLS-1$
+ public static final String NAME = ROSGI_CONFIG;
private static final String[] ROSGI_CONFIGS = new String[] {ROSGI_CONFIG};
diff --git a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/provider/r_osgi/identity/R_OSGiRemoteServiceNamespace.java b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/provider/r_osgi/identity/R_OSGiRemoteServiceNamespace.java
index ac1ff8569..db8983bec 100644
--- a/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/provider/r_osgi/identity/R_OSGiRemoteServiceNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.r_osgi/src/org/eclipse/ecf/provider/r_osgi/identity/R_OSGiRemoteServiceNamespace.java
@@ -23,6 +23,10 @@ public class R_OSGiRemoteServiceNamespace extends Namespace {
public static final String NAME = "ecf.namespace.r_osgi.remoteservice"; //$NON-NLS-1$
+ public R_OSGiRemoteServiceNamespace() {
+ super(NAME, "R_OSGi Remote Service Namespace"); //$NON-NLS-1$
+ }
+
public ID createInstance(Object[] parameters) throws IDCreateException {
if (parameters == null || parameters.length != 2)
throw new IDCreateException("Parameters incorrect for remote ID creation"); //$NON-NLS-1$
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.classpath b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.gitignore b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.gitignore
new file mode 100644
index 000000000..e660fd93d
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.project b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.project
new file mode 100644
index 000000000..7fed21f82
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ecf.provider.remoteservice.java8</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.jdt.core.prefs b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.pde.core.prefs b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..706f07e8a
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=true
+resolve.requirebundle=false
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5f462461f
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.ecf.provider.remoteservice.java8;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %pluginProvider
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Require-Bundle: org.eclipse.ecf;bundle-version="3.3.0",
+ org.eclipse.ecf.provider;bundle-version="4.4.0",
+ org.eclipse.ecf.provider.remoteservice;bundle-version="4.1.0",
+ org.eclipse.ecf.sharedobject;bundle-version="2.4.0",
+ org.eclipse.equinox.common;bundle-version="3.6.200",
+ org.eclipse.ecf.remoteservice;bundle-version="8.3.0"
+Import-Package: org.eclipse.equinox.concurrent.future;version="1.1.0",
+ org.osgi.framework;version="1.8.0",
+ org.osgi.util.tracker;version="1.5.1"
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.ecf.provider.internal.remoteservice.java8.Activator
+
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/about.html b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/about.html
new file mode 100644
index 000000000..4c79781a5
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 25, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/build.properties b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/build.properties
new file mode 100644
index 000000000..7b3c227b8
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
+src.includes = about.html
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.properties b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.properties
new file mode 100644
index 000000000..b5ccef319
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.properties
@@ -0,0 +1,10 @@
+############################################################################
+# Copyright (c) 2014 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
+#
+############################################################################
+pluginName = ECF Generic Provider RemoteServices Java8 Support
+providerName = Eclipse.org - ECF
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml
new file mode 100644
index 000000000..a8e6731fb
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/plugin.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ecf.containerFactory">
+ <containerFactory
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8GenericContainerInstantiator"
+ description="ECF Java8 Generic Server"
+ hidden="false"
+ name="ecf.generic.server.java8"
+ server="true">
+ </containerFactory>
+ </extension>
+ <extension
+ point="org.eclipse.ecf.containerFactory">
+ <containerFactory
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8GenericContainerInstantiator"
+ description="ECF Java8 Generic Client"
+ hidden="true"
+ name="ecf.generic.client.java8">
+ </containerFactory>
+ </extension>
+ <extension
+ point="org.eclipse.ecf.containerFactory">
+ <containerFactory
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8SSLGenericContainerInstantiator"
+ description="ECF Java8 Generic SSL Server"
+ hidden="false"
+ name="ecf.generic.ssl.server.java8"
+ server="true">
+ </containerFactory>
+ </extension>
+ <extension
+ point="org.eclipse.ecf.containerFactory">
+ <containerFactory
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8SSLGenericContainerInstantiator"
+ description="ECF Java8 Generic SSL Client"
+ hidden="true"
+ name="ecf.generic.ssl.client.java8">
+ </containerFactory>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.internal.remoteservice.java8.J8TCPClientSOContainer"
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8RemoteServiceContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter"/>
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.internal.remoteservice.java8.J8TCPServerSOContainer"
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8RemoteServiceContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter"/>
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.internal.remoteservice.java8.J8SSLClientSOContainer"
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8RemoteServiceContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter"/>
+ </factory>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.ecf.provider.internal.remoteservice.java8.J8SSLServerSOContainer"
+ class="org.eclipse.ecf.provider.internal.remoteservice.java8.J8RemoteServiceContainerAdapterFactory">
+ <adapter type="org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter"/>
+ </factory>
+ </extension>
+
+</plugin>
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/Activator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/Activator.java
new file mode 100644
index 000000000..4791bf408
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/Activator.java
@@ -0,0 +1,67 @@
+package org.eclipse.ecf.provider.internal.remoteservice.java8;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.util.AdapterManagerTracker;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private List<IAdapterFactory> rscAdapterFactories;
+
+ private static IAdapterManager getAdapterManager(BundleContext ctx) {
+ AdapterManagerTracker t = new AdapterManagerTracker(ctx);
+ t.open();
+ IAdapterManager am = t.getAdapterManager();
+ t.close();
+ return am;
+ }
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ SafeRunner.run(new ExtensionRegistryRunnable(context) {
+ protected void runWithoutRegistry() throws Exception {
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8GenericContainerInstantiator.JAVA8_SERVER_NAME, new J8GenericContainerInstantiator(), "ECF Java8 Generic Server", true, false), null); //$NON-NLS-1$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8GenericContainerInstantiator.JAVA8_CLIENT_NAME, new J8GenericContainerInstantiator(), "ECF Java8 Generic Client", false, false), null); //$NON-NLS-1$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8SSLGenericContainerInstantiator.JAVA8_SSL_CLIENT_NAME, new J8SSLGenericContainerInstantiator(), "ECF Java8 SSL Generic Client", false, false), null); //$NON-NLS-1$
+ context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8SSLGenericContainerInstantiator.JAVA8_SSL_SERVER_NAME, new J8SSLGenericContainerInstantiator(), "ECF Java8 SSL Generic Server", true, false), null); //$NON-NLS-1$
+ IAdapterManager am = getAdapterManager(context);
+ if (am != null) {
+ rscAdapterFactories = new ArrayList<IAdapterFactory>();
+ IAdapterFactory af = new J8RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, J8SSLServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new J8RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, J8TCPServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new J8RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, J8SSLClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new J8RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, J8TCPClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ }
+ }
+ });
+
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (rscAdapterFactories != null) {
+ IAdapterManager am = getAdapterManager(context);
+ if (am != null) {
+ for (IAdapterFactory af : rscAdapterFactories)
+ am.unregisterAdapters(af);
+ }
+ }
+ }
+
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java
new file mode 100644
index 000000000..c5644795a
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8GenericContainerInstantiator.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.provider.generic.GenericContainerInstantiator;
+import org.eclipse.ecf.provider.generic.SOContainerConfig;
+
+public class J8GenericContainerInstantiator extends
+ GenericContainerInstantiator {
+
+ public static final String JAVA8_CLIENT_NAME = "ecf.generic.client.java8";
+ public static final String JAVA8_SERVER_NAME = "ecf.generic.server.java8";
+
+ @Override
+ protected boolean isClient(ContainerTypeDescription description) {
+ if (description.getName().equals(JAVA8_SERVER_NAME))
+ return false;
+ return true;
+ }
+
+ @Override
+ protected IContainer createClientContainer(GenericContainerArgs gcargs)
+ throws Exception {
+ return new J8TCPClientSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getKeepAlive().intValue());
+ }
+
+ @Override
+ protected IContainer createServerContainer(GenericContainerArgs gcargs)
+ throws Exception {
+ return new J8TCPServerSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getBindAddress(), gcargs.getKeepAlive().intValue());
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ public String[] getImportedConfigs(ContainerTypeDescription description, String[] exporterSupportedConfigs) {
+ if (exporterSupportedConfigs == null)
+ return null;
+ List results = new ArrayList();
+ List supportedConfigs = Arrays.asList(exporterSupportedConfigs);
+ // For a server, if exporter is a client then we can be an importer
+ if (JAVA8_SERVER_NAME.equals(description.getName())) {
+ if (supportedConfigs.contains(JAVA8_CLIENT_NAME))
+ results.add(JAVA8_SERVER_NAME);
+ // For a client, if exporter is server we can import
+ // or if remote is either generic server or generic client
+ } else if (JAVA8_CLIENT_NAME.equals(description.getName())) {
+ if (supportedConfigs.contains(JAVA8_SERVER_NAME) || supportedConfigs.contains(JAVA8_CLIENT_NAME))
+ results.add(JAVA8_CLIENT_NAME);
+ }
+ if (results.size() == 0)
+ return null;
+ return (String[]) results.toArray(new String[] {});
+ }
+
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8RemoteServiceContainerAdapterFactory.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8RemoteServiceContainerAdapterFactory.java
new file mode 100644
index 000000000..9a91c810d
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8RemoteServiceContainerAdapterFactory.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import java.util.concurrent.CompletableFuture;
+
+import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.core.sharedobject.*;
+import org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject;
+import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory;
+import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceImpl;
+import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceRegistrationImpl;
+import org.eclipse.ecf.remoteservice.IRemoteCall;
+import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
+import org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent;
+import org.eclipse.ecf.remoteservice.events.IRemoteCallEvent;
+
+public class J8RemoteServiceContainerAdapterFactory extends RemoteServiceContainerAdapterFactory {
+
+ protected ISharedObject createAdapter(ISharedObjectContainer container, @SuppressWarnings("rawtypes") Class adapterType, ID adapterID) {
+ if (adapterType.equals(IRemoteServiceContainerAdapter.class)) {
+ return new RegistrySharedObject() {
+ @Override
+ protected RemoteServiceImpl createRemoteService(
+ RemoteServiceRegistrationImpl registration) {
+ return new RemoteServiceImpl(this,registration) {
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Object callFuture(IRemoteCall call, @SuppressWarnings("rawtypes") Class returnType) {
+ if (CompletableFuture.class.isAssignableFrom(returnType)) {
+ @SuppressWarnings("rawtypes")
+ CompletableFuture result = new CompletableFuture();
+ callAsyncWithResult(call, (IRemoteCallEvent e) -> {
+ if (e instanceof IRemoteCallCompleteEvent) {
+ IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) e;
+ if (cce.hadException())
+ result.completeExceptionally(cce.getException());
+ else
+ result.complete(cce.getResponse());
+ }
+ });
+ return result;
+ }
+ return super.callFuture(call, returnType);
+ }
+ };
+ }
+ };
+ }
+ return null;
+ }
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java
new file mode 100644
index 000000000..fe82ee5a6
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLClientSOContainer.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
+import org.eclipse.ecf.provider.generic.SSLClientSOContainer;
+
+public class J8SSLClientSOContainer extends SSLClientSOContainer {
+
+ public J8SSLClientSOContainer(ISharedObjectContainerConfig config, int ka) {
+ super(config, ka);
+ }
+} \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java
new file mode 100644
index 000000000..da2e1898f
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLGenericContainerInstantiator.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.provider.generic.SOContainerConfig;
+import org.eclipse.ecf.provider.generic.SSLGenericContainerInstantiator;
+
+public class J8SSLGenericContainerInstantiator extends
+ SSLGenericContainerInstantiator {
+
+ public static final String JAVA8_SSL_CLIENT_NAME = "ecf.generic.ssl.client.java8";
+ public static final String JAVA8_SSL_SERVER_NAME = "ecf.generic.ssl.server.java8";
+
+ @Override
+ protected boolean isClient(ContainerTypeDescription description) {
+ if (description.getName().equals(JAVA8_SSL_SERVER_NAME))
+ return false;
+ return true;
+ }
+
+ @Override
+ protected IContainer createClientContainer(GenericContainerArgs gcargs)
+ throws Exception {
+ return new J8TCPClientSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getKeepAlive().intValue());
+ }
+
+ @Override
+ protected IContainer createServerContainer(GenericContainerArgs gcargs)
+ throws Exception {
+ return new J8TCPServerSOContainer(new SOContainerConfig(gcargs.getID()), gcargs.getBindAddress(), gcargs.getKeepAlive().intValue());
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ public String[] getImportedConfigs(ContainerTypeDescription description, String[] exporterSupportedConfigs) {
+ if (exporterSupportedConfigs == null)
+ return null;
+ List results = new ArrayList();
+ List supportedConfigs = Arrays.asList(exporterSupportedConfigs);
+ // For a server, if exporter is a client then we can be an importer
+ if (JAVA8_SSL_SERVER_NAME.equals(description.getName())) {
+ if (supportedConfigs.contains(JAVA8_SSL_CLIENT_NAME))
+ results.add(JAVA8_SSL_SERVER_NAME);
+ // For a client, if exporter is server we can import
+ // or if remote is either generic server or generic client
+ } else if (JAVA8_SSL_CLIENT_NAME.equals(description.getName())) {
+ if (supportedConfigs.contains(JAVA8_SSL_SERVER_NAME) || supportedConfigs.contains(JAVA8_SSL_CLIENT_NAME))
+ results.add(JAVA8_SSL_CLIENT_NAME);
+ }
+ if (results.size() == 0)
+ return null;
+ return (String[]) results.toArray(new String[] {});
+ }
+
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java
new file mode 100644
index 000000000..e3356c6ef
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8SSLServerSOContainer.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URISyntaxException;
+
+import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
+import org.eclipse.ecf.provider.generic.SSLServerSOContainer;
+
+public class J8SSLServerSOContainer extends SSLServerSOContainer {
+
+ public J8SSLServerSOContainer(ISharedObjectContainerConfig config,
+ InetAddress bindAddress, int keepAlive) throws IOException,
+ URISyntaxException {
+ super(config, bindAddress, keepAlive);
+ }
+} \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPClientSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPClientSOContainer.java
new file mode 100644
index 000000000..243fd4ebd
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPClientSOContainer.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
+import org.eclipse.ecf.provider.generic.TCPClientSOContainer;
+
+public class J8TCPClientSOContainer extends TCPClientSOContainer {
+
+ public J8TCPClientSOContainer(ISharedObjectContainerConfig config, int ka) {
+ super(config, ka);
+ }
+} \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPServerSOContainer.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPServerSOContainer.java
new file mode 100644
index 000000000..637cf822c
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice.java8/src/org/eclipse/ecf/provider/internal/remoteservice/java8/J8TCPServerSOContainer.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.provider.internal.remoteservice.java8;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URISyntaxException;
+
+import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
+import org.eclipse.ecf.provider.generic.TCPServerSOContainer;
+
+public class J8TCPServerSOContainer extends TCPServerSOContainer {
+
+ public J8TCPServerSOContainer(ISharedObjectContainerConfig config,
+ InetAddress bindAddress, int keepAlive) throws IOException,
+ URISyntaxException {
+ super(config, bindAddress, keepAlive);
+ }
+} \ No newline at end of file
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 1a2531ce3..30a6342e8 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
@@ -8,9 +8,12 @@
******************************************************************************/
package org.eclipse.ecf.internal.provider.remoteservice;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.ecf.core.util.LogHelper;
-import org.eclipse.ecf.core.util.SystemLogService;
+import java.util.*;
+import org.eclipse.core.runtime.*;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.*;
+import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceContainerAdapterFactory;
+import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceNamespace;
import org.osgi.framework.*;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
@@ -39,8 +42,39 @@ public class Activator implements BundleActivator {
plugin = this;
}
- public void start(BundleContext ctxt) throws Exception {
+ private List rscAdapterFactories;
+
+ private static IAdapterManager getAdapterManager(BundleContext ctx) {
+ AdapterManagerTracker t = new AdapterManagerTracker(ctx);
+ t.open();
+ IAdapterManager am = t.getAdapterManager();
+ t.close();
+ return am;
+ }
+
+ public void start(final BundleContext ctxt) throws Exception {
this.context = ctxt;
+ 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$
+ IAdapterManager am = getAdapterManager(ctxt);
+ if (am != null) {
+ rscAdapterFactories = new ArrayList();
+ IAdapterFactory af = new RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ af = new RemoteServiceContainerAdapterFactory();
+ am.registerAdapters(af, org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
+ rscAdapterFactories.add(af);
+ }
+ }
+ });
}
public void stop(BundleContext ctxt) throws Exception {
@@ -49,6 +83,14 @@ public class Activator implements BundleActivator {
logServiceTracker = null;
logService = null;
}
+ if (rscAdapterFactories != null) {
+ IAdapterManager am = getAdapterManager(this.context);
+ if (am != null) {
+ for (Iterator i = rscAdapterFactories.iterator(); i.hasNext();)
+ am.unregisterAdapters((IAdapterFactory) i.next());
+ }
+ rscAdapterFactories = null;
+ }
this.context = null;
plugin = null;
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index 577d5f3d4..688004cde 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -199,6 +199,13 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
}
+ /**
+ * @since 4.1
+ */
+ protected RemoteServiceImpl createRemoteService(RemoteServiceRegistrationImpl registration) {
+ return new RemoteServiceImpl(this, registration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter#getRemoteService(org.eclipse.ecf.remoteservice.IRemoteServiceReference)
*/
@@ -207,7 +214,7 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
final RemoteServiceRegistrationImpl registration = getRemoteServiceRegistrationImpl(reference);
if (registration == null)
return null;
- final RemoteServiceImpl remoteService = new RemoteServiceImpl(this, registration);
+ final RemoteServiceImpl remoteService = createRemoteService(registration);
synchronized (refToImplMap) {
List remoteServiceImplList = (List) refToImplMap.get(reference);
if (remoteServiceImplList == null)
diff --git a/providers/bundles/org.eclipse.ecf.provider.zookeeper/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.zookeeper/plugin.xml
index 2ca709379..97fa861c0 100644
--- a/providers/bundles/org.eclipse.ecf.provider.zookeeper/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.zookeeper/plugin.xml
@@ -5,17 +5,17 @@
point="org.eclipse.ecf.containerFactory">
<containerFactory
class="org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainerInstantiator"
- description="Discovery Container"
+ description="Zookeeper Discovery Container"
name="ecf.discovery.zoodiscovery">
</containerFactory>
<containerFactory
class="org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainerInstantiator"
- description="Discovery Container"
+ description="Zookeeper Discovery Advertiser Container"
name="ecf.discovery.zoodiscovery.advertiser">
</containerFactory>
<containerFactory
class="org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainerInstantiator"
- description="Discovery Container"
+ description="Zookeeper Discovery Locator Container"
name="ecf.discovery.zoodiscovery.locator">
</containerFactory>
</extension>
@@ -23,7 +23,7 @@
point="org.eclipse.ecf.identity.namespace">
<namespace
class="org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryNamespace"
- description="ZooKeeper Based Discovery Namespace"
+ description="ZooKeeper Based Discovery Namespace"
name="ecf.namespace.zoodiscovery">
</namespace>
</extension>
diff --git a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/DiscoveryActivator.java b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/DiscoveryActivator.java
index 0bac43bda..8175053f6 100644
--- a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/DiscoveryActivator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/DiscoveryActivator.java
@@ -16,10 +16,15 @@ import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
import org.eclipse.ecf.discovery.IDiscoveryAdvertiser;
import org.eclipse.ecf.discovery.IDiscoveryLocator;
import org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainer;
import org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryContainerInstantiator;
+import org.eclipse.ecf.provider.zookeeper.core.ZooDiscoveryNamespace;
import org.eclipse.ecf.provider.zookeeper.core.internal.BundleStoppingListener;
import org.eclipse.ecf.provider.zookeeper.util.Logger;
import org.eclipse.ecf.provider.zookeeper.util.PrettyPrinter;
@@ -42,6 +47,15 @@ public class DiscoveryActivator implements BundleActivator {
public void start(final BundleContext ctxt) {
context = ctxt;
+ SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {
+ protected void runWithoutRegistry() throws Exception {
+ ctxt.registerService(Namespace.class,new ZooDiscoveryNamespace(), null);
+ ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME,new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Container"), null);
+ ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME+".advertiser",new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Advertiser Container"), null);
+ ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME+".locator",new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Locator Container"), null);
+ }
+ });
+
final Properties props = new Properties();
props.put(IDiscoveryLocator.CONTAINER_NAME, ZooDiscoveryContainerInstantiator.NAME);
props.put(IDiscoveryAdvertiser.CONTAINER_NAME, ZooDiscoveryContainerInstantiator.NAME);
diff --git a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/ZooDiscoveryNamespace.java b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/ZooDiscoveryNamespace.java
index a6e5339a5..bc15ecb60 100644
--- a/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/ZooDiscoveryNamespace.java
+++ b/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/ZooDiscoveryNamespace.java
@@ -26,7 +26,7 @@ public class ZooDiscoveryNamespace extends Namespace {
public static final String NAME = "ecf.namespace.zoodiscovery"; //$NON-NLS-1$
public ZooDiscoveryNamespace() {
- super(NAME, "ZooKeeper Based Discovery Namespace"); //$NON-NLS-1$
+ super(NAME, "ZooKeeper Discovery Namespace"); //$NON-NLS-1$
}
public ID createInstance(Object[] parameters) throws IDCreateException {

Back to the top