From 73f08b8dbccfc3279f86a51657e6df1a2d3cae93 Mon Sep 17 00:00:00 2001 From: Hubert Iwaniuk Date: Mon, 16 Mar 2009 01:34:06 +0100 Subject: [PATCH] Configured Declarative Services, this is much nicer to work with than ServiceTracker. --- pom.xml | 11 ++++++++- .../httpservice/gitorial/impl/Activator.java | 23 ------------------- .../impl/RegisterServletComponent.java | 11 +++++++++ 3 files changed, 21 insertions(+), 24 deletions(-) delete mode 100644 src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/Activator.java create mode 100644 src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/RegisterServletComponent.java diff --git a/pom.xml b/pom.xml index 9373c86..e472999 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,10 @@ * org.osgi.service.http.HttpService pl.kungfoo.grizzly.osgi.httpservice.gitorial.impl - pl.kungfoo.grizzly.osgi.httpservice.gitorial.impl.Activator + + pl.kungfoo.grizzly.osgi.httpservice.gitorial.impl.RegisterServletComponent; + http=org.osgi.service.http.HttpService + @@ -99,6 +102,12 @@ grizzly-httpservice-bundle ${grizzly.version} + + + org.apache.felix + org.apache.felix.scr + 1.0.6 + diff --git a/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/Activator.java b/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/Activator.java deleted file mode 100644 index 4edb1f8..0000000 --- a/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/Activator.java +++ /dev/null @@ -1,23 +0,0 @@ -package pl.kungfoo.grizzly.osgi.httpservice.gitorial.impl; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Bundle activator. - */ -public class Activator implements BundleActivator { - - /** - * {@inheritDoc} - */ - public void start(final BundleContext bundleContext) throws Exception { - } - - /** - * {@inheritDoc} - */ - public void stop(BundleContext bundleContext) throws Exception { - } -} - diff --git a/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/RegisterServletComponent.java b/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/RegisterServletComponent.java new file mode 100644 index 0000000..1404322 --- /dev/null +++ b/src/main/java/pl/kungfoo/grizzly/osgi/httpservice/gitorial/impl/RegisterServletComponent.java @@ -0,0 +1,11 @@ +package pl.kungfoo.grizzly.osgi.httpservice.gitorial.impl; + +import org.osgi.service.http.*; + +public class RegisterServletComponent { + + public void setHttp(HttpService http) { + System.out.println("Got Http Service: " + http); + } +} +