FELIX-2292 Upgraded Jetty to Eclipse Jetty 7.6.3 and Cometd to 2.4.2. Fixed cometd sample project for the new cometd version.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1346763 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/cometd/DEPENDENCIES b/http/cometd/DEPENDENCIES
index dc4222f..b5d4162 100644
--- a/http/cometd/DEPENDENCIES
+++ b/http/cometd/DEPENDENCIES
@@ -7,8 +7,12 @@
I. Included Third-Party Software
+This product includes software developed at
+Eclipse (http://eclipse.org)
+Licensed under the Apache License 2.0.
+
This product includes software developed by
-Mortbay (http://mortbay.org)
+the cometd project (http://cometd.org)
Licensed under the Apache License 2.0.
This product includes software developed at
diff --git a/http/cometd/NOTICE b/http/cometd/NOTICE
index 60a7467..239ff76 100644
--- a/http/cometd/NOTICE
+++ b/http/cometd/NOTICE
@@ -5,8 +5,12 @@
The Apache Software Foundation (http://www.apache.org/).
Licensed under the Apache License 2.0.
+This product includes software developed at
+Eclipse (http://eclipse.org)
+Licensed under the Apache License 2.0.
+
This product includes software developed by
-Mortbay (http://mortbay.org)
+the cometd project (http://cometd.org)
Licensed under the Apache License 2.0.
This product includes software developed at
diff --git a/http/cometd/pom.xml b/http/cometd/pom.xml
index 90e037f..659c5a5 100644
--- a/http/cometd/pom.xml
+++ b/http/cometd/pom.xml
@@ -43,16 +43,18 @@
</Bundle-Activator>
<Export-Package>
org.apache.felix.http.cometd;version=${project.version},
- org.cometd;version=1.1.4
+ org.cometd.bayeux;version=2.4.2,
+ org.cometd.bayeux.client;version=2.4.2,
+ org.cometd.client;version=2.4.2
</Export-Package>
<Private-Package>
org.apache.felix.http.base.*,
org.apache.felix.http.cometd.internal
</Private-Package>
<Embed-Dependency>
- cometd-jetty;inline=true,
+ cometd-java-server;inline=true,
+ cometd-java-common;inline=true,
jetty-util;inline=true,
- jetty-util5;inline=true
</Embed-Dependency>
</instructions>
</configuration>
@@ -77,24 +79,29 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
- <version>6.1.26</version>
+ <version>7.6.3.v20120416</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util5</artifactId>
- <version>6.1.26</version>
+ <groupId>org.cometd.java</groupId>
+ <artifactId>cometd-java-server</artifactId>
+ <version>2.4.2</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>cometd-jetty</artifactId>
- <version>6.1.15</version>
- </dependency>
+ <groupId>org.cometd.java</groupId>
+ <artifactId>cometd-java-client</artifactId>
+ <version>2.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cometd.java</groupId>
+ <artifactId>cometd-java-common</artifactId>
+ <version>2.4.2</version>
+ </dependency>
<dependency>
<groupId>org.cometd.java</groupId>
- <artifactId>cometd-api</artifactId>
- <version>1.1.4</version>
+ <artifactId>bayeux-api</artifactId>
+ <version>2.4.2</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
diff --git a/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java b/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java
index b55df45..fc5c90b 100644
--- a/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java
+++ b/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java
@@ -17,10 +17,11 @@
package org.apache.felix.http.cometd;
import javax.servlet.ServletException;
-import org.cometd.Bayeux;
+
+import org.cometd.bayeux.server.BayeuxServer;
public interface CometdService
{
- public Bayeux getBayeux()
+ public BayeuxServer getBayeuxServer()
throws ServletException;
}
diff --git a/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java b/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java
index 3dd832e..acdaa45 100644
--- a/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java
+++ b/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java
@@ -16,24 +16,25 @@
*/
package org.apache.felix.http.cometd.internal;
-import org.apache.felix.http.cometd.CometdService;
-import org.apache.felix.http.base.internal.logger.SystemLogger;
-import org.cometd.Bayeux;
-import org.mortbay.cometd.continuation.ContinuationCometdServlet;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Properties;
-import org.osgi.service.cm.ManagedService;
-import org.osgi.service.http.HttpService;
+import javax.servlet.http.HttpServlet;
+
+import org.apache.felix.http.base.internal.logger.SystemLogger;
+import org.apache.felix.http.cometd.CometdService;
+import org.cometd.bayeux.server.BayeuxServer;
+import org.cometd.server.CometdServlet;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.service.http.HttpService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
-import java.util.Properties;
-import java.util.Dictionary;
-import javax.servlet.http.HttpServlet;
-
public final class CometdServiceImpl
extends HttpServlet
implements ManagedService, ServiceTrackerCustomizer, CometdService
@@ -46,7 +47,7 @@
private ServiceRegistration configServiceReg;
private ServiceTracker httpServiceTracker;
private ServiceRegistration cometdServiceReg;
- private ContinuationCometdServlet continuationCometdServlet;
+ private CometdServlet continuationCometdServlet;
public CometdServiceImpl(BundleContext context)
{
@@ -109,10 +110,12 @@
private void register(HttpService httpService) {
if (this.continuationCometdServlet == null) {
- this.continuationCometdServlet = new ContinuationCometdServlet();
+ this.continuationCometdServlet = new CometdServlet();
}
try {
- httpService.registerServlet(this.config.getPath(), this.continuationCometdServlet, null, null);
+ Dictionary dictionary = new Hashtable();
+ dictionary.put("requestAvailable","true");
+ httpService.registerServlet(this.config.getPath(), this.continuationCometdServlet, dictionary, null);
}
catch (Exception e) {
SystemLogger.error("Failed to register ContinuationCometdServlet to " + this.config.getPath(), e);
@@ -129,7 +132,7 @@
}
}
- public Bayeux getBayeux() {
+ public BayeuxServer getBayeuxServer() {
return this.continuationCometdServlet.getBayeux();
}
}