FELIX-1796 Added cometd support to HTTP service.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1076920 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/bundle/pom.xml b/http/bundle/pom.xml
index e744957..87dae0b 100644
--- a/http/bundle/pom.xml
+++ b/http/bundle/pom.xml
@@ -43,18 +43,21 @@
<Export-Package>
org.apache.felix.http.api;version=2.0.4;-split-package:=merge-first,
org.osgi.service.http;version=1.2.0;-split-package:=merge-first,
+ org.cometd;version=1.0.beta7,
javax.servlet.*;version=2.5;-split-package:=merge-first
</Export-Package>
<Private-Package>
org.apache.felix.http.base.*;-split-package:=merge-first,
org.apache.felix.http.bridge.*,
org.apache.felix.http.bundle.*,
+ org.apache.felix.http.cometd.*,
org.apache.felix.http.jetty.*,
org.apache.felix.http.whiteboard.*,
org.mortbay.*;-split-package:=merge-first
</Private-Package>
<Import-Package>
javax.servlet.*,
+ org.cometd,
*;resolution:=optional
</Import-Package>
</instructions>
@@ -86,6 +89,11 @@
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
+ <artifactId>org.apache.felix.http.cometd</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
<artifactId>org.apache.felix.http.jetty</artifactId>
<version>${pom.version}</version>
</dependency>
diff --git a/http/bundle/src/main/java/org/apache/felix/http/bundle/internal/CombinedActivator.java b/http/bundle/src/main/java/org/apache/felix/http/bundle/internal/CombinedActivator.java
index d1c73fe..cdd4e2d 100644
--- a/http/bundle/src/main/java/org/apache/felix/http/bundle/internal/CombinedActivator.java
+++ b/http/bundle/src/main/java/org/apache/felix/http/bundle/internal/CombinedActivator.java
@@ -20,6 +20,7 @@
import org.osgi.framework.BundleContext;
import org.apache.felix.http.bridge.internal.BridgeActivator;
import org.apache.felix.http.whiteboard.internal.WhiteboardActivator;
+import org.apache.felix.http.cometd.internal.CometdActivator;
import org.apache.felix.http.jetty.internal.JettyActivator;
public final class CombinedActivator
@@ -27,10 +28,12 @@
{
private final static String JETTY_ENABLED_PROP = "org.apache.felix.http.jettyEnabled";
private final static String WHITEBOARD_ENABLED_PROP = "org.apache.felix.http.whiteboardEnabled";
+ private final static String COMETD_ENABLED_PROP = "org.apache.felix.http.cometdEnabled";
private BundleActivator jettyActivator;
private BundleActivator bridgeActivator;
private BundleActivator whiteboardActivator;
+ private BundleActivator cometdActivator;
public void start(BundleContext context)
throws Exception
@@ -45,6 +48,10 @@
this.whiteboardActivator = new WhiteboardActivator();
}
+ if ("true".equals(context.getProperty(COMETD_ENABLED_PROP))) {
+ this.cometdActivator = new CometdActivator();
+ }
+
if (this.jettyActivator != null) {
this.jettyActivator.start(context);
}
@@ -56,11 +63,19 @@
if (this.whiteboardActivator != null) {
this.whiteboardActivator.start(context);
}
+
+ if (this.cometdActivator != null) {
+ this.cometdActivator.start(context);
+ }
}
public void stop(BundleContext context)
throws Exception
{
+ if (this.cometdActivator != null) {
+ this.cometdActivator.stop(context);
+ }
+
if (this.whiteboardActivator != null) {
this.whiteboardActivator.stop(context);
}