You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/12/22 22:35:00 UTC

svn commit: r1052076 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/test/resources/org/apache/active...

Author: chirino
Date: Wed Dec 22 21:34:58 2010
New Revision: 1052076

URL: http://svn.apache.org/viewvc?rev=1052076&view=rev
Log:
Simplifying the broker model.

Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/simple.xml
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/org/apache/activemq/apollo/broker/destination-config.xml
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/ConfigStoreTest.scala
    activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/broker/store/cassandra/dto/simple.xml
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/test/resources/example-broker/etc/apollo.xml
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerSummaryDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
    activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/test/resources/org/apache/activemq/apollo/broker/store/hawtdb/dto/simple.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-secure.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl-secure.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl.xml
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp.xml
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.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/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.jade
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/simple.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/simple.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/simple.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/test/resources/org/apache/activemq/apollo/broker/store/bdb/dto/simple.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker basedir="./activemq-data/default" id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
     <virtual_host enabled="true" id="vh-local">
         <host_name>localhost</host_name>
         <bdb_store directory="activemq-data"/>

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Wed Dec 22 21:34:58 2010
@@ -89,18 +89,16 @@ object BufferConversions {
  */
 object BrokerRegistry {
 
-  val brokers = new ConcurrentHashMap[String, Broker]()
+  val brokers = new ConcurrentHashMap[Broker, Broker]()
 
-  def list():Seq[String] = {
+  def list():Array[Broker] = {
     import JavaConversions._
-    brokers.keys.toSeq
+    brokers.keySet.toSeq.toArray
   }
 
-  def get(id:String) = brokers.get(id)
+  def add(broker:Broker) = brokers.put(broker, broker)
 
-  def add(id:String, broker:Broker) = brokers.put(id, broker)
-
-  def remove(id:String) = brokers.remove(id)
+  def remove(broker:Broker) = brokers.remove(broker)
 
 }
 
@@ -118,7 +116,6 @@ object Broker extends Log {
    */
   def defaultConfig() = {
     val rc = new BrokerDTO
-    rc.id = "default"
     rc.notes = "A default configuration"
     rc.virtual_hosts.add(VirtualHost.default_config)
     rc.connectors.add(Connector.defaultConfig)
@@ -130,9 +127,6 @@ object Broker extends Log {
    */
   def validate(config: BrokerDTO, reporter:Reporter):ReporterLevel = {
     new Reporting(reporter) {
-      if( empty(config.id) ) {
-        error("Broker id must be specified.")
-      }
       if( config.virtual_hosts.isEmpty ) {
         error("Broker must define at least one virtual host.")
       }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/org/apache/activemq/apollo/broker/destination-config.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/org/apache/activemq/apollo/broker/destination-config.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/org/apache/activemq/apollo/broker/destination-config.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/resources/org/apache/activemq/apollo/broker/destination-config.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker xmlns="http://activemq.apache.org/schema/activemq/apollo" id="default">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <virtual_host id="default">
     <host_name>test</host_name>

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/ConfigStoreTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/ConfigStoreTest.scala?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/ConfigStoreTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/ConfigStoreTest.scala Wed Dec 22 21:34:58 2010
@@ -34,8 +34,8 @@ class ConfigStoreTest extends FunSuiteSu
 
     store.start
 
-    expect("default") {
-      store.load(false).id
+    expect(1) {
+      store.load(false).virtual_hosts.size
     }
 
     store.stop

Modified: activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/broker/store/cassandra/dto/simple.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/broker/store/cassandra/dto/simple.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/broker/store/cassandra/dto/simple.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/test/resources/org/apache/activemq/apollo/broker/store/cassandra/dto/simple.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker basedir="./activemq-data/default" id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
     <virtual_host enabled="true" id="vh-local">
         <host_name>localhost</host_name>
         <cassandra_store keyspace="vh-local"/>

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml Wed Dec 22 21:34:58 2010
@@ -20,7 +20,7 @@
 
   http://activemq.apache.org/apollo/versions/${version}/website/documentation/user-manual.html
   -->
-<broker id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <notes>
     The default configuration with tls/ssl enabled.
@@ -34,7 +34,7 @@
 
   <web_admin host="127.0.0.1" port="8080"/>
 
-  <virtual_host id="default" auto_create_queues="true" >
+  <virtual_host id="${host}" auto_create_queues="true" >
     <!--
       You should add all the host names that this virtual host is known as
       to properly support the STOMP 1.1 virtual host feature.
@@ -49,7 +49,7 @@
 
     <acl>
       <connect allow="admins"/>
-    </acl>
+    DTO</acl>
 
     <!-- You can delete this element if you want to disable persistent for this virtual host -->
     <hawtdb_store directory="${apollo.base}/data"/>

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo.xml Wed Dec 22 21:34:58 2010
@@ -20,7 +20,7 @@
 
   http://activemq.apache.org/apollo/versions/${version}/website/documentation/user-manual.html
   -->
-<broker id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <notes>
     The default configuration.

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=1052076&r1=1052075&r2=1052076&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 Wed Dec 22 21:34:58 2010
@@ -99,17 +99,13 @@ class Run extends Action with Logging {
       store.start
       val config = store.load(true)
 
-      // Only start the broker up if it's enabled..
-      if( config.enabled.getOrElse(true) ) {
-        debug("Starting broker '%s'", config.id);
-        val broker = new Broker()
-        broker.config = config
-        BrokerRegistry.add(config.id, broker)
-        broker.start(^{
-          info("Broker '%s' started", config.id);
-        })
-      }
-
+      debug("Starting broker");
+      val broker = new Broker()
+      broker.config = config
+      BrokerRegistry.add(broker)
+      broker.start(^{
+        info("Broker started");
+      })
 
       val web_admin = config.web_admin.getOrElse(new WebAdminDTO)
       if( web_admin.enabled.getOrElse(true) ) {

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/test/resources/example-broker/etc/apollo.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/test/resources/example-broker/etc/apollo.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/test/resources/example-broker/etc/apollo.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/test/resources/example-broker/etc/apollo.xml Wed Dec 22 21:34:58 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<!--
+  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.
+-->
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
     <notes>
       A default configuration
     </notes>

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java Wed Dec 22 21:34:58 2010
@@ -27,7 +27,7 @@ import java.util.List;
  */
 @XmlRootElement(name="broker")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class BrokerDTO extends ServiceDTO<String> {
+public class BrokerDTO {
 
     /**
      * Used to store any configuration notes.

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerSummaryDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerSummaryDTO.java?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerSummaryDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerSummaryDTO.java Wed Dec 22 21:34:58 2010
@@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlRoot
  */
 @XmlRootElement(name="broker_summary")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class BrokerSummaryDTO extends StringIdDTO {
+public class BrokerSummaryDTO {
 
     /**
      * Is a running broker accessible via management API calls?

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/test/java/org/apache/activemq/apollo/dto/XmlCodecTest.java Wed Dec 22 21:34:58 2010
@@ -37,7 +37,6 @@ public class XmlCodecTest {
     public void unmarshalling() throws Exception {
         BrokerDTO dto = XmlCodec.unmarshalBrokerDTO(resource("XmlCodecTest.xml"));
         assertNotNull(dto);
-        assertEquals("default", dto.id);
         assertEquals(1, dto.connectors.size());
         ConnectorDTO connector = dto.connectors.get(0);
         assertEquals(1, connector.protocols.size());
@@ -62,7 +61,6 @@ public class XmlCodecTest {
     @Test
     public void marshalling() throws Exception {
         BrokerDTO broker = new BrokerDTO();
-        broker.id = "default";
 
         VirtualHostDTO host = new VirtualHostDTO();
         host.id = "vh-local";

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker basedir="./activemq-data/default" rev="0" enabled="true" id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <acl>
     <admin allow="hiram"/>
@@ -23,7 +23,7 @@
     <admin allow="admins" kind="org.apache.activemq.jaas.GroupPrincipal"/>
   </acl>
 
-  <virtual_host enabled="true" id="vh-local">
+  <virtual_host id="vh-local">
     <acl/>
     <host_name>localhost</host_name>
     <host_name>example.com</host_name>

Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/test/resources/org/apache/activemq/apollo/broker/store/hawtdb/dto/simple.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/test/resources/org/apache/activemq/apollo/broker/store/hawtdb/dto/simple.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/test/resources/org/apache/activemq/apollo/broker/store/hawtdb/dto/simple.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/test/resources/org/apache/activemq/apollo/broker/store/hawtdb/dto/simple.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker basedir="./activemq-data/default" id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
     <virtual_host id="vh-local">
         <host_name>localhost</host_name>
         <hawtdb_store directory="activemq-data"/>

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-secure.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-secure.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-secure.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-secure.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <authentication domain="StompSecurityTest"/>
 

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl-secure.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl-secure.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl-secure.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl-secure.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
 
   <authentication domain="StompSslSecurityTest"/>

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp-ssl.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
     <notes>The config for the ssl stomp tests.</notes>
     <virtual_host id="default" purge_on_startup="true" auto_create_queues="true">

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp.xml?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/resources/apollo-stomp.xml Wed Dec 22 21:34:58 2010
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
     <notes>This broker configuration is what the unit tests in this module load up.</notes>
 
     <virtual_host id="default" purge_on_startup="true" auto_create_queues="true">

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ApolloListener.scala Wed Dec 22 21:34:58 2010
@@ -20,8 +20,8 @@ import java.io.File
 import org.apache.activemq.apollo.util._
 import javax.servlet.{ServletContextListener, ServletContextEvent}
 import org.apache.activemq.apollo.broker.{FileConfigStore, ConfigStore, BrokerRegistry, Broker}
-import org.fusesource.hawtdispatch._
-import org.apache.activemq.apollo.util.OptionSupport._
+
+object ApolloListener extends Log
 
 /**
  * A servlet context listener which handles starting the
@@ -30,8 +30,10 @@ import org.apache.activemq.apollo.util.O
  * @version $Revision : 1.1 $
  */
 class ApolloListener extends ServletContextListener {
+  import ApolloListener._
 
   var configStore:ConfigStore = null
+  var broker:Broker = _
 
   def contextInitialized(sce: ServletContextEvent) = {
     try {
@@ -40,27 +42,23 @@ class ApolloListener extends ServletCont
         ConfigStore() = configStore
         val config = configStore.load(true)
 
-        println("Config store contained broker: "+config.id);
         // Only start the broker up if it's enabled..
-        if( config.enabled.getOrElse(true) ) {
-          println("starting broker: "+config.id);
-          val broker = new Broker()
-          broker.config = config
-          BrokerRegistry.add(config.id, broker)
-          broker.start()
-        }
+        info("starting broker");
+        broker = new Broker()
+        broker.config = config
+        BrokerRegistry.add(broker)
+        broker.start()
       }
     } catch {
       case e:Exception =>
-        e.printStackTrace
+        error(e, "failed to start broker")
     }
   }
 
   def contextDestroyed(sce: ServletContextEvent) = {
     if( configStore!=null ) {
-      val id = configStore.load(false).id
-      val broker = BrokerRegistry.remove(id);
       if( broker!=null ) {
+        BrokerRegistry.remove(broker);
         ServiceControl.stop(broker, "broker")
       }
       configStore.stop

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=1052076&r1=1052075&r2=1052076&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 Wed Dec 22 21:34:58 2010
@@ -144,13 +144,11 @@ class BrokerResource extends Resource {
 
   val cs = ConfigStore()
   val config = cs.load(false)
-  def id = config.id
 
   @GET
   def get = {
     val rc = new BrokerSummaryDTO
-    rc.id = id
-    rc.manageable = BrokerRegistry.get(id)!=null
+    rc.manageable = BrokerRegistry.list.size > 0
     rc.configurable = cs.can_write
     rc
   }

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala Wed Dec 22 21:34:58 2010
@@ -40,15 +40,16 @@ import scala.util.continuations._
 case class RuntimeResource(parent:BrokerResource) extends Resource(parent) {
 
   private def with_broker[T](func: (org.apache.activemq.apollo.broker.Broker, Option[T]=>Unit)=>Unit):T = {
-    val broker:org.apache.activemq.apollo.broker.Broker = BrokerRegistry.get(parent.id)
-    if( broker == null ) {
-      result(NOT_FOUND)
-    } else {
-      Future[Option[T]] { cb=>
-        broker.dispatch_queue {
-          func(broker, cb)
-        }
-      }.getOrElse(result(NOT_FOUND))
+    BrokerRegistry.list.headOption match {
+      case None=> result(NOT_FOUND)
+      case Some(broker)=>
+
+        Future[Option[T]] { cb=>
+          broker.dispatch_queue {
+            func(broker, cb)
+          }
+        }.getOrElse(result(NOT_FOUND))
+
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.jade?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.jade (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerSummaryDTO.jade Wed Dec 22 21:34:58 2010
@@ -17,7 +17,7 @@
 - val helper = new org.apache.activemq.apollo.web.resources.ViewHelper
 - import helper._
 
-h1 Broker: #{id}
+h1 Broker
 
 - if (manageable)
   p

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md?rev=1052076&r1=1052075&r2=1052076&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md Wed Dec 22 21:34:58 2010
@@ -76,7 +76,7 @@ The simplest valid `apollo.xml` defines 
 single connector.
 
 {pygmentize:: xml}
-<broker id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
   <virtual_host id="default">
     <host_name>localhost</host_name>
@@ -369,7 +369,7 @@ want to disable authentication in a virt
 to `false`.
 
 {pygmentize:: xml}
-<broker id="default" xmlns="http://activemq.apache.org/schema/activemq/apollo">
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
   <authentication domain="internal"/>
   
   <virtual_host id="wine.com">
@@ -591,7 +591,7 @@ configuration element inside the `broker
 default settings. For example:
 
 {pygmentize:: xml}
-<broker ...>
+<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
   ...
   <web_admin host="127.0.0.1" port="8001"/>
   ...