activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1032136 - in /activemq/activemq-apollo/trunk: apollo-cli/ apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/ apollo-stomp/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ apollo-stomp/src/test/scala/org/apache...
Date Sat, 06 Nov 2010 20:54:39 GMT
Author: chirino
Date: Sat Nov  6 20:54:38 2010
New Revision: 1032136

URL: http://svn.apache.org/viewvc?rev=1032136&view=rev
Log:
Launch standalone brokers using the cli module.  Simplifies dependencies in the stomp and
web module.

Added:
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
      - copied, changed from r1031943, activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
Removed:
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/Main.scala
Modified:
    activemq/activemq-apollo/trunk/apollo-cli/pom.xml
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-stomp/pom.xml
    activemq/activemq-apollo/trunk/apollo-web/pom.xml
    activemq/activemq-apollo/trunk/apollo-website/src/main/webapp/images/module-deps-graph.png

Modified: activemq/activemq-apollo/trunk/apollo-cli/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/pom.xml?rev=1032136&r1=1032135&r2=1032136&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/pom.xml Sat Nov  6 20:54:38 2010
@@ -37,6 +37,38 @@
       <version>1.0-SNAPSHOT</version>
     </dependency>
 
+    <!-- Optional Modules -->
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-stomp</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-hawtdb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-cassandra</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-bdb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <optional>true</optional>
+    </dependency>
+
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
@@ -59,11 +91,11 @@
 
     <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-nop</artifactId>
+      <artifactId>slf4j-log4j12</artifactId>
       <version>${slf4j-version}</version>
-      <scope>test</scope>
+      <optional>true</optional>
     </dependency>
-    
+
   </dependencies>
 
   <build>

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala?rev=1032136&r1=1032135&r2=1032136&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
Sat Nov  6 20:54:38 2010
@@ -59,7 +59,6 @@ class Run extends Action {
 
     try {
 
-      val home = system_dir("apollo.home")
       val base = system_dir("apollo.base")
 
       if( conf == null ) {
@@ -70,9 +69,16 @@ class Run extends Action {
         error("Configuration file'%s' does not exist.\n\nTry creating a broker instance using
the 'apollo create' command.".format(conf));
       }
 
-      val lib = home / "lib"
-      val webapp = lib / lib.list.find( _.matches("""apollo-web-.+-slim.war""")).getOrElse(throw
new Failure("war file not found.") )
-
+      val webapp = {
+        val x = System.getProperty("apollo.webapp")
+        if( x != null ) {
+          new File(x)
+        } else {
+          val home = system_dir("apollo.home")
+          val lib = home / "lib"
+          lib / lib.list.find( _.matches("""apollo-web-.+-slim.war""")).getOrElse(throw new
Failure("war file not found.") )
+        }
+      }
 
       if( tmp == null ) {
         tmp = base / "tmp"
@@ -122,7 +128,9 @@ class Run extends Action {
       app_context.setWar(webapp.getCanonicalPath)
       app_context.setServer(server)
       app_context.setLogUrlOnStart(true)
+
       app_context.setTempDirectory(tmp)
+      System.setProperty("scalate.workdir", (tmp / "scalate").getCanonicalPath )
 
       server.setHandlers(Array[Handler](app_context))
       server.setConnectors(Array[Connector](connector))
@@ -132,6 +140,10 @@ class Run extends Action {
       def url = "http://localhost:" + localPort + prefix
       println("Administration interface available at: "+bold(url))
 
+      if(java.lang.Boolean.getBoolean("hawtdispatch.profile")) {
+        monitor_hawtdispatch
+      }
+
     } catch {
       case x:Helper.Failure=>
         println(ansi.a(INTENSITY_BOLD).fg(RED).a("ERROR: ").reset.a(x.getMessage))
@@ -139,8 +151,33 @@ class Run extends Action {
     null
   }
 
-//  def stop: Unit = {
-//    server.stop
-//  }
+
+  def monitor_hawtdispatch = {
+    new Thread("HawtDispatch Monitor") {
+      setDaemon(true);
+      override def run = {
+        while(true) {
+          Thread.sleep(1000);
+          import collection.JavaConversions._
+
+          // Only display is we see some long wait or run times..
+          val m = Dispatch.metrics.toList.flatMap{x=>
+            if( x.totalWaitTimeNS > 1000000 ||  x.totalRunTimeNS > 1000000 ) {
+              Some(x)
+            } else {
+              None
+            }
+          }
+
+          if( !m.isEmpty ) {
+            println("-- hawtdispatch metrics -----------------------")
+            m.foreach{ metric=>
+              println(metric)
+            }
+          }
+        }
+      }
+    }.start();
+  }
 
 }

Modified: activemq/activemq-apollo/trunk/apollo-stomp/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/pom.xml?rev=1032136&r1=1032135&r2=1032136&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/pom.xml Sat Nov  6 20:54:38 2010
@@ -45,25 +45,6 @@
       <version>1.0-SNAPSHOT</version>
     </dependency>
 
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-cassandra</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-hawtdb</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-bdb</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <optional>true</optional>
-    </dependency>
-
     <!-- Scala Support -->
     <dependency>
       <groupId>org.scala-lang</groupId>
@@ -79,11 +60,11 @@
       <optional>true</optional>
     </dependency>
 
-    <dependency>
-      <groupId>com.thoughtworks.xstream</groupId>
-      <artifactId>xstream</artifactId>
-      <version>${xstream-version}</version>
-    </dependency>
+    <!--<dependency>-->
+      <!--<groupId>com.thoughtworks.xstream</groupId>-->
+      <!--<artifactId>xstream</artifactId>-->
+      <!--<version>${xstream-version}</version>-->
+    <!--</dependency>-->
 
     <!-- Testing Dependencies -->
     <dependency>
@@ -102,6 +83,25 @@
     </dependency>
 
     <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-cassandra</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-hawtdb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-bdb</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>
@@ -114,12 +114,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <!--<scope>test</scope>-->
-      <version>${log4j-version}</version>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>${slf4j-version}</version>
+      <scope>test</scope>
     </dependency>
-    
+
   </dependencies>
   
   <profiles>

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
(from r1031943, activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompBroker.scala?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompBroker.scala&p1=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala&r1=1031943&r2=1032136&rev=1032136&view=diff
==============================================================================
    (empty)

Modified: activemq/activemq-apollo/trunk/apollo-web/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/pom.xml?rev=1032136&r1=1032135&r2=1032136&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-web/pom.xml Sat Nov  6 20:54:38 2010
@@ -50,32 +50,6 @@
       <artifactId>apollo-broker</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
-    
-    <!-- Optional Modules -->
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-stomp</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-hawtdb</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-cassandra</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-bdb</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>runtime</scope>
-    </dependency>
 
     <!-- Web Framework APIs -->
     <dependency>
@@ -110,11 +84,6 @@
       <artifactId>jackson-xc</artifactId>
       <version>${jackson-version}</version>
     </dependency>
-    <dependency>
-      <groupId>ch.qos.logback</groupId>
-      <artifactId>logback-classic</artifactId>
-      <version>${logback-version}</version>
-    </dependency>
 
     <dependency>
       <groupId>org.mortbay.jetty</groupId>

Modified: activemq/activemq-apollo/trunk/apollo-website/src/main/webapp/images/module-deps-graph.png
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/main/webapp/images/module-deps-graph.png?rev=1032136&r1=1032135&r2=1032136&view=diff
==============================================================================
Files activemq/activemq-apollo/trunk/apollo-website/src/main/webapp/images/module-deps-graph.png
(original) and activemq/activemq-apollo/trunk/apollo-website/src/main/webapp/images/module-deps-graph.png
Sat Nov  6 20:54:38 2010 differ



Mime
View raw message