diff options
author | slewis | 2014-03-30 19:40:15 +0000 |
---|---|---|
committer | slewis | 2014-03-30 19:40:15 +0000 |
commit | 4f51d8936db04c988aa3516c5da43472477cbf3c (patch) | |
tree | 73e7bb5e1e0d2977894a91f085d053516e1663be /examples/bundles/com.mycorp.examples.timeservice.provider.rest.host | |
parent | 9ea8e9999bfceaec9435025ad890189635aa39f8 (diff) | |
download | org.eclipse.ecf-4f51d8936db04c988aa3516c5da43472477cbf3c.tar.gz org.eclipse.ecf-4f51d8936db04c988aa3516c5da43472477cbf3c.tar.xz org.eclipse.ecf-4f51d8936db04c988aa3516c5da43472477cbf3c.zip |
Changes to remote timeservice examples to support usage of
java8/completablefuture and use of no extension registry as per bug
421569. Also changed launch configs to product configs...to allow for
easier/more flexible usage by consumers of these examples.
Change-Id: I772ac9aa201af1e6e9c57bc08cfb88bc1b1334a8
Diffstat (limited to 'examples/bundles/com.mycorp.examples.timeservice.provider.rest.host')
2 files changed, 24 insertions, 0 deletions
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 65d9c49d3..d4b943375 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 @@ -21,3 +21,4 @@ Import-Package: com.mycorp.examples.timeservice;version="1.0.0", org.osgi.service.http Service-Component: OSGI-INF/httpservicecomponent.xml Bundle-ActivationPolicy: lazy +Bundle-Activator: com.mycorp.examples.timeservice.internal.provider.rest.host.Activator 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 new file mode 100644 index 000000000..3be5e913b --- /dev/null +++ b/examples/bundles/com.mycorp.examples.timeservice.provider.rest.host/src/com/mycorp/examples/timeservice/internal/provider/rest/host/Activator.java @@ -0,0 +1,23 @@ +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.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); + } + }); + } + + public void stop(BundleContext context) throws Exception { + } + +} |