activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1027500 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-cli/ apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/ apollo-cli/src/main/scala/org/apache/acti...
Date Tue, 26 Oct 2010 12:24:33 GMT
Author: chirino
Date: Tue Oct 26 12:24:32 2010
New Revision: 1027500

URL: http://svn.apache.org/viewvc?rev=1027500&view=rev
Log:
trying to get a cli run command working.  web console part still needs work.

Added:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala
      - copied, changed from r1026670, activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ConfigStore.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/log4j.properties
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/log/
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/log/apollo.log
Removed:
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ConfigStore.scala
Modified:
    activemq/activemq-apollo/trunk/apollo-cli/pom.xml
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
    activemq/activemq-apollo/trunk/apollo-distro/pom.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/descriptors/common-bin.xml
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
    activemq/activemq-apollo/trunk/apollo-web/pom.xml
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ServletContextListener.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ConfigurationResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.scaml
    activemq/activemq-apollo/trunk/apollo-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala

Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala
(from r1026670, activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ConfigStore.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala&p1=activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ConfigStore.scala&r1=1026670&r2=1027500&rev=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ConfigStore.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala
Tue Oct 26 12:24:32 2010
@@ -14,9 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.web
+package org.apache.activemq.apollo.broker
 
-import org.apache.activemq.apollo.broker._
 import org.apache.activemq.apollo.broker.jaxb.PropertiesReader
 import org.apache.activemq.apollo.dto.{XmlCodec, ConnectorDTO, VirtualHostDTO, BrokerDTO}
 import java.util.regex.Pattern

Modified: activemq/activemq-apollo/trunk/apollo-cli/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/pom.xml?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/pom.xml Tue Oct 26 12:24:32 2010
@@ -33,9 +33,8 @@
 
     <dependency>
       <groupId>org.apache.activemq</groupId>
-      <artifactId>apollo-web</artifactId>
+      <artifactId>apollo-broker</artifactId>
       <version>6.0-SNAPSHOT</version>
-      <type>war</type>
     </dependency>
 
     <dependency>

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
Tue Oct 26 12:24:32 2010
@@ -16,7 +16,7 @@
 ## ---------------------------------------------------------------------------
 org.apache.activemq.apollo.cli.commands.Exit
 org.apache.activemq.apollo.cli.commands.Help
-#org.apache.activemq.apollo.cli.commands.Create
+org.apache.activemq.apollo.cli.commands.Create
 #org.apache.activemq.apollo.cli.commands.Start
 #org.apache.activemq.apollo.cli.commands.Stop
-#org.apache.activemq.apollo.cli.commands.Run
+org.apache.activemq.apollo.cli.commands.Run

Added: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala?rev=1027500&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
(added)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
Tue Oct 26 12:24:32 2010
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.apollo.cli.commands
+
+import org.apache.felix.gogo.commands.{Action, Option => option, Argument => argument,
Command => command}
+import org.osgi.service.command.CommandSession
+import java.io.File
+import org.fusesource.jansi.Ansi
+import org.fusesource.jansi.Ansi.Color._
+import org.fusesource.jansi.Ansi.Attribute._
+
+/**
+ * The apollo create command
+ */
+@command(scope="apollo", name = "create", description = "creates a new broker instance")
+class Create extends Action {
+
+  @argument(name = "directory", description = "The instance directory to hold the broker's
configuration and data", index=0, required=true)
+  var directory:File = _
+
+  def execute(session: CommandSession) = {
+
+    def println(value:Any) = session.getConsole.println(value)
+    def ansi= new Ansi()
+    def error(value:Any) = println(ansi.a(INTENSITY_BOLD).fg(RED).a("ERROR").reset.a(value.toString))
+
+
+    if( directory.exists ) {
+      error("The directory '%s' already exists.".format(directory))
+    }
+
+    
+    null
+  }
+}
\ No newline at end of file

Added: 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=1027500&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
(added)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
Tue Oct 26 12:24:32 2010
@@ -0,0 +1,166 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.apollo.cli.commands
+
+import org.apache.felix.gogo.commands.{Action, Option => option, Argument => argument,
Command => command}
+import org.osgi.service.command.CommandSession
+import java.io.File
+import org.fusesource.jansi.Ansi
+import org.fusesource.jansi.Ansi.Color._
+import org.fusesource.jansi.Ansi.Attribute._
+
+import org.mortbay.jetty.Connector
+import org.mortbay.jetty.Handler
+import org.mortbay.jetty.Server
+import org.mortbay.jetty.nio.SelectChannelConnector
+import org.mortbay.jetty.webapp.WebAppContext
+import org.apache.commons.logging.LogFactory
+import org.apache.activemq.apollo.broker.{BrokerRegistry, Broker, ConfigStore, FileConfigStore}
+import org.apache.activemq.apollo.util.ServiceControl
+import org.fusesource.hawtdispatch.ScalaDispatch._
+
+
+/**
+ * The apollo create command
+ */
+@command(scope="apollo", name = "run", description = "runs the broker instance")
+class Run extends Action {
+
+  @option(name = "port", description = "The port of the http based administration service")
+  var port: Int = 8080
+
+  @option(name = "prefix", description = "The prefix path of the web application.")
+  var prefix: String = "/"
+
+  @option(name = "conf", description = "The Apollo configuration file.")
+  var conf: File = _
+
+  @option(name = "tmp", description = "A temp directory.")
+  var tmp: File = _
+
+
+  private def ansi= new Ansi()
+  private class Failure(msg:String) extends RuntimeException(msg)
+  private def error(value:Any) = throw new Failure(value.toString)
+  private def system_dir(name:String) = {
+    val base_value = System.getProperty(name)
+    if( base_value==null ) {
+      error("The the %s system property is not set.".format(name))
+    }
+    val file = new File(System.getProperty("apollo.base"))
+    if( !file.isDirectory  ) {
+      error("The the %s system property is not set to valid directory path %s".format(name,
base_value))
+    }
+    file
+  }
+
+
+  class RichFile(file:File) {
+    def / (path:String) = new File(file, path)
+  }
+  implicit def toRichFile(file:File):RichFile = new RichFile(file)
+
+  def bold(v:String) = ansi.a(INTENSITY_BOLD).a(v).reset
+
+  def execute(session: CommandSession):AnyRef = {
+
+    def println(value:Any) = session.getConsole.println(value)
+
+    try {
+      val home = system_dir("apollo.home")
+      val base = system_dir("apollo.base")
+
+      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 = home / "webapp"
+//
+      if( conf == null ) {
+        val etc = base / "etc"
+        etc.mkdirs
+        conf = etc / "apollo.xml"
+      }
+
+      if( tmp == null ) {
+        tmp = base / "tmp"
+        tmp.mkdirs
+      }
+
+
+      println("========================================================================")
+      println("Apollo Broker Service Starting");
+      println("========================================================================")
+      println("")
+
+      // Load the configs and start the brokers up.
+      println("Loading configurations from '%s'.".format(conf));
+      val store = new FileConfigStore
+      store.file = conf
+      ConfigStore() = store
+      store.start(^{
+
+        // Brokers startup async.
+        store.foreachBroker(true) { config=>
+          // Only start the broker up if it's enabled..
+          if( config.enabled ) {
+            println("Starting broker '%s'...".format(config.id));
+            val broker = new Broker()
+            broker.config = config
+            BrokerRegistry.add(config.id, broker)
+            broker.start(^{
+              println("Broker '%s' started.".format(config.id));
+            })
+          }
+        }
+
+      })
+
+
+      // Start up the admin interface...
+      println("Starting administration interface..."+webapp);
+      var server = new Server
+
+      var connector = new SelectChannelConnector
+      connector.setPort(port)
+      connector.setServer(server)
+
+      var app_context = new WebAppContext
+      app_context.setContextPath(prefix)
+      app_context.setWar(webapp.getCanonicalPath)
+      app_context.setServer(server)
+      app_context.setLogUrlOnStart(true)
+      app_context.setTempDirectory(tmp)
+
+      server.setHandlers(Array[Handler](app_context))
+      server.setConnectors(Array[Connector](connector))
+      server.start
+
+      val localPort = connector.getLocalPort
+      def url = "http://localhost:" + localPort + prefix
+      println("Administration interface available at: "+bold(url))
+
+    } catch {
+      case x:Failure=>
+        println(ansi.a(INTENSITY_BOLD).fg(RED).a("ERROR: ").reset.a(x.getMessage))
+    }
+    null
+  }
+
+//  def stop: Unit = {
+//    server.stop
+//  }
+
+}
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-distro/pom.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/pom.xml?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/pom.xml Tue Oct 26 12:24:32 2010
@@ -35,6 +35,58 @@
       <artifactId>apollo-cli</artifactId>
       <version>6.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-hawtdb</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-bdb</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-cassandra</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-tcp</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-stomp</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-web</artifactId>
+      <version>6.0-SNAPSHOT</version>
+      <type>war</type>
+      <classifier>slim</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>apollo-web</artifactId>
+      <version>6.0-SNAPSHOT</version>
+      <type>pom</type>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty</artifactId>
+      <version>${jetty-version}</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty-util</artifactId>
+      <version>${jetty-version}</version>
+      <optional>true</optional>
+    </dependency>
+
 
     <dependency>
       <groupId>org.slf4j</groupId>
@@ -43,10 +95,16 @@
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-nop</artifactId>
+      <artifactId>slf4j-log4j12</artifactId>
       <version>${slf4j-version}</version>
     </dependency>
     <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>${log4j-version}</version>
+    </dependency>
+    
+    <dependency>
       <groupId>org.apache.karaf.shell</groupId>
       <artifactId>org.apache.karaf.shell.console</artifactId>
       <version>${karaf-version}</version>

Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/descriptors/common-bin.xml?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/descriptors/common-bin.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/descriptors/common-bin.xml Tue Oct
26 12:24:32 2010
@@ -21,35 +21,38 @@
     <dependencySet>
       <outputDirectory>/lib</outputDirectory>
       <unpack>false</unpack>
-      <scope>compile</scope>
       <useTransitiveDependencies>true</useTransitiveDependencies>
       <includes>
-        <include>org.apache.activemq:apollo-cli</include>
-      </includes>
-    </dependencySet>
-    <dependencySet>
-      <outputDirectory>/lib</outputDirectory>
-      <unpack>false</unpack>
-      <scope>runtime</scope>
-      <includes>
+        <include>org.apache.activemq:apollo-*</include>
+        
+        <!-- main apollo dependencies -->
         <include>org.scala-lang:scala-library</include>
+        <include>org.fusesource.hawtbuf:*</include>
+        <include>org.fusesource.hawtdispatch:*</include>
+        <include>org.fusesource.hawtdb:*</include>
+        <include>org.codehaus.jackson:jackson-mapper-asl</include>
+        <include>org.codehaus.jackson:jackson-core-asl</include>
+
+        <!-- for the webapp -->
+        <include>org.mortbay.jetty:*</include>
+        <include>com.sun.jersey:jersey-server</include>
+        <include>com.sun.jersey:jersey-core</include>
+        <include>asm:asm</include>
+        <include>org.codehaus.jackson:jackson-jaxrs</include>
+        <include>org.fusesource.scalate:scalate-core</include>
         <include>org.scala-lang:scala-compiler</include>
+        
+        <!-- the logging apis used -->
         <include>org.slf4j:slf4j-api</include>
-        <include>org.slf4j:slf4j-nop</include>
+        <include>commons-logging:commons-logging</include>
+        <include>org.slf4j:slf4j-log4j12</include>
+        <include>log4j:log4j</include>
+        
+        <!-- Implements the cli shell -->
         <include>org.apache.karaf.shell:org.apache.karaf.shell.console</include>
+        
       </includes>
     </dependencySet>
-    <!-- 
-    <dependencySet>
-      <outputDirectory>/lib/optional</outputDirectory>
-      <unpack>false</unpack>
-      <scope>compile</scope>
-      <useTransitiveDependencies>true</useTransitiveDependencies>
-      <includes>
-        <include>org.apache.activemq.apollo:apollo-cli</include>
-      </includes>
-    </dependencySet>
-    -->
   </dependencySets>
 
   <fileSets>

Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo Tue Oct 26 12:24:32
2010
@@ -156,8 +156,5 @@ if [ -z "$JMX_OPTS" ] ; then
 fi
 JVM_FLAGS="${JVM_FLAGS} ${JMX_OPTS}"
 
-JVM_FLAGS="${JVM_FLAGS} -Dapollo.home=\"${APOLLO_HOME}\" -Dapollo.base=\"${APOLLO_BASE}\""
-JVM_FLAGS="${JVM_FLAGS} -classpath ${CLASSPATH}"
-
-exec "$JAVACMD" ${JVM_FLAGS} org.apache.activemq.apollo.cli.Apollo $@
+exec "$JAVACMD" ${JVM_FLAGS} -Dapollo.home="${APOLLO_HOME}" -Dapollo.base="${APOLLO_BASE}"
-classpath "${CLASSPATH}" org.apache.activemq.apollo.cli.Apollo $@
 

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/log4j.properties?rev=1027500&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/log4j.properties (added)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/etc/log4j.properties Tue
Oct 26 12:24:32 2010
@@ -0,0 +1,46 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+## 
+## http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Setup the default logging levels
+#
+log4j.rootLogger=WARN, console, logfile
+log4j.logger.org.apache.activemq.apollo=INFO
+
+#
+# Uncomment one of the following to enable debug logging
+#
+# log4j.logger.org.apache.activemq.apollo=DEBUG
+# log4j.logger.org.apache.activemq.apollo.broker=DEBUG
+# log4j.logger.org.apache.activemq.apollo.web=DEBUG
+# log4j.logger.org.apache.activemq.apollo.cli=DEBUG
+# log4j.logger.org.apache.activemq.apollo.store.hawtdb=DEBUG
+
+# Console Settings
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%-5p | %t | %m%n
+log4j.appender.console.threshold=INFO
+
+# File Settings
+log4j.appender.logfile=org.apache.log4j.RollingFileAppender
+log4j.appender.logfile.file=${apollo.base}/log/apollo.log
+log4j.appender.logfile.maxFileSize=5MB
+log4j.appender.logfile.maxBackupIndex=5
+log4j.appender.logfile.append=true
+log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/log/apollo.log
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/log/apollo.log?rev=1027500&view=auto
==============================================================================
    (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=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/pom.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-web/pom.xml Tue Oct 26 12:24:32 2010
@@ -203,7 +203,6 @@
         </configuration>
       </plugin>
 
-
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>jetty-maven-plugin</artifactId>
@@ -226,6 +225,49 @@
         </configuration>
       </plugin>
 
+      <plugin>
+        <groupId>org.fusesource.scalate</groupId>
+        <artifactId>maven-scalate-plugin</artifactId>
+        <version>${scalate-version}</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>precompile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.fusesource.mvnplugins</groupId>
+        <artifactId>maven-uberize-plugin</artifactId>
+        <version>1.11</version>
+        <executions>
+          <execution>
+            <id>slim</id>
+            <phase>package</phase>
+            <goals><goal>uberize</goal></goals>
+            <configuration>
+              <uberArtifactAttached>true</uberArtifactAttached>
+              <uberClassifierName>slim</uberClassifierName>
+              <artifactSet>
+                <includes>
+                  <include>org.apache.activemq:apollo-web</include>
+                </includes>
+              </artifactSet>            
+              <filters>
+                <filter>
+                  <artifact>org.apache.activemq:apollo-web</artifact>
+                  <excludes>
+                    <exclude>WEB-INF/lib/**</exclude>
+                  </excludes>
+                </filter>
+              </filters>            
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
     </plugins>
   </build>
   
@@ -251,18 +293,6 @@
       <id>release</id>
       <build>
         <plugins>
-          <plugin>
-            <groupId>org.fusesource.scalate</groupId>
-            <artifactId>maven-scalate-plugin</artifactId>
-            <version>${scalate-version}</version>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>precompile</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
         </plugins>
       </build>
     </profile>

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ServletContextListener.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ServletContextListener.scala?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ServletContextListener.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ServletContextListener.scala
Tue Oct 26 12:24:32 2010
@@ -17,10 +17,9 @@
 package org.apache.activemq.apollo.web
 
 import java.io.File
-import org.apache.activemq.apollo.broker.{BrokerRegistry, Broker}
 import org.apache.activemq.apollo.util._
 import javax.servlet.{ServletContextListener, ServletContextEvent}
-
+import org.apache.activemq.apollo.broker.{FileConfigStore, ConfigStore, BrokerRegistry, Broker}
 
 /**
  * A servlet context listener which handles starting the
@@ -34,29 +33,27 @@ class ApolloListener extends ServletCont
 
   def contextInitialized(sce: ServletContextEvent) = {
     try {
-      configStore = createConfigStore
-      ConfigStore() = configStore
-
-      // Brokers startup async.
-      configStore.foreachBroker(true) { config=>
-
-        println("Config store contained broker: "+config.id);
-
-        // Only start the broker up if it's enabled..
-        if( config.enabled ) {
-
-          println("starting broker: "+config.id);
-          val broker = new Broker()
-          broker.config = config
-          BrokerRegistry.add(config.id, broker)
-          broker.start()
+      if( ConfigStore() == null ) {
+        configStore = createConfigStore
+        ConfigStore() = configStore
+
+        // Brokers startup async.
+        configStore.foreachBroker(true) { config=>
+          println("Config store contained broker: "+config.id);
+
+          // Only start the broker up if it's enabled..
+          if( config.enabled ) {
+
+            println("starting broker: "+config.id);
+            val broker = new Broker()
+            broker.config = config
+            BrokerRegistry.add(config.id, broker)
+            broker.start()
 
+          }
         }
-
       }
-
-    }
-    catch {
+    } catch {
       case e:Exception =>
         e.printStackTrace
     }
@@ -64,16 +61,18 @@ class ApolloListener extends ServletCont
 
   def contextDestroyed(sce: ServletContextEvent) = {
     val tracker = new LoggingTracker("webapp shutdown")
-    configStore.foreachBroker(false) { config=>
-      // remove started brokers what we configured..
-      val broker = BrokerRegistry.remove(config.id);
-      if( broker!=null ) {
-        tracker.stop(broker)
+    if( configStore!=null ) {
+      configStore.foreachBroker(false) { config=>
+        // remove started brokers what we configured..
+        val broker = BrokerRegistry.remove(config.id);
+        if( broker!=null ) {
+          tracker.stop(broker)
+        }
       }
+      tracker.stop(configStore)
+      tracker.await
+      configStore = null
     }
-    tracker.stop(configStore)
-    tracker.await
-    configStore = null
   }
 
   def createConfigStore():ConfigStore = {

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ConfigurationResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ConfigurationResource.scala?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ConfigurationResource.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ConfigurationResource.scala
Tue Oct 26 12:24:32 2010
@@ -21,10 +21,10 @@ import core.{UriInfo, Response, Context}
 import org.fusesource.hawtdispatch.Future
 import Response.Status._
 import Response._
-import org.apache.activemq.apollo.web.ConfigStore
 import java.net.URI
 import java.io.ByteArrayInputStream
 import org.apache.activemq.apollo.dto.{XmlCodec, BrokerDTO}
+import org.apache.activemq.apollo.broker.ConfigStore
 
 /**
  * A broker resource is used to represent the configuration of a broker.

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
Tue Oct 26 12:24:32 2010
@@ -25,7 +25,7 @@ import com.sun.jersey.api.view.ImplicitP
 import org.fusesource.hawtdispatch.Future
 import Response._
 import Response.Status._
-import org.apache.activemq.apollo.web.ConfigStore
+import org.apache.activemq.apollo.broker.ConfigStore
 import org.apache.activemq.apollo.broker.BrokerRegistry
 import collection.JavaConversions._
 import com.sun.jersey.api.core.ResourceContext

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.scaml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.scaml?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.scaml
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.scaml
Tue Oct 26 12:24:32 2010
@@ -13,5 +13,7 @@
 -# See the License for the specific language governing permissions and
 -# limitations under the License.
 
--@ import it._
-
+-# - import it._
+-# - val helper = new org.apache.activemq.apollo.web.resources.ViewHelper
+-# - import helper._
+.clear
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala?rev=1027500&r1=1027499&r2=1027500&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/test/scala/org/apache/activemq/apollo/web/FileConfigStoreTest.scala
Tue Oct 26 12:24:32 2010
@@ -20,6 +20,7 @@ import java.io.File
 import java.util.concurrent.{TimeUnit, CountDownLatch}
 import org.fusesource.hawtdispatch.Future
 import org.apache.activemq.apollo.util._
+import org.apache.activemq.apollo.broker.FileConfigStore
 
 /**
  * <p>



Mime
View raw message