Commit cc1e9e7d authored by Günther Niess's avatar Günther Niess Committed by niess

OF-46: Updating Jetty to 7.0.1.v20091125

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11546 b35dd754-fafc-0310-a699-88a17e54d16e
parent 506bd724
...@@ -15,9 +15,15 @@ dbutil.jar | Jive Code, no release version. ...@@ -15,9 +15,15 @@ dbutil.jar | Jive Code, no release version.
hamcrest.jar | 1.0 (JMock 2.1.0) | New BSD License hamcrest.jar | 1.0 (JMock 2.1.0) | New BSD License
hamcrest-api.jar | 1.0 (JMock 2.1.0) | New BSD License hamcrest-api.jar | 1.0 (JMock 2.1.0) | New BSD License
hsqldb.jar | 1.8.0.5 | BSD (http://hsqldb.org/web/hsqlLicense.html) hsqldb.jar | 1.8.0.5 | BSD (http://hsqldb.org/web/hsqlLicense.html)
jetty.jar | Jetty 6.1.10 | Apache 2.0 jetty-continuation.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-sslengine.jar | Jetty 6.1.10 | Apache 2.0 jetty-http.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-util.jar | Jetty 6.1.10 | Apache 2.0 jetty-io.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-security.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-server.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-servlet.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-util.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-webapp.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jetty-xml.jar | Jetty 7.0.1.v20091125 | Apache 2.0, Eclipse 1.0
jasper-compiler.jar | Jetty 6.1.0 (5.5.15) | jasper-compiler.jar | Jetty 6.1.0 (5.5.15) |
jasper-runtime.jar | Jetty 6.1.0 (5.5.15) | jasper-runtime.jar | Jetty 6.1.0 (5.5.15) |
jaxen.jar | 1.1 beta 4 (from DOM4J 1.6.1) | Apache 1.1 jaxen.jar | 1.1 beta 4 (from DOM4J 1.6.1) | Apache 1.1
......
...@@ -33,15 +33,18 @@ import org.jivesoftware.util.CertificateManager; ...@@ -33,15 +33,18 @@ import org.jivesoftware.util.CertificateManager;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.StringUtils; import org.jivesoftware.util.StringUtils;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler; import org.eclipse.jetty.server.Connector;
import org.mortbay.jetty.Server; import org.eclipse.jetty.server.Handler;
import org.mortbay.jetty.handler.ContextHandlerCollection; import org.eclipse.jetty.server.Server;
import org.mortbay.jetty.handler.DefaultHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.mortbay.jetty.nio.SelectChannelConnector; import org.eclipse.jetty.server.handler.DefaultHandler;
import org.mortbay.jetty.security.SslSelectChannelConnector; import org.eclipse.jetty.server.handler.HandlerCollection;
import org.mortbay.jetty.servlet.Context; import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.webapp.WebAppContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -53,7 +56,7 @@ import org.slf4j.LoggerFactory; ...@@ -53,7 +56,7 @@ import org.slf4j.LoggerFactory;
*/ */
public class AdminConsolePlugin implements Plugin { public class AdminConsolePlugin implements Plugin {
private static final Logger Log = LoggerFactory.getLogger(AdminConsolePlugin.class); private static final Logger Log = LoggerFactory.getLogger(AdminConsolePlugin.class);
/** /**
* Random secret used by JVM to allow SSO. Only other cluster nodes can use this secret * Random secret used by JVM to allow SSO. Only other cluster nodes can use this secret
...@@ -78,7 +81,7 @@ public class AdminConsolePlugin implements Plugin { ...@@ -78,7 +81,7 @@ public class AdminConsolePlugin implements Plugin {
contexts = new ContextHandlerCollection(); contexts = new ContextHandlerCollection();
// Configure Jetty logging to a more reasonable default. // Configure Jetty logging to a more reasonable default.
System.setProperty("org.mortbay.log.class", "org.jivesoftware.util.log.util.JettyLog"); System.setProperty("org.eclipse.jetty.util.log.class", "org.jivesoftware.util.log.util.JettyLog");
// JSP 2.0 uses commons-logging, so also override that implementation. // JSP 2.0 uses commons-logging, so also override that implementation.
System.setProperty("org.apache.commons.logging.LogFactory", "org.jivesoftware.util.log.util.CommonsLogFactory"); System.setProperty("org.apache.commons.logging.LogFactory", "org.jivesoftware.util.log.util.CommonsLogFactory");
} }
...@@ -150,7 +153,9 @@ public class AdminConsolePlugin implements Plugin { ...@@ -150,7 +153,9 @@ public class AdminConsolePlugin implements Plugin {
return; return;
} }
adminServer.setHandlers(new Handler[] { contexts, new DefaultHandler() }); HandlerCollection collection = new HandlerCollection();
adminServer.setHandler(collection);
collection.setHandlers(new Handler[] { contexts, new DefaultHandler() });
try { try {
adminServer.start(); adminServer.start();
...@@ -277,7 +282,7 @@ public class AdminConsolePlugin implements Plugin { ...@@ -277,7 +282,7 @@ public class AdminConsolePlugin implements Plugin {
} }
private void createWebAppContext() { private void createWebAppContext() {
Context context; ServletContextHandler context;
// Add web-app. Check to see if we're in development mode. If so, we don't // Add web-app. Check to see if we're in development mode. If so, we don't
// add the normal web-app location, but the web-app in the project directory. // add the normal web-app location, but the web-app in the project directory.
if (Boolean.getBoolean("developmentMode")) { if (Boolean.getBoolean("developmentMode")) {
......
...@@ -35,16 +35,19 @@ import org.jivesoftware.util.CertificateManager; ...@@ -35,16 +35,19 @@ import org.jivesoftware.util.CertificateManager;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.PropertyEventDispatcher; import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener; import org.jivesoftware.util.PropertyEventListener;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler; import org.eclipse.jetty.server.Connector;
import org.mortbay.jetty.Server; import org.eclipse.jetty.server.Handler;
import org.mortbay.jetty.handler.ContextHandler; import org.eclipse.jetty.server.Server;
import org.mortbay.jetty.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.ContextHandler;
import org.mortbay.jetty.handler.DefaultHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.mortbay.jetty.nio.SelectChannelConnector; import org.eclipse.jetty.server.handler.DefaultHandler;
import org.mortbay.jetty.security.SslSelectChannelConnector; import org.eclipse.jetty.server.handler.HandlerCollection;
import org.mortbay.jetty.servlet.ServletHandler; import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.webapp.WebAppContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -90,7 +93,7 @@ public final class HttpBindManager { ...@@ -90,7 +93,7 @@ public final class HttpBindManager {
private HttpBindManager() { private HttpBindManager() {
// Configure Jetty logging to a more reasonable default. // Configure Jetty logging to a more reasonable default.
System.setProperty("org.mortbay.log.class", "org.jivesoftware.util.log.util.JettyLog"); System.setProperty("org.eclipse.jetty.util.log.class", "org.jivesoftware.util.log.util.JettyLog");
// JSP 2.0 uses commons-logging, so also override that implementation. // JSP 2.0 uses commons-logging, so also override that implementation.
System.setProperty("org.apache.commons.logging.LogFactory", "org.jivesoftware.util.log.util.CommonsLogFactory"); System.setProperty("org.apache.commons.logging.LogFactory", "org.jivesoftware.util.log.util.CommonsLogFactory");
...@@ -321,13 +324,16 @@ public final class HttpBindManager { ...@@ -321,13 +324,16 @@ public final class HttpBindManager {
createCrossDomainHandler(contexts, "/"); createCrossDomainHandler(contexts, "/");
loadStaticDirectory(contexts); loadStaticDirectory(contexts);
httpBindServer.setHandlers(new Handler[]{contexts, new DefaultHandler()}); HandlerCollection collection = new HandlerCollection();
httpBindServer.setHandler(collection);
collection.setHandlers(new Handler[] { contexts, new DefaultHandler() });
} }
private void createBoshHandler(ContextHandlerCollection contexts, String boshPath) { private void createBoshHandler(ContextHandlerCollection contexts, String boshPath) {
ServletHandler handler = new ServletHandler(); ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(HttpBindServlet.class, "/"); handler.addServletWithMapping(HttpBindServlet.class, "/");
handler.addFilterWithMapping(org.eclipse.jetty.continuation.ContinuationFilter.class,"/*",0);
ContextHandler boshContextHandler = new ContextHandler(contexts, boshPath); ContextHandler boshContextHandler = new ContextHandler(contexts, boshPath);
boshContextHandler.setHandler(handler); boshContextHandler.setHandler(handler);
} }
......
...@@ -43,7 +43,7 @@ import org.dom4j.io.XMPPPacketReader; ...@@ -43,7 +43,7 @@ import org.dom4j.io.XMPPPacketReader;
import org.jivesoftware.openfire.auth.UnauthorizedException; import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.net.MXParser; import org.jivesoftware.openfire.net.MXParser;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.mortbay.util.ajax.ContinuationSupport; import org.eclipse.jetty.continuation.ContinuationSupport;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
...@@ -278,7 +278,7 @@ public class HttpBindServlet extends HttpServlet { ...@@ -278,7 +278,7 @@ public class HttpBindServlet extends HttpServlet {
} }
else { else {
session.resetInactivityTimeout(); session.resetInactivityTimeout();
connection.setContinuation(ContinuationSupport.getContinuation(request, connection)); connection.setContinuation(ContinuationSupport.getContinuation(request));
request.setAttribute("request-session", connection.getSession()); request.setAttribute("request-session", connection.getSession());
request.setAttribute("request", connection.getRequestId()); request.setAttribute("request", connection.getRequestId());
try { try {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
package org.jivesoftware.openfire.http; package org.jivesoftware.openfire.http;
import org.jivesoftware.util.JiveConstants; import org.jivesoftware.util.JiveConstants;
import org.mortbay.util.ajax.Continuation; import org.eclipse.jetty.continuation.Continuation;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
...@@ -43,6 +43,7 @@ public class HttpConnection { ...@@ -43,6 +43,7 @@ public class HttpConnection {
private X509Certificate[] sslCertificates; private X509Certificate[] sslCertificates;
private static final String CONNECTION_CLOSED = "connection closed"; private static final String CONNECTION_CLOSED = "connection closed";
private static final String SUSPENDED = "org.eclipse.jetty.continuation.Suspended";
/** /**
* Constructs an HTTP Connection. * Constructs an HTTP Connection.
...@@ -121,7 +122,7 @@ public class HttpConnection { ...@@ -121,7 +122,7 @@ public class HttpConnection {
} }
if (continuation != null) { if (continuation != null) {
continuation.setObject(body); continuation.setAttribute("response-body", body);
continuation.resume(); continuation.resume();
} }
else { else {
...@@ -130,8 +131,8 @@ public class HttpConnection { ...@@ -130,8 +131,8 @@ public class HttpConnection {
} }
/** /**
* A call that will cause a wait, or in the case of Jetty the thread to be freed, if there is no * A call that will suspend the request if there is no deliverable currently available.
* deliverable currently available. Once the response becomes available, it is returned. * Once the response becomes available, it is returned.
* *
* @return the deliverable to send to the client * @return the deliverable to send to the client
* @throws HttpBindTimeoutException to indicate that the maximum wait time requested by the * @throws HttpBindTimeoutException to indicate that the maximum wait time requested by the
...@@ -194,8 +195,17 @@ public class HttpConnection { ...@@ -194,8 +195,17 @@ public class HttpConnection {
} }
private String waitForResponse() throws HttpBindTimeoutException { private String waitForResponse() throws HttpBindTimeoutException {
if (continuation.suspend(session.getWait() * JiveConstants.SECOND)) { // we enter this method when we have no messages pending delivery
String deliverable = (String) continuation.getObject(); // when we resume a suspended continuation, or when we time out
if (!Boolean.TRUE.equals(continuation.getAttribute(SUSPENDED))) {
continuation.setTimeout(session.getWait() * JiveConstants.SECOND);
continuation.suspend();
continuation.setAttribute(SUSPENDED, Boolean.TRUE);
continuation.undispatch();
}
if (continuation.isResumed()) {
String deliverable = (String) continuation.getAttribute("response-body");
// This will occur when the hold attribute of a session has been exceded. // This will occur when the hold attribute of a session has been exceded.
this.isDelivered = true; this.isDelivered = true;
if (deliverable == null) { if (deliverable == null) {
...@@ -206,6 +216,7 @@ public class HttpConnection { ...@@ -206,6 +216,7 @@ public class HttpConnection {
} }
return deliverable; return deliverable;
} }
this.isDelivered = true; this.isDelivered = true;
throw new HttpBindTimeoutException("Request " + requestId + " exceeded response time from " + throw new HttpBindTimeoutException("Request " + requestId + " exceeded response time from " +
"server of " + session.getWait() + " seconds."); "server of " + session.getWait() + " seconds.");
......
...@@ -20,14 +20,15 @@ ...@@ -20,14 +20,15 @@
package org.jivesoftware.util.log.util; package org.jivesoftware.util.log.util;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.mortbay.log.Logger;
import org.eclipse.jetty.util.log.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* A Logger implementation to override the default Jetty logging behavior. All log statements * A Logger implementation to override the default Jetty logging behavior. All log statements
* are written to the Openfire logs. Info level logging is sent to debug. * are written to the Openfire logs. Info level logging is sent to debug.
*/ */
public class JettyLog implements org.mortbay.log.Logger { public class JettyLog implements org.eclipse.jetty.util.log.Logger {
private static final org.slf4j.Logger Log = LoggerFactory.getLogger(JettyLog.class); private static final org.slf4j.Logger Log = LoggerFactory.getLogger(JettyLog.class);
...@@ -41,15 +42,27 @@ public class JettyLog implements org.mortbay.log.Logger { ...@@ -41,15 +42,27 @@ public class JettyLog implements org.mortbay.log.Logger {
return debugEnabled && Log.isDebugEnabled(); return debugEnabled && Log.isDebugEnabled();
} }
public String getName() {
return "JettyLog";
}
public void setDebugEnabled(boolean b) { public void setDebugEnabled(boolean b) {
// Do nothing. // Do nothing.
} }
public void info(String string) {
Log.info("JettyLog: " + string);
}
public void info(String string, Object object, Object object1) { public void info(String string, Object object, Object object1) {
// Send info log messages to debug because they are generally not useful. // Send info log messages to debug because they are generally not useful.
Log.debug("JettyLog: "+format(string,object,object1)); Log.debug("JettyLog: "+format(string,object,object1));
} }
public void debug(String string) {
Log.debug("JettyLog: " + string);
}
public void debug(String string, Throwable throwable) { public void debug(String string, Throwable throwable) {
Log.debug("JettyLog: "+string, throwable); Log.debug("JettyLog: "+string, throwable);
} }
...@@ -58,6 +71,10 @@ public class JettyLog implements org.mortbay.log.Logger { ...@@ -58,6 +71,10 @@ public class JettyLog implements org.mortbay.log.Logger {
Log.debug("JettyLog: "+format(string,object,object1)); Log.debug("JettyLog: "+format(string,object,object1));
} }
public void warn(String string) {
Log.warn("JettyLog: " + string);
}
public void warn(String string, Object object, Object object1) { public void warn(String string, Object object, Object object1) {
Log.warn(format(string,object,object1)); Log.warn(format(string,object,object1));
} }
...@@ -82,4 +99,5 @@ public class JettyLog implements org.mortbay.log.Logger { ...@@ -82,4 +99,5 @@ public class JettyLog implements org.mortbay.log.Logger {
return msg; return msg;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment