activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1441011 - in /activemq/activemq-apollo/trunk: apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/ apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/ apollo-web/src/main/scala/org/apache/activemq/apoll...
Date Thu, 31 Jan 2013 15:12:40 GMT
Author: chirino
Date: Thu Jan 31 15:12:40 2013
New Revision: 1441011

URL: http://svn.apache.org/viewvc?rev=1441011&view=rev
Log:
Fixes problems with the new console not loading up by default when the unstable modules are
included in the build.  Also the swagger docs would break when they were included.

Modified:
    activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JmxWebModule.scala
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala

Modified: activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JmxWebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JmxWebModule.scala?rev=1441011&r1=1441010&r2=1441011&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JmxWebModule.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-jmx/src/main/scala/org/apache/activemq/apollo/broker/jmx/JmxWebModule.scala
Thu Jan 31 15:12:40 2013
@@ -23,12 +23,7 @@ import org.apache.activemq.apollo.web.We
  */
 
 object JmxWebModule  extends WebModule {
-
-  def root_redirect: String = "broker"
-  def priority: Int = 50
-
   override def web_resources = Set(
     classOf[JmxResource]
   )
-
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala?rev=1441011&r1=1441010&r2=1441011&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
Thu Jan 31 15:12:40 2013
@@ -35,22 +35,16 @@ import com.wordnik.swagger.annotations.{
 
 
 object NetworkWebModule extends WebModule {
-
-  def priority: Int = 101
-
   override def web_resources = Set(
     classOf[NetworkResourceJSON],
     classOf[NetworkResourceHelp]
   )
-
-  def root_redirect: String = "broker"
-
 }
 
 @Path(          "/api/docs/network{ext:(\\.json)?}")
 @Api(value =    "/api/json/network",
   listingPath = "/api/docs/network",
-  listingClass = "org.apache.activemq.apollo.web.resources.NetworkResourceJSON")
+  listingClass = "org.apache.activemq.apollo.broker.network.web.NetworkResourceJSON")
 class NetworkResourceHelp extends HelpResourceJSON
 
 /**

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala?rev=1441011&r1=1441010&r2=1441011&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
Thu Jan 31 15:12:40 2013
@@ -24,9 +24,9 @@ import org.fusesource.scalate.jersey._
 import com.wordnik.swagger.jaxrs.ApiHelpMessageBodyWriter
 
 trait WebModule {
-  def priority:Int
+  def priority = 50
   def web_resources: Set[Class[_]]
-  def root_redirect:String
+  def root_redirect:String = null
 }
 
 /**
@@ -41,19 +41,20 @@ object WebModule {
 
   val (root_redirect, web_resources) = {
     // sort by priority.  Highest priority wins.
-    val sorted = finder.singletons.sortBy( _.priority )
+    var sorted = finder.singletons.sortBy( _.priority )
     val web_resources = LinkedHashMap[Class[_], Class[_]]()
     for( provider <- sorted; resource <- provider.web_resources ) {
       web_resources.put(resource,resource)
     }
-    (sorted.last.root_redirect, web_resources.keySet)
+    val last_root_redirect = (sorted.flatMap{x=> Option(x.root_redirect)}).last
+    (last_root_redirect, web_resources.keySet)
   }
 
 }
 
 object DefaultWebModule extends WebModule {
 
-  def priority: Int = 100
+  override def priority: Int = 100
 
   override def web_resources = Set(
     classOf[RootResource],
@@ -80,6 +81,6 @@ object DefaultWebModule extends WebModul
 
   )
 
-  def root_redirect: String = "console/index.html"
+  override def root_redirect: String = "console/index.html"
 
 }
\ No newline at end of file



Mime
View raw message