activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1162616 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
Date Mon, 29 Aug 2011 00:31:38 GMT
Author: chirino
Date: Mon Aug 29 00:31:38 2011
New Revision: 1162616

URL: http://svn.apache.org/viewvc?rev=1162616&view=rev
Log:
Support the apollo.web system prop for easier iterative debugging of the web bits.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala?rev=1162616&r1=1162615&r2=1162616&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
Mon Aug 29 00:31:38 2011
@@ -75,25 +75,29 @@ object JettyWebServer extends Log {
     var rc:File = null
     val loader = JettyWebServer.getClass.getClassLoader
 
-    // Unpack all the webapp resources found on the classpath.
-    val resources = loader.getResources("META-INF/services/org.apache.activemq.apollo/webapp-resources.jar")
-    while( resources.hasMoreElements ) {
-      val url = resources.nextElement();
-      import FileSupport._
-      rc = tmp / "webapp-resources"
-      rc.mkdirs()
-      using(new JarInputStream(url.openStream()) ) { is =>
-        var entry = is.getNextJarEntry
-        while( entry!=null ) {
-          if( entry.isDirectory ) {
-            (rc / entry.getName).mkdirs()
-          } else {
-            using(new FileOutputStream( rc / entry.getName )) { os =>
-              copy(is, os)
+    if( System.getProperty("apollo.webapp")!=null ) {
+      rc = new File(System.getProperty("apollo.webapp"))
+    } else {
+      // Unpack all the webapp resources found on the classpath.
+      val resources = loader.getResources("META-INF/services/org.apache.activemq.apollo/webapp-resources.jar")
+      while( resources.hasMoreElements ) {
+        val url = resources.nextElement();
+        import FileSupport._
+        rc = tmp / "webapp-resources"
+        rc.mkdirs()
+        using(new JarInputStream(url.openStream()) ) { is =>
+          var entry = is.getNextJarEntry
+          while( entry!=null ) {
+            if( entry.isDirectory ) {
+              (rc / entry.getName).mkdirs()
+            } else {
+              using(new FileOutputStream( rc / entry.getName )) { os =>
+                copy(is, os)
+              }
             }
+            is.closeEntry()
+            entry = is.getNextJarEntry
           }
-          is.closeEntry()
-          entry = is.getNextJarEntry
         }
       }
     }



Mime
View raw message