You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ui...@apache.org on 2012/06/06 09:04:01 UTC
svn commit: r1346763 [1/3] - in /felix/trunk/http: ./ api/ base/ bridge/
bundle/ cometd/ cometd/src/main/java/org/apache/felix/http/cometd/
cometd/src/main/java/org/apache/felix/http/cometd/internal/ jetty/
jetty/src/main/java/org/apache/felix/http/jet...
Author: uiterlix
Date: Wed Jun 6 07:03:59 2012
New Revision: 1346763
URL: http://svn.apache.org/viewvc?rev=1346763&view=rev
Log:
Upgraded Jetty to Eclipse Jetty 7.6.3 and Cometd to 2.4.2. Fixed cometd sample project for the new cometd version.
Added:
felix/trunk/http/samples/cometd/academic-2.1.txt
felix/trunk/http/samples/cometd/new_bsd.txt
felix/trunk/http/samples/cometd/src-web/
felix/trunk/http/samples/cometd/src-web/dojo/
felix/trunk/http/samples/cometd/src-web/dojo/dojo.js
felix/trunk/http/samples/cometd/src-web/dojo/io/
felix/trunk/http/samples/cometd/src-web/dojo/io/script.js
felix/trunk/http/samples/cometd/src-web/dojox/
felix/trunk/http/samples/cometd/src-web/dojox/cometd.js
felix/trunk/http/samples/cometd/src-web/org/
felix/trunk/http/samples/cometd/src-web/org/cometd.js
Modified:
felix/trunk/http/ (props changed)
felix/trunk/http/api/ (props changed)
felix/trunk/http/base/ (props changed)
felix/trunk/http/bridge/ (props changed)
felix/trunk/http/bundle/ (props changed)
felix/trunk/http/bundle/DEPENDENCIES
felix/trunk/http/bundle/NOTICE
felix/trunk/http/bundle/pom.xml
felix/trunk/http/cometd/ (props changed)
felix/trunk/http/cometd/DEPENDENCIES
felix/trunk/http/cometd/NOTICE
felix/trunk/http/cometd/pom.xml
felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java
felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java
felix/trunk/http/jetty/ (props changed)
felix/trunk/http/jetty/pom.xml
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/MBeanServerTracker.java
felix/trunk/http/proxy/ (props changed)
felix/trunk/http/samples/bridge/ (props changed)
felix/trunk/http/samples/cometd/ (props changed)
felix/trunk/http/samples/cometd/DEPENDENCIES
felix/trunk/http/samples/cometd/NOTICE
felix/trunk/http/samples/cometd/pom.xml
felix/trunk/http/samples/cometd/src/main/java/org/apache/felix/http/samples/cometd/Activator.java
felix/trunk/http/samples/cometd/src/main/java/org/apache/felix/http/samples/cometd/TimeServlet.java
felix/trunk/http/samples/filter/ (props changed)
felix/trunk/http/samples/whiteboard/ (props changed)
felix/trunk/http/whiteboard/ (props changed)
Propchange: felix/trunk/http/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -0,0 +1,2 @@
+target
+.project
Propchange: felix/trunk/http/api/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+maven-eclipse.xml
+.externalToolBuilders
Propchange: felix/trunk/http/base/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+maven-eclipse.xml
+.externalToolBuilders
Propchange: felix/trunk/http/bridge/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Propchange: felix/trunk/http/bundle/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Modified: felix/trunk/http/bundle/DEPENDENCIES
URL: http://svn.apache.org/viewvc/felix/trunk/http/bundle/DEPENDENCIES?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/bundle/DEPENDENCIES (original)
+++ felix/trunk/http/bundle/DEPENDENCIES Wed Jun 6 07:03:59 2012
@@ -7,8 +7,12 @@ Apache software licensed under Apache Li
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
Modified: felix/trunk/http/bundle/NOTICE
URL: http://svn.apache.org/viewvc/felix/trunk/http/bundle/NOTICE?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/bundle/NOTICE (original)
+++ felix/trunk/http/bundle/NOTICE Wed Jun 6 07:03:59 2012
@@ -5,8 +5,12 @@ This product includes software developed
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
Modified: felix/trunk/http/bundle/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/http/bundle/pom.xml?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/bundle/pom.xml (original)
+++ felix/trunk/http/bundle/pom.xml Wed Jun 6 07:03:59 2012
@@ -42,9 +42,12 @@
org.apache.felix.http.bundle.internal.CombinedActivator
</Bundle-Activator>
<Export-Package>
- org.apache.felix.http.api;version=2.0.4;-split-package:=merge-first,
+ org.apache.felix.http.api;version=${project.version};-split-package:=merge-first,
+ org.apache.felix.http.cometd;version=${project.version};-split-package:=merge-first,
org.osgi.service.http;version=1.2.0;-split-package:=merge-first,
- org.cometd;version=1.0.beta7,
+ org.cometd.bayeux;version=2.4.2;-split-package:=merge-first,
+ org.cometd.bayeux.client;version=2.4.2;-split-package:=merge-first,
+ org.cometd.bayeux.server;version=2.4.2;-split-package:=merge-first,
javax.servlet.*;version=2.5;-split-package:=merge-first
</Export-Package>
<Private-Package>
@@ -54,11 +57,15 @@
org.apache.felix.http.cometd.*,
org.apache.felix.http.jetty.*,
org.apache.felix.http.whiteboard.*,
- org.mortbay.*;-split-package:=merge-first
+ org.eclipse.jetty.*;-split-package:=merge-first,
+ org.cometd.server.*;-split-package:=merge-first,
+ org.cometd.common.*;-split-package:=merge-first
</Private-Package>
<Import-Package>
javax.servlet.*,
- org.cometd,
+ org.cometd.bayeux,
+ org.cometd.bayeux.client,
+ org.cometd.bayeux.server,
*;resolution:=optional
</Import-Package>
</instructions>
Propchange: felix/trunk/http/cometd/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Modified: felix/trunk/http/cometd/DEPENDENCIES
URL: http://svn.apache.org/viewvc/felix/trunk/http/cometd/DEPENDENCIES?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/cometd/DEPENDENCIES (original)
+++ felix/trunk/http/cometd/DEPENDENCIES Wed Jun 6 07:03:59 2012
@@ -7,8 +7,12 @@ Apache software licensed under Apache Li
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
Modified: felix/trunk/http/cometd/NOTICE
URL: http://svn.apache.org/viewvc/felix/trunk/http/cometd/NOTICE?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/cometd/NOTICE (original)
+++ felix/trunk/http/cometd/NOTICE Wed Jun 6 07:03:59 2012
@@ -5,8 +5,12 @@ This product includes software developed
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
Modified: felix/trunk/http/cometd/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/http/cometd/pom.xml?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/cometd/pom.xml (original)
+++ felix/trunk/http/cometd/pom.xml Wed Jun 6 07:03:59 2012
@@ -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>
Modified: felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java (original)
+++ felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/CometdService.java Wed Jun 6 07:03:59 2012
@@ -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;
}
Modified: felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java (original)
+++ felix/trunk/http/cometd/src/main/java/org/apache/felix/http/cometd/internal/CometdServiceImpl.java Wed Jun 6 07:03:59 2012
@@ -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 @@ public final class CometdServiceImpl
private ServiceRegistration configServiceReg;
private ServiceTracker httpServiceTracker;
private ServiceRegistration cometdServiceReg;
- private ContinuationCometdServlet continuationCometdServlet;
+ private CometdServlet continuationCometdServlet;
public CometdServiceImpl(BundleContext context)
{
@@ -109,10 +110,12 @@ public final class CometdServiceImpl
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 final class CometdServiceImpl
}
}
- public Bayeux getBayeux() {
+ public BayeuxServer getBayeuxServer() {
return this.continuationCometdServlet.getBayeux();
}
}
Propchange: felix/trunk/http/jetty/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Modified: felix/trunk/http/jetty/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/pom.xml?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/jetty/pom.xml (original)
+++ felix/trunk/http/jetty/pom.xml Wed Jun 6 07:03:59 2012
@@ -49,7 +49,7 @@
<Private-Package>
org.apache.felix.http.base.*,
org.apache.felix.http.jetty.*,
- org.mortbay.*;-split-package:=merge-first
+ org.eclipse.*;-split-package:=merge-first
</Private-Package>
<Import-Package>
javax.net.ssl; javax.security.cert;
@@ -83,24 +83,29 @@
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.24</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>7.6.3.v20120416</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>7.6.3.v20120416</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
- <version>6.1.24</version>
+ <version>7.6.3.v20120416</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-management</artifactId>
- <version>6.1.24</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jmx</artifactId>
+ <version>7.6.3.v20120416</version>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-sslengine</artifactId>
- <version>6.1.24</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-security</artifactId>
+ <version>7.6.3.v20120416</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java Wed Jun 6 07:03:59 2012
@@ -16,13 +16,14 @@
*/
package org.apache.felix.http.jetty.internal;
-import org.osgi.framework.BundleContext;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
-import java.util.Hashtable;
+
+import org.osgi.framework.BundleContext;
public final class JettyConfig
{
@@ -112,7 +113,6 @@ public final class JettyConfig
private boolean useHttpsNio;
private boolean registerMBeans;
private int sessionTimeout;
- private int headerBufferSize;
private int requestBufferSize;
private int responseBufferSize;
private String contextPath;
@@ -232,11 +232,6 @@ public final class JettyConfig
return this.sessionTimeout;
}
- public int getHeaderBufferSize()
- {
- return this.headerBufferSize;
- }
-
public int getRequestBufferSize()
{
return this.requestBufferSize;
@@ -280,7 +275,6 @@ public final class JettyConfig
this.useHttpsNio = getBooleanProperty(props, FELIX_HTTPS_NIO, this.useHttpNio);
this.registerMBeans = getBooleanProperty(props, FELIX_HTTP_MBEANS, false);
this.sessionTimeout = getIntProperty(props, FELIX_SESSION_TIMEOUT, 0);
- this.headerBufferSize = getIntProperty(FELIX_JETTY_HEADER_BUFFER_SIZE, 16 * 1024);
this.requestBufferSize = getIntProperty(FELIX_JETTY_REQUEST_BUFFER_SIZE, 8 * 014);
this.responseBufferSize = getIntProperty(FELIX_JETTY_RESPONSE_BUFFER_SIZE, 24 * 1024);
this.contextPath = validateContextPath(getProperty(props, FELIX_HTTP_CONTEXT_PATH, null));
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyLogger.java Wed Jun 6 07:03:59 2012
@@ -16,11 +16,10 @@
*/
package org.apache.felix.http.jetty.internal;
-import org.mortbay.log.Logger;
-import org.mortbay.log.Log;
+import java.text.MessageFormat;
+
import org.apache.felix.http.base.internal.logger.SystemLogger;
-import java.io.PrintStream;
-import java.io.ByteArrayOutputStream;
+import org.eclipse.jetty.util.log.Logger;
public final class JettyLogger
implements Logger
@@ -30,7 +29,7 @@ public final class JettyLogger
public JettyLogger()
{
- this("org.mortbay.log");
+ this("org.eclipse.jetty.log");
}
public JettyLogger(String name)
@@ -55,69 +54,57 @@ public final class JettyLogger
this.debugEnabled = enabled;
}
- public void debug(String msg, Throwable cause)
- {
- if (this.debugEnabled) {
- SystemLogger.debug(msg);
- }
- }
-
- public void debug(String msg, Object arg0, Object arg1)
- {
- if (this.debugEnabled) {
- SystemLogger.debug(format(msg, arg0, arg1));
- }
- }
-
- public void info(String msg, Object arg0, Object arg1)
- {
- // Classify all info messages as debug messages.
- // Jetty uses way to much verbose info messages.
- if (this.debugEnabled) {
- SystemLogger.info(format(msg, arg0, arg1));
- }
- }
-
- public void warn(String msg, Throwable cause)
- {
- SystemLogger.warning(msg, cause);
- }
-
- public void warn( String msg, Object arg0, Object arg1 )
- {
- SystemLogger.warning(format(msg, arg0, arg1), null);
- }
-
- public String toString()
- {
- return this.name;
- }
-
- private String format(String msg, Object arg0, Object arg1)
- {
- int i0 = msg.indexOf("{}");
- int i1 = i0 < 0 ? -1 : msg.indexOf("{}", i0 + 2);
+ public void debug(Throwable throwable) {
+ if (this.debugEnabled) {
+ SystemLogger.debug(throwable.getMessage());
+ }
+
+ }
+
+ public void debug(String msg, Object... args) {
+ if (this.debugEnabled) {
+ SystemLogger.debug(MessageFormat.format(msg, args));
+ }
+ }
+
+ public void debug(String msg, Throwable throwable) {
+ if (this.debugEnabled) {
+ SystemLogger.debug(msg + ": " + throwable.getMessage());
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void ignore(Throwable throwable) {
+
+ }
+
+ public void info(Throwable throwable) {
+ SystemLogger.info(throwable.getMessage());
+ }
+
+ public void info(String msg, Object... args) {
+ SystemLogger.info(MessageFormat.format(msg, args));
+
+ }
+
+ public void info(String msg, Throwable throwable) {
+ SystemLogger.info(msg + ": " + throwable.getMessage());
+ }
+
+ public void warn(Throwable throwable) {
+ SystemLogger.warning(null, throwable);
+ }
+
+ public void warn(String msg, Object... args) {
+ SystemLogger.warning(MessageFormat.format(msg, args), null);
+
+ }
+
+ public void warn(String msg, Throwable throwable) {
+ SystemLogger.warning(msg, throwable);
+ }
- if (arg1 != null && i1 >= 0) {
- msg = msg.substring(0, i1) + arg1 + msg.substring(i1 + 2);
- }
-
- if (arg0 != null && i0 >= 0) {
- msg = msg.substring(0, i0) + arg0 + msg.substring(i0 + 2);
- }
-
- return msg;
- }
-
- public static void init()
- {
- PrintStream out = System.err;
-
- try {
- System.setErr(new PrintStream(new ByteArrayOutputStream()));
- Log.setLog(new JettyLogger());
- } finally {
- System.setErr(out);
- }
- }
}
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java Wed Jun 6 07:03:59 2012
@@ -24,17 +24,17 @@ import org.apache.felix.http.base.intern
import org.apache.felix.http.base.internal.EventDispatcher;
import org.apache.felix.http.base.internal.HttpServiceController;
import org.apache.felix.http.base.internal.logger.SystemLogger;
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.SessionManager;
-import org.mortbay.jetty.bio.SocketConnector;
-import org.mortbay.jetty.handler.StatisticsHandler;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.HashUserRealm;
-import org.mortbay.jetty.security.SslSelectChannelConnector;
-import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.security.HashLoginService;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.SessionManager;
+import org.eclipse.jetty.server.bio.SocketConnector;
+import org.eclipse.jetty.server.handler.StatisticsHandler;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceRegistration;
@@ -69,8 +69,6 @@ public final class JettyService
public void start()
throws Exception
{
- JettyLogger.init();
-
Properties props = new Properties();
props.put(Constants.SERVICE_PID, PID);
this.configServiceReg = this.context.registerService("org.osgi.service.cm.ManagedService",
@@ -150,13 +148,13 @@ public final class JettyService
if (this.config.isUseHttp() || this.config.isUseHttps())
{
StringBuffer message = new StringBuffer("Started jetty ").append(Server.getVersion()).append(" at port(s)");
- HashUserRealm realm = new HashUserRealm("OSGi HTTP Service Realm");
+ HashLoginService realm = new HashLoginService("OSGi HTTP Service Realm");
this.server = new Server();
// HTTP/1.1 requires Date header if possible (it is)
this.server.setSendDateHeader(true);
- this.server.addUserRealm(realm);
+ this.server.addBean(realm);
if (this.config.isUseHttp())
{
@@ -170,7 +168,8 @@ public final class JettyService
message.append(" HTTPS:").append(this.config.getHttpsPort());
}
- Context context = new Context(this.server, this.config.getContextPath(), Context.SESSIONS);
+ ServletContextHandler context = new ServletContextHandler(this.server, "/", ServletContextHandler.SESSIONS);
+
message.append(" on context path ").append(this.config.getContextPath());
configureSessionManager(context);
context.addEventListener(eventDispatcher);
@@ -181,7 +180,7 @@ public final class JettyService
{
this.mbeanServerTracker = new MBeanServerTracker(this.context, this.server);
this.mbeanServerTracker.open();
- context.addHandler(new StatisticsHandler());
+ context.addBean(new StatisticsHandler());
}
this.server.start();
@@ -307,7 +306,6 @@ public final class JettyService
private void configureConnector(final Connector connector)
{
connector.setMaxIdleTime(this.config.getHttpTimeout());
- connector.setHeaderBufferSize(this.config.getHeaderBufferSize());
connector.setRequestBufferSize(this.config.getRequestBufferSize());
connector.setResponseBufferSize(this.config.getResponseBufferSize());
connector.setHost(this.config.getHost());
@@ -318,14 +316,14 @@ public final class JettyService
// connector.setResponseBufferSize(responseBufferSize);
}
- private void configureSessionManager(final Context context)
+ private void configureSessionManager(final ServletContextHandler context)
{
final SessionManager manager = context.getSessionHandler().getSessionManager();
manager.setMaxInactiveInterval(this.config.getSessionTimeout() * 60);
manager.setSessionCookie(this.config.getProperty(SessionManager.__SessionCookieProperty, SessionManager.__DefaultSessionCookie));
- manager.setSessionURL(this.config.getProperty(SessionManager.__SessionURLProperty, SessionManager.__DefaultSessionURL));
+ manager.setSessionIdPathParameterName(this.config.getProperty(SessionManager.__SessionIdPathParameterNameProperty, SessionManager.__DefaultSessionIdPathParameterName));
manager.setSessionDomain(this.config.getProperty(SessionManager.__SessionDomainProperty, SessionManager.__DefaultSessionDomain));
manager.setSessionPath(this.config.getProperty(SessionManager.__SessionPathProperty, context.getContextPath()));
manager.setMaxCookieAge(this.config.getIntProperty(SessionManager.__MaxAgeProperty, -1));
Modified: felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/MBeanServerTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/MBeanServerTracker.java?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/MBeanServerTracker.java (original)
+++ felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/MBeanServerTracker.java Wed Jun 6 07:03:59 2012
@@ -20,8 +20,8 @@ package org.apache.felix.http.jetty.inte
import javax.management.MBeanServer;
-import org.mortbay.jetty.Server;
-import org.mortbay.management.MBeanContainer;
+import org.eclipse.jetty.jmx.MBeanContainer;
+import org.eclipse.jetty.server.Server;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
Propchange: felix/trunk/http/proxy/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Propchange: felix/trunk/http/samples/bridge/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Propchange: felix/trunk/http/samples/cometd/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 6 07:03:59 2012
@@ -2,3 +2,5 @@ target
.settings
.classpath
.project
+.externalToolBuilders
+maven-eclipse.xml
Modified: felix/trunk/http/samples/cometd/DEPENDENCIES
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/DEPENDENCIES?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/samples/cometd/DEPENDENCIES (original)
+++ felix/trunk/http/samples/cometd/DEPENDENCIES Wed Jun 6 07:03:59 2012
@@ -7,7 +7,9 @@ Apache software licensed under Apache Li
I. Included Third-Party Software
-N/A
+This product includes software developed by
+the cometd project (http://cometd.org)
+Licensed under the Apache License 2.0.
II. Used Third-Party Software
Modified: felix/trunk/http/samples/cometd/NOTICE
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/NOTICE?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/samples/cometd/NOTICE (original)
+++ felix/trunk/http/samples/cometd/NOTICE Wed Jun 6 07:03:59 2012
@@ -4,3 +4,11 @@ Copyright 2011 The Apache Software Found
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Licensed under the Apache License 2.0.
+
+This product includes software developed by
+the cometd project (http://cometd.org)
+Licensed under the Apache License 2.0.
+
+This product includes software developed by
+the cometd project (http://cometd.org)
+Licensed under the academic free license 1.2 or new BSD license.
\ No newline at end of file
Added: felix/trunk/http/samples/cometd/academic-2.1.txt
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/academic-2.1.txt?rev=1346763&view=auto
==============================================================================
--- felix/trunk/http/samples/cometd/academic-2.1.txt (added)
+++ felix/trunk/http/samples/cometd/academic-2.1.txt Wed Jun 6 07:03:59 2012
@@ -0,0 +1,153 @@
+The Academic Free License, v. 2.1 (for cometd.dojox):
+**********************************
+
+This Academic Free License (the "License") applies to any original work of
+authorship (the "Original Work") whose owner (the "Licensor") has placed the
+following notice immediately following the copyright notice for the Original
+Work:
+
+Licensed under the Academic Free License version 2.1
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, sublicenseable license to do the
+following:
+
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the Original
+Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the
+public;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
+claims owned or controlled by the Licensor that are embodied in the Original
+Work as furnished by the Licensor, to make, use, sell and offer for sale the
+Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred
+form of the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor hereby
+agrees to provide a machine-readable copy of the Source Code of the Original
+Work along with each copy of the Original Work that Licensor distributes.
+Licensor reserves the right to satisfy this obligation by placing a
+machine-readable copy of the Source Code in an information repository
+reasonably calculated to permit inexpensive and convenient access by You for as
+long as Licensor continues to distribute the Original Work, and by publishing
+the address of that information repository in a notice immediately following
+the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names
+of any contributors to the Original Work, nor any of their trademarks or
+service marks, may be used to endorse or promote products derived from this
+Original Work without express prior written permission of the Licensor. Nothing
+in this License shall be deemed to grant any rights to trademarks, copyrights,
+patents, trade secrets or any other intellectual property of Licensor except as
+expressly stated herein. No patent license is granted to make, use, sell or
+offer to sell embodiments of any patent claims other than the licensed claims
+defined in Section 2. No right is granted to the trademarks of Licensor even if
+such marks are included in the Original Work. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under different terms from this
+License any Original Work that Licensor otherwise would have a right to
+license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative
+Works that You create, all copyright, patent or trademark notices from the
+Source Code of the Original Work, as well as any notices of licensing and any
+descriptive text identified therein as an "Attribution Notice." You must cause
+the Source Code for any Derivative Works that You create to carry a prominent
+Attribution Notice reasonably calculated to inform recipients that You have
+modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
+the copyright in and to the Original Work and the patent rights granted herein
+by Licensor are owned by the Licensor or are sublicensed to You under the terms
+of this License with the permission of the contributor(s) of those copyrights
+and patent rights. Except as expressly stated in the immediately proceeding
+sentence, the Original Work is provided under this License on an "AS IS" BASIS
+and WITHOUT WARRANTY, either express or implied, including, without limitation,
+the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
+This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
+license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to any person for any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License
+or the use of the Original Work including, without limitation, damages for loss
+of goodwill, work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses. This limitation of liability shall not
+apply to liability for death or personal injury resulting from Licensor's
+negligence to the extent applicable law prohibits such limitation. Some
+jurisdictions do not allow the exclusion or limitation of incidental or
+consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or
+a Derivative Work, You must make a reasonable effort under the circumstances to
+obtain the express assent of recipients to the terms of this License. Nothing
+else but this License (or another written agreement between Licensor and You)
+grants You permission to create Derivative Works based upon the Original Work
+or to exercise any of the rights granted in Section 1 herein, and any attempt
+to do so except under the terms of this License (or another written agreement
+between Licensor and You) is expressly prohibited by U.S. copyright law, the
+equivalent laws of other countries, and by international treaty. Therefore, by
+exercising any of the rights granted to You in Section 1 herein, You indicate
+Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically
+and You may no longer exercise any of the rights granted to You by this License
+as of the date You commence an action, including a cross-claim or counterclaim,
+against Licensor or any licensee alleging that the Original Work infringes a
+patent. This termination provision shall not apply for an action alleging
+patent infringement by combinations of the Original Work with other software or
+hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
+License may be brought only in the courts of a jurisdiction wherein the
+Licensor resides or in which Licensor conducts its primary business, and under
+the laws of that jurisdiction excluding its conflict-of-law provisions. The
+application of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any use of the Original Work outside the
+scope of this License or after its termination shall be subject to the
+requirements and penalties of the U.S. Copyright Act, 17 U.S.C. ç 101 et
+seq., the equivalent laws of other countries, and international treaty. This
+section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or
+seeking damages relating thereto, the prevailing party shall be entitled to
+recover its costs and expenses, including, without limitation, reasonable
+attorneys' fees and costs incurred in connection with such action, including
+any appeal of such action. This section shall survive the termination of this
+License.
+
+13) Miscellaneous. This License represents the complete agreement concerning
+the subject matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary to
+make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether
+in upper or lower case, means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License. For legal
+entities, "You" includes any entity that controls, is controlled by, or is
+under common control with you. For purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management of such
+entity, whether by contract or otherwise, or (ii) ownership of fifty percent
+(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
+entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises not
+to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
+Permission is hereby granted to copy and distribute this license without
+modification. This license may not be modified without the express written
+permission of its copyright owner.
Added: felix/trunk/http/samples/cometd/new_bsd.txt
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/new_bsd.txt?rev=1346763&view=auto
==============================================================================
--- felix/trunk/http/samples/cometd/new_bsd.txt (added)
+++ felix/trunk/http/samples/cometd/new_bsd.txt Wed Jun 6 07:03:59 2012
@@ -0,0 +1,29 @@
+The "New" BSD License (for cometd.dojox):
+**********************
+
+Copyright (c) 2005-2009, The Dojo Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Dojo Foundation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
Modified: felix/trunk/http/samples/cometd/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/pom.xml?rev=1346763&r1=1346762&r2=1346763&view=diff
==============================================================================
--- felix/trunk/http/samples/cometd/pom.xml (original)
+++ felix/trunk/http/samples/cometd/pom.xml Wed Jun 6 07:03:59 2012
@@ -47,6 +47,10 @@
<Import-Package>
*;resolution:=optional
</Import-Package>
+ <Include-Resource>
+ {maven-resources}, {maven-dependencies},
+ src-web=src-web
+ </Include-Resource>
</instructions>
</configuration>
</plugin>
Added: felix/trunk/http/samples/cometd/src-web/dojo/dojo.js
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/src-web/dojo/dojo.js?rev=1346763&view=auto
==============================================================================
--- felix/trunk/http/samples/cometd/src-web/dojo/dojo.js (added)
+++ felix/trunk/http/samples/cometd/src-web/dojo/dojo.js Wed Jun 6 07:03:59 2012
@@ -0,0 +1,15 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+//>>built
[... 3 lines stripped ...]
Added: felix/trunk/http/samples/cometd/src-web/dojo/io/script.js
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/src-web/dojo/io/script.js?rev=1346763&view=auto
==============================================================================
--- felix/trunk/http/samples/cometd/src-web/dojo/io/script.js (added)
+++ felix/trunk/http/samples/cometd/src-web/dojo/io/script.js Wed Jun 6 07:03:59 2012
@@ -0,0 +1,114 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+//>>built
+define("dojo/io/script",["../main"],function(_1){
+_1.getObject("io",true,_1);
+var _2=_1.isIE?"onreadystatechange":"load",_3=/complete|loaded/;
+_1.io.script={get:function(_4){
+var _5=this._makeScriptDeferred(_4);
+var _6=_5.ioArgs;
+_1._ioAddQueryToUrl(_6);
+_1._ioNotifyStart(_5);
+if(this._canAttach(_6)){
+var _7=this.attach(_6.id,_6.url,_4.frameDoc);
+if(!_6.jsonp&&!_6.args.checkString){
+var _8=_1.connect(_7,_2,function(_9){
+if(_9.type=="load"||_3.test(_7.readyState)){
+_1.disconnect(_8);
+_6.scriptLoaded=_9;
+}
+});
+}
+}
+_1._ioWatch(_5,this._validCheck,this._ioCheck,this._resHandle);
+return _5;
+},attach:function(id,_a,_b){
+var _c=(_b||_1.doc);
+var _d=_c.createElement("script");
+_d.type="text/javascript";
+_d.src=_a;
+_d.id=id;
+_d.async=true;
+_d.charset="utf-8";
+return _c.getElementsByTagName("head")[0].appendChild(_d);
+},remove:function(id,_e){
+_1.destroy(_1.byId(id,_e));
+if(this["jsonp_"+id]){
+delete this["jsonp_"+id];
+}
+},_makeScriptDeferred:function(_f){
+var dfd=_1._ioSetArgs(_f,this._deferredCancel,this._deferredOk,this._deferredError);
+var _10=dfd.ioArgs;
+_10.id=_1._scopeName+"IoScript"+(this._counter++);
+_10.canDelete=false;
+_10.jsonp=_f.callbackParamName||_f.jsonp;
+if(_10.jsonp){
+_10.query=_10.query||"";
+if(_10.query.length>0){
+_10.query+="&";
+}
+_10.query+=_10.jsonp+"="+(_f.frameDoc?"parent.":"")+_1._scopeName+".io.script.jsonp_"+_10.id+"._jsonpCallback";
+_10.frameDoc=_f.frameDoc;
+_10.canDelete=true;
+dfd._jsonpCallback=this._jsonpCallback;
+this["jsonp_"+_10.id]=dfd;
+}
+return dfd;
+},_deferredCancel:function(dfd){
+dfd.canceled=true;
+if(dfd.ioArgs.canDelete){
+_1.io.script._addDeadScript(dfd.ioArgs);
+}
+},_deferredOk:function(dfd){
+var _11=dfd.ioArgs;
+if(_11.canDelete){
+_1.io.script._addDeadScript(_11);
+}
+return _11.json||_11.scriptLoaded||_11;
+},_deferredError:function(_12,dfd){
+if(dfd.ioArgs.canDelete){
+if(_12.dojoType=="timeout"){
+_1.io.script.remove(dfd.ioArgs.id,dfd.ioArgs.frameDoc);
+}else{
+_1.io.script._addDeadScript(dfd.ioArgs);
+}
+}
+return _12;
+},_deadScripts:[],_counter:1,_addDeadScript:function(_13){
+_1.io.script._deadScripts.push({id:_13.id,frameDoc:_13.frameDoc});
+_13.frameDoc=null;
+},_validCheck:function(dfd){
+var _14=_1.io.script;
+var _15=_14._deadScripts;
+if(_15&&_15.length>0){
+for(var i=0;i<_15.length;i++){
+_14.remove(_15[i].id,_15[i].frameDoc);
+_15[i].frameDoc=null;
+}
+_1.io.script._deadScripts=[];
+}
+return true;
+},_ioCheck:function(dfd){
+var _16=dfd.ioArgs;
+if(_16.json||(_16.scriptLoaded&&!_16.args.checkString)){
+return true;
+}
+var _17=_16.args.checkString;
+return _17&&eval("typeof("+_17+") != 'undefined'");
+},_resHandle:function(dfd){
+if(_1.io.script._ioCheck(dfd)){
+dfd.callback(dfd);
+}else{
+dfd.errback(new Error("inconceivable dojo.io.script._resHandle error"));
+}
+},_canAttach:function(_18){
+return true;
+},_jsonpCallback:function(_19){
+this.ioArgs.json=_19;
+}};
+return _1.io.script;
+});
Added: felix/trunk/http/samples/cometd/src-web/dojox/cometd.js
URL: http://svn.apache.org/viewvc/felix/trunk/http/samples/cometd/src-web/dojox/cometd.js?rev=1346763&view=auto
==============================================================================
--- felix/trunk/http/samples/cometd/src-web/dojox/cometd.js (added)
+++ felix/trunk/http/samples/cometd/src-web/dojox/cometd.js Wed Jun 6 07:03:59 2012
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+dojo.provide('dojox.cometd');
+dojo.registerModulePath('org','../org');
+dojo.require('org.cometd');
+dojo.require('dojo.io.script');
+
+// Remap cometd JSON functions to dojo JSON functions
+org.cometd.JSON.toJSON = dojo.toJson;
+org.cometd.JSON.fromJSON = dojo.fromJson;
+
+dojox.Cometd = function(name)
+{
+ var cometd = new org.cometd.Cometd(name);
+
+ function LongPollingTransport()
+ {
+ var _super = new org.cometd.LongPollingTransport();
+ var that = org.cometd.Transport.derive(_super);
+
+ that.xhrSend = function(packet)
+ {
+ var deferred = dojo.rawXhrPost({
+ url: packet.url,
+ sync: packet.sync === true,
+ contentType: 'application/json;charset=UTF-8',
+ headers: packet.headers,
+ postData: packet.body,
+ withCredentials: true,
+ handleAs: 'json',
+ load: packet.onSuccess,
+ error: function(error)
+ {
+ packet.onError(error.message, deferred ? deferred.ioArgs.error : error);
+ }
+ });
+ return deferred.ioArgs.xhr;
+ };
+
+ return that;
+ }
+
+ function CallbackPollingTransport()
+ {
+ var _super = new org.cometd.CallbackPollingTransport();
+ var that = org.cometd.Transport.derive(_super);
+
+ that.jsonpSend = function(packet)
+ {
+ var deferred = dojo.io.script.get({
+ url: packet.url,
+ sync: packet.sync === true,
+ callbackParamName: 'jsonp',
+ content: {
+ // In callback-polling, the content must be sent via the 'message' parameter
+ message: packet.body
+ },
+ load: packet.onSuccess,
+ error: function(error)
+ {
+ packet.onError(error.message, deferred ? deferred.ioArgs.error : error);
+ }
+ });
+ return undefined;
+ };
+
+ return that;
+ }
+
+ // Registration order is important
+ if (org.cometd.WebSocket)
+ {
+ cometd.registerTransport('websocket', new org.cometd.WebSocketTransport());
+ }
+ cometd.registerTransport('long-polling', new LongPollingTransport());
+ cometd.registerTransport('callback-polling', new CallbackPollingTransport());
+
+ return cometd;
+};
+
+// The default cometd instance
+dojox.cometd = new dojox.Cometd();
+
+// Create a compatibility API for dojox.cometd instance with
+// the original API.
+
+dojox.cometd._init = dojox.cometd.init;
+
+dojox.cometd._unsubscribe = dojox.cometd.unsubscribe;
+
+dojox.cometd.unsubscribe = function(channelOrToken, objOrFunc, funcName)
+{
+ if (typeof channelOrToken === 'string')
+ {
+ throw "Deprecated function unsubscribe(string). Use unsubscribe(object) passing as argument the return value of subscribe()";
+ }
+
+ dojox.cometd._unsubscribe(channelOrToken);
+};
+
+dojox.cometd._metaHandshakeEvent = function(event)
+{
+ event.action = "handshake";
+ dojo.publish("/cometd/meta", [event]);
+};
+
+dojox.cometd._metaConnectEvent = function(event)
+{
+ event.action = "connect";
+ dojo.publish("/cometd/meta", [event]);
+};
+
+dojox.cometd.addListener('/meta/handshake', dojox.cometd, dojox.cometd._metaHandshakeEvent);
+dojox.cometd.addListener('/meta/connect', dojox.cometd, dojox.cometd._metaConnectEvent);