Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-04-12 13:52:20 -0400
committerslewis2018-04-12 13:52:20 -0400
commit126be81906342f84d67f1244a28af30ffa8261e1 (patch)
tree6d80a89d236fe747589445aeb041b1262d038057
parent1eaaf2ce97efa978226fe6524a31c4d1696d17f9 (diff)
downloadorg.eclipse.ecf-126be81906342f84d67f1244a28af30ffa8261e1.tar.gz
org.eclipse.ecf-126be81906342f84d67f1244a28af30ffa8261e1.tar.xz
org.eclipse.ecf-126be81906342f84d67f1244a28af30ffa8261e1.zip
Modified AbstractHostContainerSelector to allow for intent-based
selection of host containers, as well as ability to a) exclude container type descriptions from consideration via new system property: org.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.excludeddescriptions e.g. -Dorg.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.excludeddescriptions=ecf.generic.server,other.description.names default: none excluded And ability to disable default to require description.isServer() via system property: org.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.requireserver e.g. -Dorg.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.requireserver=false default: true Change-Id: I20ff6a61bc8c8bfa9109420f77cfd082f40c58e2
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/.classpath7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/.project33
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/META-INF/MANIFEST.MF12
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml5
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/build.properties6
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/launch/ExampleOSGIAsyncConsumer.generic.product96
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.consumer/src/com/mycorp/examples/osgi/async/consumer/DescriptiveStatsServiceConsumer.java54
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/.classpath7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/.project33
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/META-INF/MANIFEST.MF13
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml9
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/build.properties6
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/launch/ExampleOSGiAsync.generic.product94
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async.impl/src/com/mycorp/examples/osgi/async/impl/DescriptiveStatsServiceImpl.java62
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/.classpath7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/.project28
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/META-INF/MANIFEST.MF10
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/build.properties4
-rw-r--r--examples/bundles/com.mycorp.examples.osgi.async/src/com/mycorp/examples/osgi/async/DescriptiveStatsService.java21
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java72
26 files changed, 574 insertions, 35 deletions
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/.classpath b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.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/examples/bundles/com.mycorp.examples.osgi.async.consumer/.project b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.project
new file mode 100644
index 000000000..26eedf2dc
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.mycorp.examples.osgi.async.consumer</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>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.jdt.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.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/examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.pde.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.osgi.async.consumer/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..c4dc244d9
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECF Consumer
+Bundle-SymbolicName: com.mycorp.examples.osgi.async.consumer
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse.org - ECF
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: com.mycorp.examples.osgi.async,
+ org.osgi.service.component.annotations;resolution:=optional,
+ org.osgi.util.promise
+Bundle-ActivationPolicy: lazy
+Service-Component: OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml b/examples/bundles/com.mycorp.examples.osgi.async.consumer/OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml
new file mode 100644
index 000000000..1607a4d40
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer">
+ <reference bind="bindDescriptiveStatsService" interface="com.mycorp.examples.osgi.async.DescriptiveStatsService" name="DescriptiveStatsService"/>
+ <implementation class="com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer"/>
+</scr:component> \ No newline at end of file
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/build.properties b/examples/bundles/com.mycorp.examples.osgi.async.consumer/build.properties
new file mode 100644
index 000000000..ac6a9885e
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/com.mycorp.examples.osgi.async.consumer.DescriptiveStatsServiceConsumer.xml,\
+ OSGI-INF/
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/launch/ExampleOSGIAsyncConsumer.generic.product b/examples/bundles/com.mycorp.examples.osgi.async.consumer/launch/ExampleOSGIAsyncConsumer.generic.product
new file mode 100644
index 000000000..ae693c7b4
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/launch/ExampleOSGIAsyncConsumer.generic.product
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="OSGI Async Example Consumer" uid="com.mycorp.examples.osgi.async.consumer.generic.exampleosgiasync" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <programArgs>-consoleLog -console
+ </programArgs>
+ <vmArgs>-Xms40m -Xmx384m -Declipse.ignoreApp=true -Dosgi.noShutdown=true
+ </vmArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+ </vmArgsMac>
+ </launcherArgs>
+
+ <launcher>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>
+ </vm>
+
+ <plugins>
+ <plugin id="com.mycorp.examples.osgi.async"/>
+ <plugin id="com.mycorp.examples.osgi.async.consumer"/>
+ <plugin id="javax.servlet"/>
+ <plugin id="org.apache.commons.logging"/>
+ <plugin id="org.apache.felix.gogo.command"/>
+ <plugin id="org.apache.felix.gogo.runtime"/>
+ <plugin id="org.apache.felix.gogo.shell"/>
+ <plugin id="org.apache.felix.scr"/>
+ <plugin id="org.eclipse.core.jobs"/>
+ <plugin id="org.eclipse.ecf"/>
+ <plugin id="org.eclipse.ecf.console"/>
+ <plugin id="org.eclipse.ecf.discovery"/>
+ <plugin id="org.eclipse.ecf.identity"/>
+ <plugin id="org.eclipse.ecf.osgi.services.distribution"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.console"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy"/>
+ <plugin id="org.eclipse.ecf.provider"/>
+ <plugin id="org.eclipse.ecf.provider.jmdns"/>
+ <plugin id="org.eclipse.ecf.provider.remoteservice"/>
+ <plugin id="org.eclipse.ecf.provider.xmlrpc"/>
+ <plugin id="org.eclipse.ecf.remoteservice"/>
+ <plugin id="org.eclipse.ecf.remoteservice.asyncproxy"/>
+ <plugin id="org.eclipse.ecf.sharedobject"/>
+ <plugin id="org.eclipse.equinox.common"/>
+ <plugin id="org.eclipse.equinox.concurrent"/>
+ <plugin id="org.eclipse.equinox.console"/>
+ <plugin id="org.eclipse.equinox.ds"/>
+ <plugin id="org.eclipse.equinox.event"/>
+ <plugin id="org.eclipse.equinox.util"/>
+ <plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.osgi.services"/>
+ <plugin id="org.eclipse.osgi.services.remoteserviceadmin"/>
+ <plugin id="org.eclipse.osgi.util"/>
+ </plugins>
+
+ <configurations>
+ <plugin id="javax.servlet" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.commons.logging" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.command" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.runtime" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.shell" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.core.jobs" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.discovery" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.identity" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.distribution" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider.jmdns" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider.remoteservice" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider.xmlrpc" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.remoteservice" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.remoteservice.asyncproxy" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.sharedobject" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.concurrent" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.console" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />
+ <plugin id="org.eclipse.equinox.event" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.util" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
+ <plugin id="org.eclipse.osgi.services" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.osgi.services.remoteserviceadmin" autoStart="false" startLevel="0" />
+ </configurations>
+
+</product>
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.consumer/src/com/mycorp/examples/osgi/async/consumer/DescriptiveStatsServiceConsumer.java b/examples/bundles/com.mycorp.examples.osgi.async.consumer/src/com/mycorp/examples/osgi/async/consumer/DescriptiveStatsServiceConsumer.java
new file mode 100644
index 000000000..0571f3d66
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.consumer/src/com/mycorp/examples/osgi/async/consumer/DescriptiveStatsServiceConsumer.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Composent, Inc. 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: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.osgi.async.consumer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+import com.mycorp.examples.osgi.async.DescriptiveStatsService;
+
+@Component
+public class DescriptiveStatsServiceConsumer {
+
+ @Reference
+ void bindDescriptiveStatsService(DescriptiveStatsService svc) {
+ svc.sum(100l,200l,300l,400l,500l).whenComplete((sum,t) -> {
+ if (t != null)
+ t.printStackTrace();
+ else
+ System.out.println("Long sum = "+sum);
+ });
+
+ List<Float> data = new ArrayList<Float>();
+ data.add(10f);
+ data.add(20f);
+ data.add(30f);
+
+ svc.mean(data).whenComplete((mean,t) -> {
+ if (t != null)
+ t.printStackTrace();
+ else
+ System.out.println("Float mean = "+mean);
+ });
+
+ List<Double> ddata = new ArrayList<Double>();
+ ddata.add(1000.0);
+ ddata.add(2000.0);
+ ddata.add(3000.0);
+
+ svc.sumsq(ddata).then(p -> {
+ System.out.println("Double sumsq = "+p.getValue());
+ return null;
+ });
+
+ }
+}
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/.classpath b/examples/bundles/com.mycorp.examples.osgi.async.impl/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/.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/examples/bundles/com.mycorp.examples.osgi.async.impl/.project b/examples/bundles/com.mycorp.examples.osgi.async.impl/.project
new file mode 100644
index 000000000..9158db87c
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.mycorp.examples.osgi.async.impl</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>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.jdt.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/.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/examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.pde.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.osgi.async.impl/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..059bf0e32
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECF DescriptiveStats Service Impl
+Bundle-SymbolicName: com.mycorp.examples.osgi.async.impl
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse.org - ECF
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: com.mycorp.examples.osgi.async;version="1.0.0",
+ org.osgi.service.component.annotations;resolution:=optional,
+ org.osgi.util.promise
+Bundle-ActivationPolicy: lazy
+Export-Package: com.mycorp.examples.osgi.async.impl;version="1.0.0"
+Service-Component: OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml b/examples/bundles/com.mycorp.examples.osgi.async.impl/OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml
new file mode 100644
index 000000000..c500eae90
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl">
+ <property name="service.exported.interfaces" value="*"/>
+ <property name="service.intents" value="osgi.async"/>
+ <service>
+ <provide interface="com.mycorp.examples.osgi.async.DescriptiveStatsService"/>
+ </service>
+ <implementation class="com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl"/>
+</scr:component> \ No newline at end of file
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/build.properties b/examples/bundles/com.mycorp.examples.osgi.async.impl/build.properties
new file mode 100644
index 000000000..ee824b4e9
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/com.mycorp.examples.osgi.async.impl.DescriptiveStatsServiceImpl.xml,\
+ OSGI-INF/
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/launch/ExampleOSGiAsync.generic.product b/examples/bundles/com.mycorp.examples.osgi.async.impl/launch/ExampleOSGiAsync.generic.product
new file mode 100644
index 000000000..cc5c3f0d6
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/launch/ExampleOSGiAsync.generic.product
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="OSGI Async Example" uid="com.mycorp.examples.osgi.async.impl.generic.exampleosgiasync" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <programArgs>-consoleLog -console
+ </programArgs>
+ <vmArgs>-Xms40m -Xmx384m -Declipse.ignoreApp=true -Dosgi.noShutdown=true
+ </vmArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+ </vmArgsMac>
+ </launcherArgs>
+
+ <launcher>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>
+ </vm>
+
+ <plugins>
+ <plugin id="com.mycorp.examples.osgi.async"/>
+ <plugin id="com.mycorp.examples.osgi.async.impl"/>
+ <plugin id="javax.servlet"/>
+ <plugin id="org.apache.commons.logging"/>
+ <plugin id="org.apache.felix.gogo.command"/>
+ <plugin id="org.apache.felix.gogo.runtime"/>
+ <plugin id="org.apache.felix.gogo.shell"/>
+ <plugin id="org.apache.felix.scr"/>
+ <plugin id="org.eclipse.core.jobs"/>
+ <plugin id="org.eclipse.ecf"/>
+ <plugin id="org.eclipse.ecf.console"/>
+ <plugin id="org.eclipse.ecf.discovery"/>
+ <plugin id="org.eclipse.ecf.identity"/>
+ <plugin id="org.eclipse.ecf.osgi.services.distribution"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.console"/>
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy"/>
+ <plugin id="org.eclipse.ecf.provider"/>
+ <plugin id="org.eclipse.ecf.provider.jmdns"/>
+ <plugin id="org.eclipse.ecf.provider.remoteservice"/>
+ <plugin id="org.eclipse.ecf.remoteservice"/>
+ <plugin id="org.eclipse.ecf.remoteservice.asyncproxy"/>
+ <plugin id="org.eclipse.ecf.sharedobject"/>
+ <plugin id="org.eclipse.equinox.common"/>
+ <plugin id="org.eclipse.equinox.concurrent"/>
+ <plugin id="org.eclipse.equinox.console"/>
+ <plugin id="org.eclipse.equinox.ds"/>
+ <plugin id="org.eclipse.equinox.event"/>
+ <plugin id="org.eclipse.equinox.util"/>
+ <plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.osgi.services"/>
+ <plugin id="org.eclipse.osgi.services.remoteserviceadmin"/>
+ <plugin id="org.eclipse.osgi.util"/>
+ </plugins>
+
+ <configurations>
+ <plugin id="javax.servlet" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.commons.logging" autoStart="false" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.command" autoStart="true" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.runtime" autoStart="true" startLevel="0" />
+ <plugin id="org.apache.felix.gogo.shell" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.core.jobs" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.discovery" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.identity" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.distribution" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider.jmdns" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.ecf.provider.remoteservice" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.ecf.remoteservice" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.remoteservice.asyncproxy" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.ecf.sharedobject" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.concurrent" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.console" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />
+ <plugin id="org.eclipse.equinox.event" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.equinox.util" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
+ <plugin id="org.eclipse.osgi.services" autoStart="false" startLevel="0" />
+ <plugin id="org.eclipse.osgi.services.remoteserviceadmin" autoStart="false" startLevel="0" />
+ </configurations>
+
+</product>
diff --git a/examples/bundles/com.mycorp.examples.osgi.async.impl/src/com/mycorp/examples/osgi/async/impl/DescriptiveStatsServiceImpl.java b/examples/bundles/com.mycorp.examples.osgi.async.impl/src/com/mycorp/examples/osgi/async/impl/DescriptiveStatsServiceImpl.java
new file mode 100644
index 000000000..3b7b102bc
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async.impl/src/com/mycorp/examples/osgi/async/impl/DescriptiveStatsServiceImpl.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Composent, Inc. 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: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.osgi.async.impl;
+
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+
+import org.osgi.service.component.annotations.Component;
+import org.osgi.util.promise.Deferred;
+import org.osgi.util.promise.Promise;
+import com.mycorp.examples.osgi.async.DescriptiveStatsService;
+
+@Component(property = { "service.exported.interfaces=*", "service.intents=osgi.async" })
+public class DescriptiveStatsServiceImpl implements DescriptiveStatsService {
+
+ @Override
+ public CompletableFuture<Double> mean(Collection<Float> data) {
+ CompletableFuture<Double> cf = new CompletableFuture<Double>();
+ if (data == null)
+ cf.completeExceptionally(new NullPointerException("data must not be null"));
+ double sum = 0.0;
+ for(Float datum: data)
+ sum += datum;
+ if (data.isEmpty())
+ cf.complete(Double.NaN);
+ else
+ cf.complete(sum/data.size());
+ return cf;
+ }
+
+ @Override
+ public CompletionStage<Long> sum(Long... data) {
+ CompletableFuture<Long> cf = new CompletableFuture<Long>();
+ if (data == null)
+ cf.completeExceptionally(new NullPointerException("data must not be null"));
+ long sum = 0;
+ for(Long datum: data)
+ sum += datum;
+ cf.complete(sum);
+ return cf;
+ }
+
+ @Override
+ public Promise<Double> sumsq(Collection<Double> data) {
+ Deferred<Double> d = new Deferred<Double>();
+ if (data == null)
+ d.fail(new NullPointerException("data must not be null"));
+ double sumsq = 0.0;
+ for(Double datum: data)
+ sumsq += datum.doubleValue() * datum.doubleValue();
+ d.resolve(sumsq);
+ return d.getPromise();
+ }
+
+}
diff --git a/examples/bundles/com.mycorp.examples.osgi.async/.classpath b/examples/bundles/com.mycorp.examples.osgi.async/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/.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/examples/bundles/com.mycorp.examples.osgi.async/.project b/examples/bundles/com.mycorp.examples.osgi.async/.project
new file mode 100644
index 000000000..a161cda54
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.mycorp.examples.osgi.async</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/examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.jdt.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/.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/examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.pde.core.prefs b/examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/examples/bundles/com.mycorp.examples.osgi.async/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.osgi.async/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..c22568bbf
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECF Examples for OSGI R7 osgi.async intent
+Bundle-SymbolicName: com.mycorp.examples.osgi.async
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse.org - ECF
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.osgi.util.promise
+Export-Package: com.mycorp.examples.osgi.async;version="1.0.0"
+Bundle-ActivationPolicy: lazy
diff --git a/examples/bundles/com.mycorp.examples.osgi.async/build.properties b/examples/bundles/com.mycorp.examples.osgi.async/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/examples/bundles/com.mycorp.examples.osgi.async/src/com/mycorp/examples/osgi/async/DescriptiveStatsService.java b/examples/bundles/com.mycorp.examples.osgi.async/src/com/mycorp/examples/osgi/async/DescriptiveStatsService.java
new file mode 100644
index 000000000..280756858
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.osgi.async/src/com/mycorp/examples/osgi/async/DescriptiveStatsService.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Composent, Inc. 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: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.osgi.async;
+
+import java.util.Collection;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionStage;
+import org.osgi.util.promise.Promise;
+
+public interface DescriptiveStatsService {
+
+ CompletableFuture<Double> mean(Collection<Float> data);
+ CompletionStage<Long> sum(Long...data);
+ Promise<Double> sumsq(Collection<Double> data);
+}
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java
index 17fdd7cd8..eb560f725 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractHostContainerSelector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010-2011 Composent, Inc. and others. All rights reserved. This
+ * Copyright (c) 2018 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
@@ -26,7 +26,9 @@ import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.provider.ContainerInstantiatorUtils;
import org.eclipse.ecf.core.provider.ContainerIntentException;
import org.eclipse.ecf.core.security.IConnectContext;
+import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.DebugOptions;
import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.IDUtil;
+import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.LogUtility;
import org.eclipse.ecf.remoteservice.IRemoteServiceContainer;
import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;
import org.eclipse.ecf.remoteservice.RemoteServiceContainer;
@@ -40,10 +42,18 @@ import org.osgi.framework.ServiceReference;
public abstract class AbstractHostContainerSelector extends
AbstractContainerSelector {
+ private static final String REQUIRE_SERVER_PROP = "org.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.requireserver"; //$NON-NLS-1$
+ private static final String EXCLUDED_DESCRIPTIONS_PROP = "org.eclipse.ecf.osgi.service.remoteserviceadmin.hostcontainerselector.excludeddescriptions"; //$NON-NLS-1$
+ private boolean defaultRequireServer = new Boolean(System.getProperty(REQUIRE_SERVER_PROP,"true")); //$NON-NLS-1$
+ private List<String> excludedDescriptions;
+
protected String[] defaultConfigTypes;
public AbstractHostContainerSelector(String[] defaultConfigTypes) {
this.defaultConfigTypes = defaultConfigTypes;
+ String propValue = System.getProperty(EXCLUDED_DESCRIPTIONS_PROP);
+ String[] excludedVals = (propValue==null)?new String[0]:propValue.trim().split(","); //$NON-NLS-1$
+ this.excludedDescriptions = Arrays.asList(excludedVals);
}
/**
@@ -279,13 +289,7 @@ public abstract class AbstractHostContainerSelector extends
ContainerTypeDescription[] descriptions = getContainerTypeDescriptions();
if (descriptions == null)
return Collections.EMPTY_LIST;
- // If there are no required configs specified, then create any defaults
- if (requiredConfigs == null || requiredConfigs.length == 0) {
- createAndAddDefaultContainers(serviceReference, properties,
- serviceExportedInterfaces, serviceIntents, descriptions,
- results);
- } else {
- // See if we have a match
+ // Iterate through all descriptions and see if we have a match
for (int i = 0; i < descriptions.length; i++) {
trace("createAndConfigureHostContainers","Considering description="+descriptions[i]); //$NON-NLS-1$ //$NON-NLS-2$
IRemoteServiceContainer matchingContainer = createMatchingContainer(
@@ -295,27 +299,9 @@ public abstract class AbstractHostContainerSelector extends
if (matchingContainer != null)
results.add(matchingContainer);
}
- }
return results;
}
- private void createAndAddDefaultContainers(
- ServiceReference serviceReference, Map<String, Object> properties,
- String[] serviceExportedInterfaces, String[] requiredIntents,
- ContainerTypeDescription[] descriptions, Collection results)
- throws SelectContainerException {
- ContainerTypeDescription[] ctds = getContainerTypeDescriptionsForDefaultConfigTypes(descriptions);
- if (ctds != null) {
- for (int i = 0; i < ctds.length; i++) {
- IRemoteServiceContainer matchingContainer = createMatchingContainer(
- ctds[i], serviceReference, properties,
- serviceExportedInterfaces, null, requiredIntents);
- if (matchingContainer != null)
- results.add(matchingContainer);
- }
- }
- }
-
protected ContainerTypeDescription[] getContainerTypeDescriptionsForDefaultConfigTypes(
ContainerTypeDescription[] descriptions) {
String[] defaultConfigTypes = getDefaultConfigTypes();
@@ -350,6 +336,23 @@ public abstract class AbstractHostContainerSelector extends
}
/**
+ * @since 4.6
+ */
+ protected boolean matchRequireServer(ContainerTypeDescription description) {
+ boolean result = this.defaultRequireServer && description.isServer();
+ LogUtility.trace("matchRequireServer", DebugOptions.CONTAINER_SELECTOR, this.getClass(), "description="+description.getName()+((result)?" matched require server":" DID NOT match require server")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return result;
+ }
+
+ /**
+ * @since 4.6
+ */
+ protected boolean matchNotExcluded(ContainerTypeDescription description) {
+ boolean result = this.excludedDescriptions.contains(description.getName());
+ LogUtility.trace("matchNotExcluded", DebugOptions.CONTAINER_SELECTOR, this.getClass(), "description="+description.getName()+((result)?" EXCLUDED via excludedDescriptions="+this.excludedDescriptions:" not excluded via excludedDescriptions="+this.excludedDescriptions)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return !result;
+ }
+ /**
* @param containerTypeDescription containerTypeDescription
* @param serviceReference reference
* @param properties properties
@@ -366,12 +369,10 @@ public abstract class AbstractHostContainerSelector extends
String[] serviceExportedInterfaces, String[] requiredConfigs,
String[] serviceIntents) throws SelectContainerException {
- if (matchHostSupportedConfigTypes(requiredConfigs,
- containerTypeDescription)
- && matchHostSupportedIntents(serviceIntents,
- containerTypeDescription)) {
- return createRSContainer(serviceReference, properties,
- containerTypeDescription, serviceIntents);
+ if (matchRequireServer(containerTypeDescription) && matchNotExcluded(containerTypeDescription)
+ && matchHostSupportedConfigTypes(requiredConfigs, containerTypeDescription)
+ && matchHostSupportedIntents(serviceIntents, containerTypeDescription)) {
+ return createRSContainer(serviceReference, properties, containerTypeDescription, serviceIntents);
}
return null;
}
@@ -413,9 +414,10 @@ public abstract class AbstractHostContainerSelector extends
return null;
IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
.getAdapter(IRemoteServiceContainerAdapter.class);
- if (adapter == null)
- throw new SelectContainerException(
- "Container does not implement IRemoteServiceContainerAdapter", null, containerTypeDescription); //$NON-NLS-1$
+ if (adapter == null) {
+ LogUtility.logError("createRSContainer", DebugOptions.CONTAINER_SELECTOR, this.getClass(), "Container="+container.getID()+" does not implement IRemoteServiceContainerAdapter"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return null;
+ }
return new RemoteServiceContainer(container, adapter);
}

Back to the top