Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2015-09-07 19:41:02 +0000
committerslewis2015-09-07 19:41:02 +0000
commitdf86df83018afe162b12a6bc1ac88fb00a3f9c06 (patch)
treefecef0ce498064c529ec3dcb9958535150fbea09 /examples
parent0bf2d22c074fe8f9fa1b6dc8da85baa854ca024c (diff)
downloadorg.eclipse.ecf-df86df83018afe162b12a6bc1ac88fb00a3f9c06.tar.gz
org.eclipse.ecf-df86df83018afe162b12a6bc1ac88fb00a3f9c06.tar.xz
org.eclipse.ecf-df86df83018afe162b12a6bc1ac88fb00a3f9c06.zip
Simplification of REST provider creation tutorial...removed common,
simplified both host and client, used new provider API. Change-Id: I69b3b51f2fb0fb8cbff851ebfafb0c73c7f856f0
Diffstat (limited to 'examples')
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.noreg.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.noreg.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery.rest/timeservicerestendpointdescription.xml2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.noreg.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.product2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/META-INF/MANIFEST.MF9
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/build.properties1
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/plugin.xml13
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/internal/timeservice/provider/rest/common/Activator.java26
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/timeservice/provider/rest/common/TimeServiceRestNamespace.java47
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/META-INF/MANIFEST.MF4
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/build.properties1
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/plugin.xml14
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/Activator.java16
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainer.java68
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainerInstantiator.java43
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/META-INF/MANIFEST.MF5
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/build.properties1
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/plugin.xml14
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java16
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceHttpServiceComponent.java2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainer.java62
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainerInstantiator.java41
25 files changed, 98 insertions, 299 deletions
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.noreg.product b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.noreg.product
index 9a64784f8..abc64f569 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.noreg.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.noreg.product
@@ -36,7 +36,6 @@
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.consumer.ds"/>
<plugin id="com.mycorp.examples.timeservice.consumer.filediscovery.rest"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer"/>
<plugin id="javax.servlet"/>
<plugin id="org.apache.commons.codec"/>
@@ -78,7 +77,6 @@
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.ds" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.filediscovery.rest" autoStart="false" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer" autoStart="true" startLevel="0" />
<plugin id="javax.servlet" autoStart="true" startLevel="0" />
<plugin id="org.apache.commons.codec" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.product b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.product
index 8c0d3fd4f..40d9a0f03 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.edef.product
@@ -36,7 +36,6 @@
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.consumer.ds"/>
<plugin id="com.mycorp.examples.timeservice.consumer.filediscovery.rest"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer"/>
<plugin id="javax.servlet"/>
<plugin id="javax.xml"/>
@@ -82,7 +81,6 @@
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.ds" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.filediscovery.rest" autoStart="false" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer" autoStart="true" startLevel="0" />
<plugin id="javax.servlet" autoStart="true" startLevel="0" />
<plugin id="javax.xml" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.noreg.product b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.noreg.product
index 4503b0c11..3774016c1 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.noreg.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.noreg.product
@@ -35,7 +35,6 @@
<plugins>
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.consumer.ds"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer"/>
<plugin id="javax.servlet"/>
<plugin id="org.apache.commons.codec"/>
@@ -77,7 +76,6 @@
<configurations>
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.ds" autoStart="true" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer" autoStart="true" startLevel="0" />
<plugin id="javax.servlet" autoStart="true" startLevel="0" />
<plugin id="org.apache.commons.codec" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.product b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.product
index c5f9fee5b..5b45ad845 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/launch/TimeServiceConsumer.ds.rest.product
@@ -35,7 +35,6 @@
<plugins>
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.consumer.ds"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer"/>
<plugin id="javax.servlet"/>
<plugin id="javax.xml"/>
@@ -81,7 +80,6 @@
<configurations>
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.consumer.ds" autoStart="true" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.consumer" autoStart="true" startLevel="0" />
<plugin id="javax.servlet" autoStart="true" startLevel="0" />
<plugin id="javax.xml" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery.rest/timeservicerestendpointdescription.xml b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery.rest/timeservicerestendpointdescription.xml
index 452732a74..50ab83cee 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery.rest/timeservicerestendpointdescription.xml
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery.rest/timeservicerestendpointdescription.xml
@@ -2,7 +2,7 @@
<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
<endpoint-description>
<property name="ecf.endpoint.id" value-type="String" value="http://localhost:8181"/>
- <property name="ecf.endpoint.id.ns" value-type="String" value="com.mycorp.examples.timeservice.provider.rest.namespace"/>
+ <property name="ecf.endpoint.id.ns" value-type="String" value="ecf.rest.namespace"/>
<property name="ecf.endpoint.ts" value-type="Long" value="1387233380373"/>
<property name="endpoint.framework.uuid" value-type="String" value="20cc5d57-e8f0-0012-192b-c570b422d1f9"/>
<property name="endpoint.id" value-type="String" value="87d3ef4f-8e8f-4187-873e-166dcc58c9eb"/>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.noreg.product b/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.noreg.product
index 10e405a94..7abbf201a 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.noreg.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.noreg.product
@@ -35,7 +35,6 @@
<plugins>
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.host"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.host"/>
<plugin id="javax.servlet"/>
<plugin id="org.apache.commons.codec"/>
@@ -86,7 +85,6 @@
<configurations>
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.host" autoStart="true" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.host" autoStart="true" startLevel="6" />
<plugin id="javax.servlet" autoStart="true" startLevel="0" />
<plugin id="org.apache.commons.codec" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.product b/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.product
index 83431c941..b07591cbc 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.product
+++ b/examples/bundles/com.mycorp.examples.timeservice.host/launch/TimeServiceHost.rest.product
@@ -35,7 +35,6 @@
<plugins>
<plugin id="com.mycorp.examples.timeservice"/>
<plugin id="com.mycorp.examples.timeservice.host"/>
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common"/>
<plugin id="com.mycorp.examples.timeservice.provider.rest.host"/>
<plugin id="javax.servlet"/>
<plugin id="javax.xml"/>
@@ -91,7 +90,6 @@
<configurations>
<plugin id="com.mycorp.examples.timeservice" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.host" autoStart="true" startLevel="0" />
- <plugin id="com.mycorp.examples.timeservice.provider.rest.common" autoStart="true" startLevel="0" />
<plugin id="com.mycorp.examples.timeservice.provider.rest.host" autoStart="true" startLevel="0" />
<plugin id="javax.servlet" autoStart="true" startLevel="6" />
<plugin id="javax.xml" autoStart="true" startLevel="0" />
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/META-INF/MANIFEST.MF
index b7cdbbc2b..61b9266eb 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/META-INF/MANIFEST.MF
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/META-INF/MANIFEST.MF
@@ -2,14 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ECF RS Example Timeservice REST Provider Common
Bundle-SymbolicName: com.mycorp.examples.timeservice.provider.rest.common;singleton:=true
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 3.0.0.qualifier
Bundle-Vendor: Eclipse.org - ECF
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.ecf.core.identity,
- org.eclipse.ecf.core.util;version="3.2.0",
- org.eclipse.ecf.remoteservice.rest.identity,
- org.osgi.framework
-Require-Bundle: org.eclipse.equinox.common
-Export-Package: com.mycorp.examples.timeservice.provider.rest.common
Bundle-ActivationPolicy: lazy
-Bundle-Activator: com.mycorp.examples.internal.timeservice.provider.rest.common.Activator
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/build.properties b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/build.properties
index e5a949cc4..9cbab3c13 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/build.properties
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/build.properties
@@ -2,6 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml,\
about.html
src.includes = about.html
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/plugin.xml b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/plugin.xml
deleted file mode 100644
index 2b71eef3f..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/plugin.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ecf.identity.namespace">
- <namespace
- class="com.mycorp.examples.timeservice.provider.rest.common.TimeServiceRestNamespace"
- description="Timeservice Rest Namespace"
- name="com.mycorp.examples.timeservice.provider.rest.namespace">
- </namespace>
- </extension>
-
-</plugin>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/internal/timeservice/provider/rest/common/Activator.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/internal/timeservice/provider/rest/common/Activator.java
deleted file mode 100644
index 95e515031..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/internal/timeservice/provider/rest/common/Activator.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.mycorp.examples.internal.timeservice.provider.rest.common;
-
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-import com.mycorp.examples.timeservice.provider.rest.common.TimeServiceRestNamespace;
-
-public class Activator implements BundleActivator {
-
- public void start(final BundleContext context) throws Exception {
- SafeRunner.run(new ExtensionRegistryRunnable(context) {
- @Override
- protected void runWithoutRegistry() throws Exception {
- context.registerService(Namespace.class, new TimeServiceRestNamespace(), null);
- }
- });
- }
-
- public void stop(BundleContext context) throws Exception {
- // nothing
- }
-
-}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/timeservice/provider/rest/common/TimeServiceRestNamespace.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/timeservice/provider/rest/common/TimeServiceRestNamespace.java
deleted file mode 100644
index 41fd04a74..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.common/src/com/mycorp/examples/timeservice/provider/rest/common/TimeServiceRestNamespace.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2013 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 com.mycorp.examples.timeservice.provider.rest.common;
-
-import java.net.URI;
-
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDCreateException;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.remoteservice.rest.identity.RestID;
-import org.eclipse.ecf.remoteservice.rest.identity.RestNamespace;
-
-public class TimeServiceRestNamespace extends RestNamespace {
-
- public static final String NAME = "com.mycorp.examples.timeservice.provider.rest.namespace";
-
- private static final long serialVersionUID = -3632048418135041788L;
-
- public TimeServiceRestNamespace() {
- super(NAME,"Time Service REST Namespace");
- }
-
- @Override
- public ID createInstance(Object[] parameters) throws IDCreateException {
- return new TimeServiceRestID(this, URI.create((String) parameters[0]));
- }
-
- /**
- * @since 2.0
- */
- public static class TimeServiceRestID extends RestID {
-
- private static final long serialVersionUID = 688293496962799572L;
-
- public TimeServiceRestID(Namespace namespace, URI uri) {
- super(namespace, uri);
- }
- }
-
-}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/META-INF/MANIFEST.MF
index 19fe3025b..f7967095e 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/META-INF/MANIFEST.MF
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/META-INF/MANIFEST.MF
@@ -1,15 +1,15 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ECF RS Example Timeservice REST Provider Consumer
-Bundle-SymbolicName: com.mycorp.examples.timeservice.provider.rest.consumer;singleton:=true
+Bundle-SymbolicName: com.mycorp.examples.timeservice.provider.rest.consumer
Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: Eclipse.org - ECF
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Import-Package: com.mycorp.examples.timeservice;version="1.0.0",
- com.mycorp.examples.timeservice.provider.rest.common,
org.eclipse.ecf.remoteservice,
org.eclipse.ecf.remoteservice.client,
+ org.eclipse.ecf.remoteservice.provider;version="1.0.0",
org.eclipse.ecf.remoteservice.rest,
org.eclipse.ecf.remoteservice.rest.client,
org.eclipse.ecf.remoteservice.rest.identity,
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/build.properties b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/build.properties
index e5a949cc4..9cbab3c13 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/build.properties
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/build.properties
@@ -2,6 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml,\
about.html
src.includes = about.html
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/plugin.xml b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/plugin.xml
deleted file mode 100644
index cebadbb40..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/plugin.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ecf.containerFactory">
- <containerFactory
- class="com.mycorp.examples.timeservice.internal.provider.rest.consumer.TimeServiceRestClientContainerInstantiator"
- hidden="false"
- name="com.mycorp.examples.timeservice.rest.consumer"
- server="false">
- </containerFactory>
- </extension>
-
-</plugin>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/Activator.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/Activator.java
index d160e01aa..c55e0f837 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/Activator.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/Activator.java
@@ -1,20 +1,18 @@
package com.mycorp.examples.timeservice.internal.provider.rest.consumer;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
+import org.eclipse.ecf.remoteservice.provider.IRemoteServiceDistributionProvider;
+import org.eclipse.ecf.remoteservice.provider.RemoteServiceDistributionProvider;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
public void start(final BundleContext context) throws Exception {
- SafeRunner.run(new ExtensionRegistryRunnable(context) {
- @Override
- protected void runWithoutRegistry() throws Exception {
- context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(TimeServiceRestClientContainer.TIMESERVICE_CONSUMER_CONFIG_NAME, new TimeServiceRestClientContainerInstantiator(), "TimeService REST Client", false ,false), null);
- }
- });
+ context.registerService(IRemoteServiceDistributionProvider.class,
+ new RemoteServiceDistributionProvider.Builder()
+ .setName(TimeServiceRestClientContainer.TIMESERVICE_CONSUMER_CONFIG_NAME)
+ .setInstantiator(new TimeServiceRestClientContainer.Instantiator()).build(),
+ null);
}
public void stop(BundleContext context) throws Exception {
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainer.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainer.java
index df0f1efc5..72d3ec15b 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainer.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainer.java
@@ -10,26 +10,31 @@
package com.mycorp.examples.timeservice.internal.provider.rest.consumer;
import java.io.NotSerializableException;
+import java.util.Arrays;
import java.util.Map;
+import java.util.UUID;
import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerCreateException;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.ecf.remoteservice.IRemoteCall;
import org.eclipse.ecf.remoteservice.IRemoteServiceRegistration;
import org.eclipse.ecf.remoteservice.client.IRemoteCallable;
import org.eclipse.ecf.remoteservice.client.IRemoteResponseDeserializer;
+import org.eclipse.ecf.remoteservice.provider.RemoteServiceContainerInstantiator;
import org.eclipse.ecf.remoteservice.rest.RestCallableFactory;
import org.eclipse.ecf.remoteservice.rest.client.HttpGetRequestType;
import org.eclipse.ecf.remoteservice.rest.client.RestClientContainer;
import org.eclipse.ecf.remoteservice.rest.identity.RestID;
+import org.eclipse.ecf.remoteservice.rest.identity.RestNamespace;
import org.json.JSONException;
import org.json.JSONObject;
import com.mycorp.examples.timeservice.ITimeService;
-import com.mycorp.examples.timeservice.provider.rest.common.TimeServiceRestNamespace;
public class TimeServiceRestClientContainer extends RestClientContainer {
@@ -37,29 +42,24 @@ public class TimeServiceRestClientContainer extends RestClientContainer {
private IRemoteServiceRegistration reg;
- TimeServiceRestClientContainer() {
- // Create a random ID for the client container
- super((RestID) IDFactory.getDefault().createID(
- TimeServiceRestNamespace.NAME, "uuid:"
- + java.util.UUID.randomUUID().toString()));
+ TimeServiceRestClientContainer(RestID id) {
+ super(id);
// This sets up the JSON deserialization of the server's response.
// See below for implementation of TimeServiceRestResponseDeserializer
setResponseDeserializer(new TimeServiceRestResponseDeserializer());
}
@Override
- public void connect(ID targetID, IConnectContext connectContext1)
- throws ContainerConnectException {
+ public void connect(ID targetID, IConnectContext connectContext1) throws ContainerConnectException {
super.connect(targetID, connectContext1);
// Create the IRemoteCallable to represent
- // access to the ITimeService method.
- IRemoteCallable callable = RestCallableFactory.createCallable(
- "getCurrentTime", ITimeService.class.getName(), null,
- new HttpGetRequestType(), 30000);
+ // access to the ITimeService method.
+ IRemoteCallable callable = RestCallableFactory.createCallable("getCurrentTime", ITimeService.class.getName(),
+ null, new HttpGetRequestType(), 30000);
// Register the callable and associate it with the ITimeService class
// name
- reg = registerCallables(new String[] { ITimeService.class.getName() },
- new IRemoteCallable[][] { { callable } }, null);
+ reg = registerCallables(new String[] { ITimeService.class.getName() }, new IRemoteCallable[][] { { callable } },
+ null);
}
@Override
@@ -71,19 +71,16 @@ public class TimeServiceRestClientContainer extends RestClientContainer {
}
}
- class TimeServiceRestResponseDeserializer implements
- IRemoteResponseDeserializer {
- public Object deserializeResponse(String endpoint, IRemoteCall call,
- IRemoteCallable callable,
- @SuppressWarnings("rawtypes") Map responseHeaders,
- byte[] responseBody) throws NotSerializableException {
+ class TimeServiceRestResponseDeserializer implements IRemoteResponseDeserializer {
+ public Object deserializeResponse(String endpoint, IRemoteCall call, IRemoteCallable callable,
+ @SuppressWarnings("rawtypes") Map responseHeaders, byte[] responseBody)
+ throws NotSerializableException {
// We simply need to read the response body (json String),
// And return the value of the "time" field
try {
return new JSONObject(new String(responseBody)).get("time");
} catch (JSONException e1) {
- throw new NotSerializableException(
- TimeServiceRestResponseDeserializer.class.getName());
+ throw new NotSerializableException(TimeServiceRestResponseDeserializer.class.getName());
}
}
@@ -91,7 +88,28 @@ public class TimeServiceRestClientContainer extends RestClientContainer {
@Override
public Namespace getConnectNamespace() {
- return IDFactory.getDefault().getNamespaceByName(
- TimeServiceRestNamespace.NAME);
+ return RestNamespace.INSTANCE;
}
+
+ public static class Instantiator extends RemoteServiceContainerInstantiator {
+
+ private static final String TIMESERVICE_HOST_CONFIG_NAME = "com.mycorp.examples.timeservice.rest.host";
+
+ @Override
+ public IContainer createInstance(ContainerTypeDescription description, Map<String, ?> parameters)
+ throws ContainerCreateException {
+ // Create new container instance
+ return new TimeServiceRestClientContainer((RestID) RestNamespace.INSTANCE
+ .createInstance(new Object[] { "uuid:" + UUID.randomUUID().toString() }));
+ }
+
+ public String[] getImportedConfigs(ContainerTypeDescription description, String[] exporterSupportedConfigs) {
+ if (Arrays.asList(exporterSupportedConfigs).contains(TIMESERVICE_HOST_CONFIG_NAME))
+ return new String[] { TimeServiceRestClientContainer.TIMESERVICE_CONSUMER_CONFIG_NAME };
+ else
+ return null;
+ }
+
+ }
+
}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainerInstantiator.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainerInstantiator.java
deleted file mode 100644
index bd4531625..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.consumer/src/com/mycorp/examples/timeservice/internal/provider/rest/consumer/TimeServiceRestClientContainerInstantiator.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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 com.mycorp.examples.timeservice.internal.provider.rest.consumer;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.ecf.core.ContainerCreateException;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.remoteservice.rest.client.RestClientContainerInstantiator;
-
-public class TimeServiceRestClientContainerInstantiator extends
- RestClientContainerInstantiator {
-
- private static final String TIMESERVICE_HOST_CONFIG_NAME = "com.mycorp.examples.timeservice.rest.host";
-
- @Override
- public IContainer createInstance(ContainerTypeDescription description,
- Object[] parameters) throws ContainerCreateException {
- // Create new container instance
- return new TimeServiceRestClientContainer();
- }
-
- public String[] getImportedConfigs(ContainerTypeDescription description,
- String[] exporterSupportedConfigs) {
- @SuppressWarnings("rawtypes")
- List supportedConfigs = Arrays.asList(exporterSupportedConfigs);
- // If the supportedConfigs contains the timeservice host config,
- // then we are the client to handle it!
- if (supportedConfigs.contains(TIMESERVICE_HOST_CONFIG_NAME))
- return new String[] { TimeServiceRestClientContainer.TIMESERVICE_CONSUMER_CONFIG_NAME };
- else return null;
- }
-
-}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/META-INF/MANIFEST.MF
index d4b943375..48801efb5 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/META-INF/MANIFEST.MF
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/META-INF/MANIFEST.MF
@@ -1,19 +1,20 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ECF RS Example TimeService REST Provider Host
-Bundle-SymbolicName: com.mycorp.examples.timeservice.provider.rest.host;singleton:=true
+Bundle-SymbolicName: com.mycorp.examples.timeservice.provider.rest.host
Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: Eclipse.org - ECF
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.equinox.common,
org.eclipse.ecf
Import-Package: com.mycorp.examples.timeservice;version="1.0.0",
- com.mycorp.examples.timeservice.provider.rest.common,
javax.servlet,
javax.servlet.http,
org.eclipse.ecf.core.sharedobject,
org.eclipse.ecf.provider.generic,
org.eclipse.ecf.remoteservice,
+ org.eclipse.ecf.remoteservice.provider;version="1.0.0",
+ org.eclipse.ecf.remoteservice.rest.identity;version="2.5.0",
org.eclipse.ecf.remoteservice.servlet,
org.eclipse.equinox.concurrent.future,
org.json,
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/build.properties b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/build.properties
index 20ce1e84c..6c93bf6f9 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/build.properties
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/build.properties
@@ -3,7 +3,6 @@ bin.includes = META-INF/,\
.,\
OSGI-INF/httpservicecomponent.xml,\
OSGI-INF/,\
- plugin.xml,\
about.html
source.. = src/
src.includes = about.html
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/plugin.xml b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/plugin.xml
deleted file mode 100644
index 648b316df..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/plugin.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ecf.containerFactory">
- <containerFactory
- class="com.mycorp.examples.timeservice.internal.provider.rest.host.TimeServiceServerContainerInstantiator"
- hidden="false"
- name="com.mycorp.examples.timeservice.rest.host"
- server="true">
- </containerFactory>
- </extension>
-
-</plugin>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java
index 3be5e913b..360dea289 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java
@@ -1,20 +1,18 @@
package com.mycorp.examples.timeservice.internal.provider.rest.host;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.util.ExtensionRegistryRunnable;
+import org.eclipse.ecf.remoteservice.provider.IRemoteServiceDistributionProvider;
+import org.eclipse.ecf.remoteservice.provider.RemoteServiceDistributionProvider;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
public void start(final BundleContext context) throws Exception {
- SafeRunner.run(new ExtensionRegistryRunnable(context) {
- @Override
- protected void runWithoutRegistry() throws Exception {
- context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(TimeServiceServerContainer.TIMESERVICE_HOST_CONFIG_NAME, new TimeServiceServerContainerInstantiator(), "TimeService REST Server", true,false), null);
- }
- });
+ context.registerService(IRemoteServiceDistributionProvider.class,
+ new RemoteServiceDistributionProvider.Builder()
+ .setName(TimeServiceServerContainer.TIMESERVICE_HOST_CONFIG_NAME)
+ .setInstantiator(new TimeServiceServerContainer.Instantiator()).build(),
+ null);
}
public void stop(BundleContext context) throws Exception {
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceHttpServiceComponent.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceHttpServiceComponent.java
index 2dcfe9f92..17caf8756 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceHttpServiceComponent.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceHttpServiceComponent.java
@@ -16,5 +16,5 @@ public class TimeServiceHttpServiceComponent extends HttpServiceComponent {
public TimeServiceHttpServiceComponent() {
// All methods implemented by HttpServiceComponent
}
-
+
}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainer.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainer.java
index 9d4ded369..caf9e5e8d 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainer.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2013 Composent, Inc. and others. All rights reserved. This
+* Copyright (c) 2015 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
@@ -10,55 +10,67 @@
package com.mycorp.examples.timeservice.internal.provider.rest.host;
import java.io.IOException;
+import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.ecf.core.ContainerCreateException;
-import org.eclipse.ecf.core.identity.IDFactory;
+import org.eclipse.ecf.core.ContainerTypeDescription;
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.remoteservice.provider.RemoteServiceContainerInstantiator;
+import org.eclipse.ecf.remoteservice.rest.identity.RestNamespace;
import org.eclipse.ecf.remoteservice.servlet.HttpServiceComponent;
import org.eclipse.ecf.remoteservice.servlet.RemoteServiceHttpServlet;
import org.eclipse.ecf.remoteservice.servlet.ServletServerContainer;
import org.json.JSONException;
import org.json.JSONObject;
-import org.osgi.service.http.HttpService;
import com.mycorp.examples.timeservice.ITimeService;
-import com.mycorp.examples.timeservice.provider.rest.common.TimeServiceRestNamespace;
public class TimeServiceServerContainer extends ServletServerContainer {
public static final String TIMESERVICE_HOST_CONFIG_NAME = "com.mycorp.examples.timeservice.rest.host";
public static final String TIMESERVICE_SERVLET_NAME = "/" + ITimeService.class.getName();
- private final HttpService httpService;
-
- TimeServiceServerContainer(String id, HttpService httpService) throws ContainerCreateException {
- super(IDFactory.getDefault()
- .createID(TimeServiceRestNamespace.NAME, id));
- this.httpService = httpService;
- // Register our servlet with the given httpService with the TIMESERVICE_SERVLET_NAME
+ public static class Instantiator extends RemoteServiceContainerInstantiator {
+ @Override
+ public IContainer createInstance(ContainerTypeDescription description, Map<String, ?> parameters)
+ throws ContainerCreateException {
+ return new TimeServiceServerContainer(
+ RestNamespace.INSTANCE.createInstance(new Object[] { (String) parameters.get("id") }));
+ }
+
+ public String[] getSupportedConfigs(ContainerTypeDescription description) {
+ return new String[] { TIMESERVICE_HOST_CONFIG_NAME };
+ }
+ }
+
+ TimeServiceServerContainer(ID id) throws ContainerCreateException {
+ super(id);
+ // Register our servlet with the given httpService with the
+ // TIMESERVICE_SERVLET_NAME
// which is "/com.mycorp.examples.timeservice.ITimeService"
try {
- this.httpService.registerServlet(TIMESERVICE_SERVLET_NAME,
+ TimeServiceHttpServiceComponent.getDefault().registerServlet(TIMESERVICE_SERVLET_NAME,
new TimeRemoteServiceHttpServlet(), null, null);
} catch (Exception e) {
- throw new ContainerCreateException("Could not create Time Service Server Container",e);
+ throw new ContainerCreateException("Could not create Time Service Server Container", e);
}
}
@Override
public void dispose() {
- httpService.unregister(TIMESERVICE_SERVLET_NAME);
+ TimeServiceHttpServiceComponent.getDefault().unregisterServlet(TIMESERVICE_SERVLET_NAME);
super.dispose();
}
@Override
public Namespace getConnectNamespace() {
- return IDFactory.getDefault().getNamespaceByName(
- TimeServiceRestNamespace.NAME);
+ return RestNamespace.INSTANCE;
}
class TimeRemoteServiceHttpServlet extends RemoteServiceHttpServlet {
@@ -67,21 +79,13 @@ public class TimeServiceServerContainer extends ServletServerContainer {
// Handle get call right here.
@Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
-
- // No arguments to getCurrentTime() method, so
- // nothing to deserialize from request
-
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// Get local OSGi ITimeService
- ITimeService timeService = HttpServiceComponent.getDefault()
- .getService(ITimeService.class);
-
- // Call local service to get the time
+ ITimeService timeService = HttpServiceComponent.getDefault().getService(ITimeService.class);
+ // Call local service to get the current time
Long currentTime = timeService.getCurrentTime();
-
- // Serialize response
- try {
+ // Serialize response and send as http response
+ try {
resp.getOutputStream().print(new JSONObject().put("time", currentTime).toString());
} catch (JSONException e) {
throw new ServletException("json response object could not be created for time service", e);
diff --git a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainerInstantiator.java b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainerInstantiator.java
deleted file mode 100644
index 22860220c..000000000
--- a/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/TimeServiceServerContainerInstantiator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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 com.mycorp.examples.timeservice.internal.provider.rest.host;
-
-import java.util.Map;
-
-import org.eclipse.ecf.core.ContainerCreateException;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.remoteservice.servlet.ServletServerContainerInstantiator;
-import org.osgi.service.http.HttpService;
-
-public class TimeServiceServerContainerInstantiator extends
- ServletServerContainerInstantiator {
-
- @Override
- public IContainer createInstance(ContainerTypeDescription description,
- Object[] parameters) throws ContainerCreateException {
- // Get first http services from HttpServiceComponent
- HttpService httpService = TimeServiceHttpServiceComponent.getDefault()
- .getHttpServices().iterator().next();
- @SuppressWarnings("unchecked")
- // First parameter should be Map
- Map<String, Object> map = (Map<String, Object>) parameters[0];
- // Get the ID parameter from Map
- return new TimeServiceServerContainer((String) map.get("id"),
- httpService);
- }
-
- public String[] getSupportedConfigs(ContainerTypeDescription description) {
- return new String[] { TimeServiceServerContainer.TIMESERVICE_HOST_CONFIG_NAME };
- }
-
-}

Back to the top