Blame SOURCES/0001-Port-to-jetty-9.patch

f63166
From 4c2e25dd41672533a6f6f3da490d2cbfa385884a Mon Sep 17 00:00:00 2001
f63166
From: Michal Srb <msrb@redhat.com>
f63166
Date: Fri, 22 Feb 2013 10:56:19 +0100
f63166
Subject: [PATCH] Port to jetty 9
f63166
f63166
---
f63166
 .../org/apache/maven/plugins/site/SiteRunMojo.java | 28 +++++++++++-----------
f63166
 1 file changed, 14 insertions(+), 14 deletions(-)
f63166
f63166
diff --git a/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java b/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
f63166
index f341eef..d7e6c09 100644
f63166
--- a/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
f63166
+++ b/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
f63166
@@ -42,12 +42,13 @@ import org.apache.maven.reporting.exec.MavenReportExecution;
f63166
 
f63166
 import org.codehaus.plexus.util.IOUtil;
f63166
 
f63166
-import org.mortbay.jetty.Connector;
f63166
-import org.mortbay.jetty.Handler;
f63166
-import org.mortbay.jetty.Server;
f63166
-import org.mortbay.jetty.handler.DefaultHandler;
f63166
-import org.mortbay.jetty.nio.SelectChannelConnector;
f63166
-import org.mortbay.jetty.webapp.WebAppContext;
f63166
+import org.eclipse.jetty.server.Connector;
f63166
+import org.eclipse.jetty.server.Handler;
f63166
+import org.eclipse.jetty.server.Server;
f63166
+import org.eclipse.jetty.server.handler.DefaultHandler;
f63166
+import org.eclipse.jetty.server.handler.HandlerList;
f63166
+import org.eclipse.jetty.server.ServerConnector;
f63166
+import org.eclipse.jetty.webapp.WebAppContext;
f63166
 
f63166
 /**
f63166
  * Starts the site up, rendering documents as requested for faster editing.
f63166
@@ -84,7 +85,7 @@ public class SiteRunMojo
f63166
         Server server = new Server();
f63166
         server.setStopAtShutdown( true );
f63166
 
f63166
-        Connector defaultConnector = getDefaultConnector();
f63166
+        ServerConnector defaultConnector = getDefaultConnector( server );
f63166
         server.setConnectors( new Connector[] { defaultConnector } );
f63166
 
f63166
         WebAppContext webapp = createWebApplication();
f63166
@@ -93,10 +94,9 @@ public class SiteRunMojo
f63166
         DefaultHandler defaultHandler = new DefaultHandler();
f63166
         defaultHandler.setServer( server );
f63166
 
f63166
-        Handler[] handlers = new Handler[2];
f63166
-        handlers[0] = webapp;
f63166
-        handlers[1] = defaultHandler;
f63166
-        server.setHandlers( handlers );
f63166
+        HandlerList handlers = new HandlerList();
f63166
+        handlers.setHandlers(new Handler[] { webapp, defaultHandler } );
f63166
+        server.setHandler( handlers );
f63166
 
f63166
         getLog().info( "Starting Jetty on http://localhost:" + port + "/" );
f63166
         try
f63166
@@ -219,11 +219,11 @@ public class SiteRunMojo
f63166
         return webapp;
f63166
     }
f63166
 
f63166
-    private Connector getDefaultConnector()
f63166
+    private ServerConnector getDefaultConnector( Server server )
f63166
     {
f63166
-        Connector connector = new SelectChannelConnector();
f63166
+        ServerConnector connector = new ServerConnector( server );
f63166
         connector.setPort( port );
f63166
-        connector.setMaxIdleTime( MAX_IDLE_TIME );
f63166
+        connector.setIdleTimeout( MAX_IDLE_TIME );
f63166
         return connector;
f63166
     }
f63166
 
f63166
-- 
f63166
1.8.1.2
f63166