activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1134439 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/main/scala/org/apache/activemq/apollo/br...
Date Fri, 10 Jun 2011 20:51:32 GMT
Author: chirino
Date: Fri Jun 10 20:51:31 2011
New Revision: 1134439

URL: http://svn.apache.org/viewvc?rev=1134439&view=rev
Log:
Initial support for https://issues.apache.org/jira/browse/APLO-39 : Apply configuration updates to a broker without needing a restart. Virtual hosts and connectors can be added or removed dynamically by just updating the config file.

Added:
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/CollectionsSupport.scala
      - copied, changed from r1134421, activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala
Removed:
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Reporter.scala
Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/KeyStorage.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/osgi/BrokerService.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/transport/VMTransport.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStore.scala
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2Store.scala
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Logging.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala
    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/osgi/OsgiWebServerFactory.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala Fri Jun 10 20:51:31 2011
@@ -23,7 +23,6 @@ import org.fusesource.hawtdispatch._
 import java.util.concurrent._
 import org.apache.activemq.apollo.broker.store._
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 import org.fusesource.hawtdispatch.ListEventAggregator
 import org.apache.activemq.apollo.dto.{StoreStatusDTO, IntMetricDTO, TimeMetricDTO, StoreDTO}
 import org.apache.activemq.apollo.util.OptionSupport._
@@ -35,17 +34,6 @@ import scala.util.continuations._
  */
 object BDBStore extends Log {
   val DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: BDBStoreDTO, reporter:Reporter):ReporterLevel = {
-    new Reporting(reporter) {
-      if( config.directory==null ) {
-        error("The BDB Store directory property must be configured.")
-      }
-    }.result
-  }
 }
 
 /**
@@ -80,19 +68,6 @@ class BDBStore(var config:BDBStoreDTO) e
     }
   }
 
-  def configure(config: StoreDTO, reporter: Reporter) = configure(config.asInstanceOf[BDBStoreDTO], reporter)
-
-  def configure(config: BDBStoreDTO, reporter: Reporter) = {
-    if ( BDBStore.validate(config, reporter) < ERROR ) {
-      if( service_state.is_started ) {
-        // TODO: apply changes while he broker is running.
-        reporter.report(WARN, "Updating bdb store configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
-      } else {
-        this.config = config
-      }
-    }
-  }
-
   protected def _start(on_completed: Runnable) = {
     write_executor = Executors.newFixedThreadPool(1, new ThreadFactory(){
       def newThread(r: Runnable) = {

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala Fri Jun 10 20:51:31 2011
@@ -20,7 +20,6 @@ import dto.BDBStoreDTO
 import org.apache.activemq.apollo.broker.store.StoreFactory
 import org.apache.activemq.apollo.dto.StoreDTO
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 
 /**
  * <p>
@@ -36,21 +35,9 @@ import ReporterLevel._
  */
 class BDBStoreFactory extends StoreFactory.Provider {
 
-  def create(config: StoreDTO) = {
-    config match {
-      case config:BDBStoreDTO =>
-        new BDBStore(config)
-      case _ =>
-        null
-    }
+  def create(config: StoreDTO) =  config match {
+    case config:BDBStoreDTO => new BDBStore(config)
+    case _ => null
   }
 
-   def validate(config: StoreDTO, reporter:Reporter):ReporterLevel = {
-     config match {
-       case config:BDBStoreDTO =>
-         BDBStore.validate(config, reporter)
-       case _ =>
-         null
-     }
-   }
 }

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=1134439&r1=1134438&r2=1134439&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 Fri Jun 10 20:51:31 2011
@@ -20,19 +20,17 @@ import _root_.java.io.File
 import _root_.java.lang.String
 import org.fusesource.hawtdispatch._
 import org.fusesource.hawtbuf._
-import AsciiBuffer._
 import collection.JavaConversions
 import JavaConversions._
-import java.util.concurrent.atomic.AtomicLong
-import org.apache.activemq.apollo.util._
-import ReporterLevel._
 import security.{AclAuthorizer, Authorizer, JaasAuthenticator, Authenticator}
-import java.net.InetSocketAddress
 import org.apache.activemq.apollo.broker.web._
 import collection.mutable.{HashSet, LinkedHashMap, HashMap}
 import scala.util.Random
+import org.apache.activemq.apollo.util._
+import org.fusesource.hawtbuf.AsciiBuffer._
+import CollectionsSupport._
 import FileSupport._
-import org.apache.activemq.apollo.dto.{LogCategoryDTO, BrokerDTO}
+import org.apache.activemq.apollo.dto.{ConnectorDTO, VirtualHostDTO, LogCategoryDTO, BrokerDTO}
 
 /**
  * <p>
@@ -144,39 +142,6 @@ object Broker extends Log {
 
   def class_loader:ClassLoader = ClassFinder.class_loader
 
-  /**
-   * Creates a default a configuration object.
-   */
-  def defaultConfig() = {
-    val rc = new BrokerDTO
-    rc.notes = "A default configuration"
-    rc.virtual_hosts.add(VirtualHost.default_config)
-    rc.connectors.add(Connector.defaultConfig)
-    rc
-  }
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: BrokerDTO, reporter:Reporter):ReporterLevel = {
-    new Reporting(reporter) {
-      if( config.virtual_hosts.isEmpty ) {
-        error("Broker must define at least one virtual host.")
-      }
-
-      for (host <- config.virtual_hosts ) {
-        result |= VirtualHost.validate(host, reporter)
-      }
-      for (connector <- config.connectors ) {
-        result |= Connector.validate(connector, reporter)
-      }
-      if( !config.web_admins.isEmpty ) {
-        WebServerFactory.validate(config.web_admins.toList, reporter)
-      }
-
-    }.result
-  }
-
   val version = using(getClass().getResourceAsStream("version.txt")) { source=>
     read_text(source).trim
   }
@@ -197,13 +162,26 @@ class Broker() extends BaseService {
   import Broker._
 
   var tmp: File = _
-  var config: BrokerDTO = defaultConfig
+
+  var config: BrokerDTO = new BrokerDTO
+  config.virtual_hosts.add({
+    val rc = new VirtualHostDTO
+    rc.id = "default"
+    rc.host_names.add("localhost")
+    rc
+  })
+  config.connectors.add({
+    val rc = new ConnectorDTO
+    rc.id = "default"
+    rc.bind = "tcp://0.0.0.0:0"
+    rc
+  })
 
   var default_virtual_host: VirtualHost = null
   val virtual_hosts = LinkedHashMap[AsciiBuffer, VirtualHost]()
   val virtual_hosts_by_hostname = new LinkedHashMap[AsciiBuffer, VirtualHost]()
 
-  var connectors: List[Connector] = Nil
+  val connectors = LinkedHashMap[String, Connector]()
   val connections = HashMap[Long, BrokerConnection]()
 
   val dispatch_queue = createQueue("broker")
@@ -216,6 +194,7 @@ class Broker() extends BaseService {
 
   var web_server:WebServer = _
 
+  var config_log:Log = Log(new MemoryLogger(Broker.log))
   var audit_log:Log = _
   var security_log:Log  = _
   var connection_log:Log = _
@@ -224,23 +203,6 @@ class Broker() extends BaseService {
 
   override def toString() = "broker: "+id
 
-
-  /**
-   * Validates and then applies the configuration.
-   */
-  def configure(config: BrokerDTO, reporter:Reporter) = {
-    if ( validate(config, reporter) < ERROR ) {
-      dispatch_queue {
-        this.config = config
-      }
-      if( service_state.is_started ) {
-        // TODO: apply changes while he broker is running.
-        reporter.report(WARN, "Updating broker configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
-
-      }
-    }
-  }
-
   var authenticator:Authenticator = _
   var authorizer:Authorizer = _
 
@@ -253,135 +215,233 @@ class Broker() extends BaseService {
     }
   }
 
+  /**
+   * Validates and then applies the configuration.
+   */
+  def update(config: BrokerDTO, on_completed:Runnable) = dispatch_queue {
+    dispatch_queue.assertExecuting()
+    this.config = config
+
+    val tracker = new LoggingTracker("broker reconfiguration", console_log, dispatch_queue)
+    if( service_state.is_started ) {
+      apply_update(tracker)
+    }
+    tracker.callback(on_completed)
+  }
+
   override def _start(on_completed:Runnable) = {
 
     // create the runtime objects from the config
-    {
-      import OptionSupport._
-      init_dispatch_queue(dispatch_queue)
+    init_logs
+    log_versions
+    check_file_limit
+    init_dispatch_queue(dispatch_queue)
+    BrokerRegistry.add(this)
 
-      // Configure the logging categories...
-      val log_category = config.log_category.getOrElse(new LogCategoryDTO)
-      val base_category = "org.apache.activemq.apollo.log."
-      security_log = Log(log_category.security.getOrElse(base_category+"security"))
-      audit_log = Log(log_category.audit.getOrElse(base_category+"audit"))
-      connection_log = Log(log_category.connection.getOrElse(base_category+"connection"))
-      console_log = Log(log_category.console.getOrElse(base_category+"console"))
+    val tracker = new LoggingTracker("broker startup", console_log, dispatch_queue)
+    apply_update(tracker)
+    tracker.callback(on_completed)
 
-      log_versions
-      check_file_limit
+  }
 
-      if( config.key_storage!=null ) {
-        key_storage = new KeyStorage
-        key_storage.config = config.key_storage
-      }
+  def _stop(on_completed:Runnable): Unit = {
+    val tracker = new LoggingTracker("broker shutdown", console_log, dispatch_queue)
 
+    // Stop the services...
+    services.foreach( x=>
+      tracker.stop(x)
+    )
+    services = Nil
 
-      if( config.authentication != null && config.authentication.enabled.getOrElse(true) ) {
-        authenticator = new JaasAuthenticator(config.authentication, security_log)
-        authorizer = new AclAuthorizer(config.authentication.acl_principal_kinds().toList, security_log)
-      }
+    // Stop accepting connections..
+    connectors.values.foreach( x=>
+      tracker.stop(x)
+    )
+    connectors.clear()
 
-      default_virtual_host = null
-      for (c <- config.virtual_hosts) {
-        val host = new VirtualHost(this, c.host_names.head)
-        host.configure(c, LoggingReporter(VirtualHost))
-        virtual_hosts += ascii(c.id)-> host
-        // first defined host is the default virtual host
-        if( default_virtual_host == null ) {
-          default_virtual_host = host
-        }
+    // stop the connections..
+    connections.valuesIterator.foreach { connection=>
+      tracker.stop(connection)
+    }
+    connections.clear()
+
+    // Shutdown the virtual host services
+    virtual_hosts.valuesIterator.foreach( x=>
+      tracker.stop(x)
+    )
+    virtual_hosts.clear()
+    virtual_hosts_by_hostname.clear()
+
+    Option(web_server).foreach(tracker.stop(_))
+    web_server = null
+
+    BrokerRegistry.remove(this)
+    tracker.callback(on_completed)
+  }
+
+  protected def init_logs = {
+    import OptionSupport._
+    // Configure the logging categories...
+    val log_category = config.log_category.getOrElse(new LogCategoryDTO)
+    val base_category = "org.apache.activemq.apollo.log."
+    security_log = Log(log_category.security.getOrElse(base_category + "security"))
+    audit_log = Log(log_category.audit.getOrElse(base_category + "audit"))
+    connection_log = Log(log_category.connection.getOrElse(base_category + "connection"))
+    console_log = Log(log_category.console.getOrElse(base_category + "console"))
+  }
+
+  protected def apply_update(tracker:LoggingTracker) {
+
+    import OptionSupport._
+    init_logs
 
-        // add all the host names of the virtual host to the virtual_hosts_by_hostname map..
-        c.host_names.foreach { name=>
-          virtual_hosts_by_hostname += ascii(name)->host
+    key_storage = if (config.key_storage != null) {
+      new KeyStorage(config.key_storage)
+    } else {
+      null
+    }
+
+    if (config.authentication != null && config.authentication.enabled.getOrElse(true)) {
+      authenticator = new JaasAuthenticator(config.authentication, security_log)
+      authorizer = new AclAuthorizer(config.authentication.acl_principal_kinds().toList, security_log)
+    } else {
+      authenticator = null
+      authorizer = null
+    }
+
+    val host_config_by_id = HashMap[AsciiBuffer, VirtualHostDTO]()
+    config.virtual_hosts.foreach{ value =>
+      host_config_by_id += ascii(value.id) -> value
+    }
+
+    diff(virtual_hosts.keySet.toSet, host_config_by_id.keySet.toSet) match { case (added, updated, removed) =>
+      removed.foreach { id =>
+        for( host <- virtual_hosts.remove(id) ) {
+          host.config.host_names.foreach { name =>
+            virtual_hosts_by_hostname.remove(ascii(name))
+          }
+          tracker.stop(host)
         }
       }
 
-      for (c <- config.connectors) {
-        val connector = new AcceptingConnector(this, c.id)
-        connector.configure(c, LoggingReporter(VirtualHost))
-        connectors ::= connector
-      }
+      updated.foreach { id=>
+        for( host <- virtual_hosts.get(id); config <- host_config_by_id.get(id) ) {
+
+          host.config.host_names.foreach { name =>
+            virtual_hosts_by_hostname.remove(ascii(name))
+          }
 
+          host.update(config, tracker.task("update: "+host))
 
-      services = (config.services.map { clazz =>
-        val service = Broker.class_loader.loadClass(clazz).newInstance().asInstanceOf[Service]
+          config.host_names.foreach { name =>
+            virtual_hosts_by_hostname += ascii(name) -> host
+          }
 
-        // Try to inject the broker via reflection..
-        type BrokerAware = { var broker:Broker }
-        try {
-          service.asInstanceOf[BrokerAware].broker = this
-        } catch { case _ => }
+        }
+      }
+
+      added.foreach { id=>
+        for( config <- host_config_by_id.get(id) ) {
 
-        service
+          val host = new VirtualHost(this, config.id)
+          host.config = config
+          virtual_hosts += ascii(config.id) -> host
+
+          // add all the host names of the virtual host to the virtual_hosts_by_hostname map..
+          config.host_names.foreach { name =>
+            virtual_hosts_by_hostname += ascii(name) -> host
+          }
 
-      }).toList
+          tracker.start(host)
+        }
+      }
     }
 
-    BrokerRegistry.add(this)
+    // first defined host is the default virtual host
+    config.virtual_hosts.headOption.map(x=>ascii(x.id)).foreach { id =>
+      default_virtual_host = virtual_hosts.get(id).getOrElse(null)
+    }
 
-    // Start up the virtual hosts
-    val first_tracker = new LoggingTracker("broker startup", console_log, dispatch_queue)
-    val second_tracker = new LoggingTracker("broker startup", console_log, dispatch_queue)
 
-    if( !config.web_admins.isEmpty ) {
-      WebServerFactory.create(this) match {
-        case null =>
-          warn("Could not start admistration interface.")
-        case x =>
-          web_server = x
-          second_tracker.start(web_server)
-      }
+    val connector_config_by_id = HashMap[String, ConnectorDTO]()
+    config.connectors.foreach{ value =>
+      connector_config_by_id += value.id -> value
     }
 
-    virtual_hosts.valuesIterator.foreach( x=>
-      first_tracker.start(x)
-    )
+    diff(connectors.keySet.toSet, connector_config_by_id.keySet.toSet) match { case (added, updated, removed) =>
+      removed.foreach { id =>
+        for( connector <- connectors.remove(id) ) {
+          tracker.stop(connector)
+        }
+      }
 
-    // Once virtual hosts are up.. start up the connectors.
-    first_tracker.callback{
-      connectors.foreach(second_tracker.start(_))
-      second_tracker.callback {
-        // Once the connectors are up, start the services.
-        val services_tracker = new LoggingTracker("broker startup", console_log, dispatch_queue)
-        services.foreach( x=>
-          first_tracker.start(x)
-        )
-        services_tracker.callback(on_completed)
+      updated.foreach { id=>
+        for( connector <- connectors.get(id); config <- connector_config_by_id.get(id) ) {
+          connector.update(config,  tracker.task("update: "+connector))
+        }
+      }
+
+      added.foreach { id=>
+        for( config <- connector_config_by_id.get(id) ) {
+          val connector = new AcceptingConnector(this, config.id)
+          connector.config = config
+          connectors += config.id -> connector
+          tracker.start(connector)
+        }
       }
     }
 
-  }
+    val set1 = (services.map{x => x.getClass.getName}).toSet
+    diff(set1, config.services.toSet) match { case (added, updated, removed) =>
+      removed.foreach { id =>
+        for( service <- services.find(_.getClass.getName == id) ) {
+          services = services.filterNot( _ == service )
+          tracker.stop(service)
+        }
+      }
 
+      // Not much to do on updates..
 
-  def _stop(on_completed:Runnable): Unit = {
-    val tracker = new LoggingTracker("broker shutdown", console_log, dispatch_queue)
+      added.foreach { clazz=>
 
-    // Stop the services...
-    services.foreach( x=>
-      tracker.stop(x)
-    )
+        val service = Broker.class_loader.loadClass(clazz).newInstance().asInstanceOf[Service]
 
-    // Stop accepting connections..
-    connectors.foreach( x=>
-      tracker.stop(x)
-    )
+        // Try to inject the broker via reflection..
+        type BrokerAware = {var broker: Broker}
+        try {
+          service.asInstanceOf[BrokerAware].broker = this
+        } catch {
+          case _ =>
+        }
 
-    // stop the connections..
-    connections.valuesIterator.foreach { connection=>
-      tracker.stop(connection)
+        services ::= service
+
+        tracker.start(service)
+      }
     }
 
-    // Shutdown the virtual host services
-    virtual_hosts.valuesIterator.foreach( x=>
-      tracker.stop(x)
-    )
+    if( !config.web_admins.isEmpty ) {
+      if ( web_server!=null ) {
+        val task = tracker.task("restart: "+web_server)
+        web_server.stop(^{
+          web_server.start(task)
+        })
+      } else {
+        web_server = WebServerFactory.create(this)
+        if (web_server==null) {
+          warn("Could not start admistration interface.")
+        } else {
+          tracker.start(web_server)
+        }
+      }
+    } else {
+      if( web_server!=null ) {
+        tracker.stop(web_server)
+        web_server = null
+      }
+    }
 
-    Option(web_server).foreach(tracker.stop(_))
 
-    BrokerRegistry.remove(this)
-    tracker.callback(on_completed)
   }
 
   private def log_versions = {
@@ -492,6 +552,6 @@ class Broker() extends BaseService {
     first_accepting_connector.get.transport_server.getSocketAddress
   }
 
-  def first_accepting_connector = connectors.find(_.isInstanceOf[AcceptingConnector]).map(_.asInstanceOf[AcceptingConnector])
+  def first_accepting_connector = connectors.values.find(_.isInstanceOf[AcceptingConnector]).map(_.asInstanceOf[AcceptingConnector])
 
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ConfigStore.scala Fri Jun 10 20:51:31 2011
@@ -27,6 +27,7 @@ import FileSupport._
 import java.util.Properties
 import java.io.{FileOutputStream, FileInputStream, File}
 import java.util.concurrent.{ThreadFactory, TimeUnit, ExecutorService, Executors}
+import org.springframework.core.style.DefaultToStringStyler
 
 object ConfigStore {
 
@@ -60,6 +61,8 @@ trait ConfigStore {
 
   def stop:Unit
 
+  var on_update: (BrokerDTO)=>Unit = { dto => }
+
 }
 
 object FileConfigStore extends Log
@@ -92,7 +95,7 @@ class FileConfigStore(var file:File = ne
     if( !file.exists ) {
       try {
         // try to create a default version of the file.
-        store(Broker.defaultConfig)
+        store((new Broker).config)
       } catch {
         case e:Throwable =>
       }
@@ -139,7 +142,7 @@ class FileConfigStore(var file:File = ne
           if( l != last_modified ) {
             val config = read(file)
             if ( !Arrays.equals(latestData, config.data) ) {
-              // TODO: trigger reloading the config file.
+              on_update(unmarshall(config.data, true))
             }
             latest = config
           }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala Fri Jun 10 20:51:31 2011
@@ -20,10 +20,8 @@ import org.fusesource.hawtdispatch._
 import org.fusesource.hawtdispatch.{Dispatch}
 import org.apache.activemq.apollo.dto.{ConnectorDTO}
 import protocol.{ProtocolFactory, Protocol}
-import collection.mutable.HashMap
 import org.apache.activemq.apollo.transport._
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 import org.apache.activemq.apollo.util.OptionSupport._
 
 
@@ -34,31 +32,6 @@ import org.apache.activemq.apollo.util.O
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 object Connector extends Log {
-
-  /**
-   * Creates a default a configuration object.
-   */
-  def defaultConfig() = {
-    val rc = new ConnectorDTO
-    rc.id = "default"
-    rc.bind = "tcp://0.0.0.0:61613"
-    rc.protocol = "any"
-    rc.connection_limit = 1000
-    rc
-  }
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: ConnectorDTO, reporter:Reporter):ReporterLevel = {
-    new Reporting(reporter) {
-      if( empty(config.id) ) {
-        error("Connector id must be specified")
-      }
-    }.result
-  }
-
-
 }
 
 trait Connector extends BaseService {
@@ -69,6 +42,7 @@ trait Connector extends BaseService {
   def config:ConnectorDTO
   def accepted:LongCounter
   def connected:LongCounter
+  def update(config: ConnectorDTO, on_complete:Runnable):Unit
 
 }
 
@@ -84,7 +58,10 @@ class AcceptingConnector(val broker:Brok
 
   override val dispatch_queue = broker.dispatch_queue
 
-  var config:ConnectorDTO = defaultConfig
+  var config:ConnectorDTO = new ConnectorDTO
+  config.id = id
+  config.bind = "tcp://0.0.0.:0"
+
   var transport_server:TransportServer = _
   var protocol:Protocol = _
   val accepted = new LongCounter()
@@ -133,19 +110,15 @@ class AcceptingConnector(val broker:Brok
   }
 
   /**
-   * Validates and then applies the configuration.
    */
-  def configure(config: ConnectorDTO, reporter:Reporter) = ^{
-    if ( validate(config, reporter) < ERROR ) {
-      this.config = config
-
-      if( service_state.is_started ) {
-        // TODO: apply changes while running
-        reporter.report(WARN, "Updating connector configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
+  def update(config: ConnectorDTO, on_completed:Runnable) = {
+    dispatch_queue.assertExecuting()
+    this.config = config
+    if( service_state.is_started ) {
 
-      }
     }
-  } |>>: dispatch_queue
+    on_completed.run
+  }
 
 
   override def _start(on_completed:Runnable) = {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/KeyStorage.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/KeyStorage.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/KeyStorage.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/KeyStorage.scala Fri Jun 10 20:51:31 2011
@@ -25,9 +25,7 @@ import java.io.FileInputStream
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class KeyStorage {
-
-  var config = new KeyStorageDTO
+class KeyStorage(val config:KeyStorageDTO) {
 
   var key_store:KeyStore = _
   var trust_managers:Array[TrustManager] = _

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala Fri Jun 10 20:51:31 2011
@@ -24,7 +24,6 @@ import org.apache.activemq.apollo.dto._
 import security.SecurityContext
 import store.StoreUOW
 import util.continuations._
-import ReporterLevel._
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -55,7 +54,6 @@ object RouterFactory {
 
   trait Provider {
     def create(host:VirtualHost):Router
-    def validate(config: RouterDTO, reporter:Reporter):ReporterLevel
   }
 
   val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/router-factory.index", classOf[Provider])
@@ -74,22 +72,6 @@ object RouterFactory {
     throw new IllegalArgumentException("Uknonwn router type: "+config.getClass)
   }
 
-
-  def validate(config: RouterDTO, reporter:Reporter):ReporterLevel = {
-    if( config == null ) {
-      return INFO
-    } else {
-      providers.singletons.foreach { provider=>
-        val rc = provider.validate(config, reporter)
-        if( rc!=null ) {
-          return rc
-        }
-      }
-    }
-    reporter.report(ERROR, "Uknonwn router type: "+config.getClass)
-    ERROR
-  }
-
 }
 
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala Fri Jun 10 20:51:31 2011
@@ -24,7 +24,6 @@ import org.fusesource.hawtdispatch._
 import java.util.concurrent.TimeUnit
 import org.apache.activemq.apollo.util._
 import path.PathFilter
-import ReporterLevel._
 import org.fusesource.hawtbuf.{Buffer, AsciiBuffer}
 import collection.JavaConversions
 import java.util.concurrent.atomic.AtomicLong
@@ -38,33 +37,6 @@ import org.apache.activemq.apollo.dto._
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 object VirtualHost extends Log {
-
-  /**
-   * Creates a default a configuration object.
-   */
-  def default_config() = {
-    val rc = new VirtualHostDTO
-    rc.id = "default"
-    rc.host_names.add("localhost")
-    rc.store = null
-    rc
-  }
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: VirtualHostDTO, reporter:Reporter):ReporterLevel = {
-     new Reporting(reporter) {
-
-      if( config.host_names.isEmpty ) {
-        error("Virtual host must be configured with at least one host name.")
-      }
-
-      result |= StoreFactory.validate(config.store, reporter)
-       
-    }.result
-  }
-  
 }
 
 /**
@@ -98,17 +70,12 @@ class VirtualHost(val broker: Broker, va
   /**
    * Validates and then applies the configuration.
    */
-  def configure(config: VirtualHostDTO, reporter:Reporter) = ^{
-    if ( validate(config, reporter) < ERROR ) {
-      this.config = config
-
-      if( service_state.is_started ) {
-        // TODO: apply changes while he broker is running.
-        reporter.report(WARN, "Updating virtual host configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
+  def update(config: VirtualHostDTO, on_completed:Runnable) = dispatch_queue{
+    this.config = config
 
-      }
+    if( service_state.is_started ) {
     }
-  } |>>: dispatch_queue
+  }
 
   override protected def _start(on_completed:Runnable):Unit = {
 
@@ -163,7 +130,6 @@ class VirtualHost(val broker: Broker, va
             }
           }
         }
-        console_log.info("Store started")
         task.run
       }
     }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala Fri Jun 10 20:51:31 2011
@@ -46,32 +46,14 @@ class XmlBrokerFactory extends BrokerFac
         throw new IOException("Cannot create broker from non-existent URI: " + brokerURI)
       }
 
-      val xml = decode(classOf[BrokerDTO], configURL, System.getProperties)
-      return createMessageBroker(xml)
+      val broker = new Broker()
+      broker.config = decode(classOf[BrokerDTO], configURL, System.getProperties)
+      return broker;
+
     } catch {
       case e: Exception =>
         throw new RuntimeException("Cannot create broker from URI: " + value, e)
     }
   }
 
-  def createMessageBroker(config: BrokerDTO): Broker = {
-    import ReporterLevel._
-    val broker = new Broker()
-
-    var error_message = "";
-    broker.configure(config, new Reporter(){
-      override def report(level: ReporterLevel, message: String) = {
-        level match {
-          case ERROR=> error_message+=message+"\n"
-          case _=>
-        }
-      }
-    })
-
-    if( !error_message.isEmpty ) {
-      throw new Exception("Invalid Broker Configuration:\n"+error_message)
-    }
-    
-    broker
-  }
 }

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=1134439&r1=1134438&r2=1134439&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 Fri Jun 10 20:51:31 2011
@@ -17,13 +17,9 @@
 package org.apache.activemq.apollo.broker.jetty
 
 import org.eclipse.jetty.server.{Connector, Handler, Server}
-import org.eclipse.jetty.security._
-import org.apache.activemq.apollo.dto.{WebAdminDTO, PrincipalDTO}
 import org.apache.activemq.apollo.broker.Broker
-import authentication.BasicAuthenticator
 import org.eclipse.jetty.webapp.WebAppContext
 import org.eclipse.jetty.server.nio.SelectChannelConnector
-import org.eclipse.jetty.plus.jaas.JAASLoginService
 import org.apache.activemq.apollo.util._
 import org.fusesource.hawtdispatch._
 import java.io.File
@@ -31,11 +27,9 @@ import java.lang.String
 import org.apache.activemq.apollo.broker.web.{WebServer, WebServerFactory}
 import java.net.URI
 import org.eclipse.jetty.server.handler.HandlerList
-import collection.mutable.{HashMap, ListBuffer}
+import collection.mutable.HashMap
 import org.eclipse.jetty.server.ssl.SslSelectChannelConnector
-import javax.net.ssl.KeyManager
 import javax.net.ssl.SSLContext
-import javax.net.ssl.TrustManager
 import org.eclipse.jetty.util.thread.ExecutorThreadPool
 
 /**
@@ -59,20 +53,13 @@ object JettyWebServerFactory extends Web
     if( !enabled ) {
       return null
     }
-    new JettyWebServer(broker)
-  }
-
-  def validate(config: List[WebAdminDTO], reporter: Reporter): ReporterLevel.ReporterLevel = {
-    if( !enabled ) {
-      return null
-    }
-    import ReporterLevel._
     if( JettyWebServer.webapp==null ) {
-      reporter.report(ERROR, "The apollo.home or apollo.webapp system property must be set so that the webconsole can be started.")
-      return ERROR
+      JettyWebServer.warn("The apollo.home or apollo.webapp system property must be set so that the webconsole can be started.")
+      return null
     }
-    return INFO
+    new JettyWebServer(broker)
   }
+
 }
 
 /**

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/osgi/BrokerService.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/osgi/BrokerService.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/osgi/BrokerService.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/osgi/BrokerService.scala Fri Jun 10 20:51:31 2011
@@ -74,7 +74,7 @@ object BrokerService extends Log {
 
       debug("Starting broker");
       broker = new Broker()
-      broker.configure(dto, LoggingReporter(this))
+      broker.update(dto, NOOP)
       broker.tmp = basedir / "tmp"
       broker.tmp.mkdirs
       broker.start(^{

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala Fri Jun 10 20:51:31 2011
@@ -52,13 +52,6 @@ trait Store extends ServiceTrait {
   def create_uow():StoreUOW
 
   /**
-   * Supplies configuration data to the Store.  This will be called
-   * before the store is started, but may also occur after the the Store
-   * is started.
-   */
-  def configure(config: StoreDTO, reporter:Reporter):Unit
-
-  /**
    * Removes all previously stored data.
    */
   def purge(callback: =>Unit):Unit

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala Fri Jun 10 20:51:31 2011
@@ -18,7 +18,6 @@ package org.apache.activemq.apollo.broke
  */
 import org.apache.activemq.apollo.dto.StoreDTO
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 
 /**
  * <p>
@@ -30,7 +29,6 @@ object StoreFactory {
 
   trait Provider {
     def create(config:StoreDTO):Store
-    def validate(config: StoreDTO, reporter:Reporter):ReporterLevel
   }
 
   val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/store-factory.index", classOf[Provider])
@@ -48,20 +46,4 @@ object StoreFactory {
     throw new IllegalArgumentException("Uknonwn store type: "+config.getClass)
   }
 
-
-  def validate(config: StoreDTO, reporter:Reporter):ReporterLevel = {
-    if( config == null ) {
-      return INFO
-    } else {
-      providers.singletons.foreach { provider=>
-        val rc = provider.validate(config, reporter)
-        if( rc!=null ) {
-          return rc
-        }
-      }
-    }
-    reporter.report(ERROR, "Uknonwn store type: "+config.getClass)
-    ERROR
-  }
-
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/transport/VMTransport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/transport/VMTransport.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/transport/VMTransport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/transport/VMTransport.scala Fri Jun 10 20:51:31 2011
@@ -30,6 +30,7 @@ import org.apache.activemq.apollo.transp
 import org.apache.activemq.apollo.transport.pipe.PipeTransportServer
 import org.apache.activemq.apollo.util._
 import java.lang.String
+import org.apache.activemq.apollo.dto.ConnectorDTO
 
 
 /**
@@ -127,7 +128,7 @@ class VMTransportFactory extends PipeTra
       if (server == null && create) {
 
         // This is the connector that the broker needs.
-        val connector = Connector.defaultConfig
+        val connector = new ConnectorDTO
         connector.id = "vm"
         connector.bind = "vm://" + name
 
@@ -136,7 +137,6 @@ class VMTransportFactory extends PipeTra
         if (brokerURI == null) {
           // Lets create and configure it...
           broker = new Broker()
-          broker.config = Broker.defaultConfig
           broker.config.connectors.clear
           broker.config.connectors.add(connector)
         } else {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala Fri Jun 10 20:51:31 2011
@@ -17,8 +17,6 @@
 package org.apache.activemq.apollo.broker.web
 
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
-import org.apache.activemq.apollo.dto.WebAdminDTO
 import org.apache.activemq.apollo.broker.Broker
 
 /**
@@ -39,7 +37,6 @@ object WebServerFactory {
 
   trait Provider {
     def create(broker:Broker):WebServer
-    def validate(config: List[WebAdminDTO], reporter:Reporter):ReporterLevel
   }
 
   val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/web-server-factory.index",classOf[Provider])
@@ -57,20 +54,4 @@ object WebServerFactory {
     null
   }
 
-
-  def validate(config: List[WebAdminDTO], reporter:Reporter):ReporterLevel = {
-    if( config == null ) {
-      return INFO
-    } else {
-      providers.singletons.foreach { provider=>
-        val rc = provider.validate(config, reporter)
-        if( rc!=null ) {
-          return rc
-        }
-      }
-    }
-    reporter.report(ERROR, "Could not find a web server implementation to use.")
-    ERROR
-  }
-
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala Fri Jun 10 20:51:31 2011
@@ -198,7 +198,7 @@ abstract class BrokerPerfSupport extends
   def getRemoteProtocolName(): String
 
   def createBrokerConfig(name: String, bindURI: String, connectUri: String): BrokerDTO = {
-    val config = Broker.defaultConfig
+    val config = (new Broker).config
     val connector = config.connectors.get(0)
     connector.bind = bindURI
     connector.protocol = getBrokerProtocolName

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=1134439&r1=1134438&r2=1134439&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 Fri Jun 10 20:51:31 2011
@@ -19,11 +19,11 @@ package org.apache.activemq.apollo.cli.c
 import org.apache.felix.gogo.commands.{Action, Option => option, Argument => argument, Command => command}
 import java.io.File
 import org.apache.activemq.apollo.broker.{Broker, ConfigStore, FileConfigStore}
-import org.fusesource.hawtdispatch._
 import org.apache.activemq.apollo.util.FileSupport._
 import org.apache.activemq.apollo.cli.Apollo
 import org.apache.felix.service.command.CommandSession
-import org.apache.activemq.apollo.util.{ServiceControl, Log, LoggingReporter}
+import org.apache.activemq.apollo.util.ServiceControl
+import org.fusesource.hawtdispatch._
 
 /**
  * The apollo run command
@@ -80,12 +80,21 @@ class Run extends Action {
       // Load the configs and start the brokers up.
       session.getConsole.println("Loading configuration file '%s'.".format(conf))
 
+      val broker = new Broker()
       val store = new FileConfigStore
-      store.file = conf
+
       ConfigStore() = store
+      store.file = conf
+      store.on_update = { config =>
+        broker.dispatch_queue {
+          broker.console_log.info("Reloading configuration file '%s'.".format(conf))
+          broker.update(config, ^{
+            broker.console_log.info("Reload completed.")
+          })
+        }
+      }
       store.start
 
-      val broker = new Broker()
       broker.config = store.load(true)
       broker.tmp = tmp
       broker.start()

Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStore.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStore.scala Fri Jun 10 20:51:31 2011
@@ -16,36 +16,21 @@
  */
 package org.apache.activemq.apollo.broker.store.hawtdb
 
-import collection.mutable.ListBuffer
 import dto.{HawtDBStoreStatusDTO, HawtDBStoreDTO}
-import java.util.HashMap
-import collection.{Seq}
+import collection.Seq
 import org.fusesource.hawtdispatch._
-import java.io.File
 import java.util.concurrent._
 import atomic.{AtomicInteger, AtomicLong}
 import org.apache.activemq.apollo.dto._
 import org.apache.activemq.apollo.broker.store._
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
-import org.fusesource.hawtdispatch.{DispatchQueue, BaseRetained, ListEventAggregator}
+import org.fusesource.hawtdispatch.ListEventAggregator
 import org.apache.activemq.apollo.util.OptionSupport._
 import java.io.{InputStream, OutputStream}
 import scala.util.continuations._
 
 object HawtDBStore extends Log {
   val DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: HawtDBStoreDTO, reporter:Reporter):ReporterLevel = {
-    new Reporting(reporter) {
-      if( config.directory==null ) {
-        error("The HawtDB Store directory property must be configured.")
-      }
-    }.result
-  }
 }
 
 /**
@@ -53,8 +38,6 @@ object HawtDBStore extends Log {
  */
 class HawtDBStore(var config:HawtDBStoreDTO) extends DelayingStoreSupport {
 
-  import HawtDBStore._
-
   var next_queue_key = new AtomicLong(1)
   var next_msg_key = new AtomicLong(1)
 
@@ -81,19 +64,6 @@ class HawtDBStore(var config:HawtDBStore
     }
   }
 
-  def configure(config: StoreDTO, reporter: Reporter) = configure(config.asInstanceOf[HawtDBStoreDTO], reporter)
-
-  def configure(config: HawtDBStoreDTO, reporter: Reporter) = {
-    if ( HawtDBStore.validate(config, reporter) < ERROR ) {
-      if( service_state.is_started ) {
-        // TODO: apply changes while he broker is running.
-        reporter.report(WARN, "Updating hawtdb store configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
-      } else {
-        this.config = config
-      }
-    }
-  }
-
   protected def _start(on_completed: Runnable) = {
     executor_pool = Executors.newFixedThreadPool(1, new ThreadFactory(){
       def newThread(r: Runnable) = {

Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala Fri Jun 10 20:51:31 2011
@@ -20,7 +20,6 @@ import dto.HawtDBStoreDTO
 import org.apache.activemq.apollo.broker.store.StoreFactory
 import org.apache.activemq.apollo.dto.StoreDTO
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 
 /**
  * <p>
@@ -36,21 +35,9 @@ import ReporterLevel._
  */
 class HawtDBStoreFactory extends StoreFactory.Provider {
 
-  def create(config: StoreDTO) = {
-    config match {
-      case config:HawtDBStoreDTO =>
-        new HawtDBStore(config)
-      case _ =>
-        null
-    }
+  def create(config: StoreDTO) = config match {
+    case config:HawtDBStoreDTO => new HawtDBStore(config)
+    case _ => null
   }
 
-   def validate(config: StoreDTO, reporter:Reporter):ReporterLevel = {
-     config match {
-       case config:HawtDBStoreDTO =>
-         HawtDBStore.validate(config, reporter)
-       case _ =>
-         null
-     }
-   }
 }

Modified: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2Store.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2Store.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2Store.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2Store.scala Fri Jun 10 20:51:31 2011
@@ -20,13 +20,11 @@ import dto.{JDBM2StoreDTO, JDBM2StoreSta
 import java.util.concurrent.atomic.AtomicLong
 import collection.Seq
 import org.fusesource.hawtdispatch._
-import java.io.File
 import java.util.concurrent._
 import org.apache.activemq.apollo.broker.store._
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 import org.fusesource.hawtdispatch.ListEventAggregator
-import org.apache.activemq.apollo.dto.{StoreStatusDTO, IntMetricDTO, TimeMetricDTO, StoreDTO}
+import org.apache.activemq.apollo.dto.StoreStatusDTO
 import org.apache.activemq.apollo.util.OptionSupport._
 import java.io.{InputStream, OutputStream}
 import scala.util.continuations._
@@ -36,17 +34,6 @@ import scala.util.continuations._
  */
 object JDBM2Store extends Log {
   val DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
-
-  /**
-   * Validates a configuration object.
-   */
-  def validate(config: JDBM2StoreDTO, reporter:Reporter):ReporterLevel = {
-    new Reporting(reporter) {
-      if( config.directory==null ) {
-        error("The jdbm2 store directory property must be configured.")
-      }
-    }.result
-  }
 }
 
 /**
@@ -54,8 +41,6 @@ object JDBM2Store extends Log {
  */
 class JDBM2Store(var config:JDBM2StoreDTO) extends DelayingStoreSupport {
 
-  import JDBM2Store._
-
   var next_queue_key = new AtomicLong(1)
   var next_msg_key = new AtomicLong(1)
 
@@ -80,19 +65,6 @@ class JDBM2Store(var config:JDBM2StoreDT
     }
   }
 
-  def configure(config: StoreDTO, reporter: Reporter) = configure(config.asInstanceOf[JDBM2StoreDTO], reporter)
-
-  def configure(config: JDBM2StoreDTO, reporter: Reporter) = {
-    if ( JDBM2Store.validate(config, reporter) < ERROR ) {
-      if( service_state.is_started ) {
-        // TODO: apply changes while he broker is running.
-        reporter.report(WARN, "Updating jdbm2 store configuration at runtime is not yet supported.  You must restart the broker for the change to take effect.")
-      } else {
-        this.config = config
-      }
-    }
-  }
-
   protected def _start(on_completed: Runnable) = {
     executor = Executors.newFixedThreadPool(1, new ThreadFactory(){
       def newThread(r: Runnable) = {

Modified: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala Fri Jun 10 20:51:31 2011
@@ -20,7 +20,6 @@ import dto.JDBM2StoreDTO
 import org.apache.activemq.apollo.broker.store.StoreFactory
 import org.apache.activemq.apollo.dto.StoreDTO
 import org.apache.activemq.apollo.util._
-import ReporterLevel._
 
 /**
  * <p>
@@ -32,21 +31,11 @@ import ReporterLevel._
  */
 class JDBM2StoreFactory extends StoreFactory.Provider {
 
-  def create(config: StoreDTO) = {
-    config match {
-      case config:JDBM2StoreDTO =>
-        new JDBM2Store(config)
-      case _ =>
-        null
-    }
+  def create(config: StoreDTO) = config match {
+    case config:JDBM2StoreDTO =>
+      new JDBM2Store(config)
+    case _ =>
+      null
   }
 
-   def validate(config: StoreDTO, reporter:Reporter):ReporterLevel = {
-     config match {
-       case config:JDBM2StoreDTO =>
-         JDBM2Store.validate(config, reporter)
-       case _ =>
-         null
-     }
-   }
 }

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolHandler.scala Fri Jun 10 20:51:31 2011
@@ -114,7 +114,7 @@ class OpenwireProtocolHandler extends Pr
 
   override def create_connection_status = {
     var rc = new OpenwireConnectionStatusDTO
-    rc.protocol_version = if (wire_format == null) null else wire_format.getVersion.toString
+    rc.protocol_version = ""+(if (wire_format == null) 0 else wire_format.getVersion)
     rc.user = login.map(_.toString).getOrElse(null)
     //    rc.subscription_count = consumers.size
     rc.waiting_on = waiting_on

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala Fri Jun 10 20:51:31 2011
@@ -22,6 +22,7 @@ import java.lang.String
 import org.apache.activemq.apollo.broker.{KeyStorage, Broker, BrokerFactory}
 import org.apache.activemq.apollo.util.{FileSupport, Logging, FunSuiteSupport, ServiceControl}
 import FileSupport._
+import org.apache.activemq.apollo.dto.KeyStorageDTO
 
 class StompTestSupport extends FunSuiteSupport with ShouldMatchers with BeforeAndAfterEach with Logging {
   var broker: Broker = null
@@ -977,10 +978,12 @@ class StompUnifiedQueueTest extends Stom
 class StompSslDestinationTest extends StompDestinationTest {
   override val broker_config_uri: String = "xml:classpath:apollo-stomp-ssl.xml"
 
-  client.key_storeage = new KeyStorage
-  client.key_storeage.config.file = basedir/"src"/"test"/"resources"/"client.ks"
-  client.key_storeage.config.password = "password"
-  client.key_storeage.config.key_password = "password"
+  val config = new KeyStorageDTO
+  config.file = basedir/"src"/"test"/"resources"/"client.ks"
+  config.password = "password"
+  config.key_password = "password"
+
+  client.key_storeage = new KeyStorage(config)
 
 }
 
@@ -1445,10 +1448,11 @@ class StompSslSecurityTest extends Stomp
   }
 
   def use_client_cert = {
-    client.key_storeage = new KeyStorage
-    client.key_storeage.config.file = basedir/"src"/"test"/"resources"/"client.ks"
-    client.key_storeage.config.password = "password"
-    client.key_storeage.config.key_password = "password"
+    val config = new KeyStorageDTO
+    config.file = basedir/"src"/"test"/"resources"/"client.ks"
+    config.password = "password"
+    config.key_password = "password"
+    client.key_storeage = new KeyStorage(config)
   }
 
   test("Connect with cert and no id password") {

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.scala Fri Jun 10 20:51:31 2011
@@ -40,6 +40,9 @@ trait BaseService extends Service with D
     def is_created = false
     def is_starting = false
     def is_started = false
+
+    def is_starting_or_started = is_starting | is_started
+
     def is_stopping = false
     def is_stopped= false
     def is_failed= false

Copied: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/CollectionsSupport.scala (from r1134421, activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/CollectionsSupport.scala?p2=activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/CollectionsSupport.scala&p1=activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala&r1=1134421&r2=1134439&rev=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/CollectionsSupport.scala Fri Jun 10 20:51:31 2011
@@ -16,34 +16,18 @@
  */
 package org.apache.activemq.apollo.util
 
-import org.fusesource.hawtdispatch._
-import org.fusesource.hawtdispatch.{TaskTracker, DispatchQueue}
-
 /**
  * <p>
- * A TaskTracker which logs an informational message if that tasks don't complete
- * within the timeout.
  * </p>
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class LoggingTracker(name:String, val log:Log=Log(classOf[LoggingTracker]), parent:DispatchQueue=globalQueue) extends TaskTracker(name, parent) {
-  assert(log!=null)
-  import log._
-
-  timeout = 1000;
-
-  override protected def onTimeout(duration:Long, tasks: List[String]):Long = {
-    info("%s is taking a long time (%d seconds). Waiting on %s", name, (duration/1000), tasks.mkString(", "))
-    timeout
-  }
+object CollectionsSupport {
 
-  def start(service:Service) = {
-    service.start(task(service.toString))
+  def diff[T](prev:Set[T], next:Set[T]):(Set[T],Set[T],Set[T]) = {
+    val updating = prev.intersect(next)
+    val adding = next -- updating
+    val removing = prev -- next
+    (adding, updating, removing)
   }
-
-  def stop(service:Service) = {
-    service.stop(task(service.toString))
-  }
-
-}
+}
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Logging.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Logging.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Logging.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Logging.scala Fri Jun 10 20:51:31 2011
@@ -16,12 +16,10 @@
  */
 package org.apache.activemq.apollo.util
 
-import _root_.java.util.{LinkedHashMap, HashMap}
-import _root_.java.lang.{Throwable, String}
-import org.slf4j.{MDC, Logger, LoggerFactory}
-
-
 import java.util.concurrent.atomic.AtomicLong
+import org.slf4j.{Marker, MDC, Logger, LoggerFactory}
+import java.lang.{UnsupportedOperationException, Throwable, String}
+import collection.mutable.ListBuffer
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
@@ -34,6 +32,10 @@ object Log {
     override val log = LoggerFactory.getLogger(name)
   }
 
+  def apply(value:Logger):Log = new Log {
+    override val log = value
+  }
+
   val exception_id_generator = new AtomicLong(System.currentTimeMillis)
   def next_exception_id = exception_id_generator.incrementAndGet.toHexString
 }
@@ -205,3 +207,84 @@ trait Logging {
   protected def trace(e: Throwable)= log.trace(e)
 
 }
+
+case class LogEntry(level:String, message:String, ts:Long=System.currentTimeMillis())
+class MemoryLogger(val next:Logger) extends Logger {
+
+  var messages = ListBuffer[LogEntry]()
+
+  def add(level:String, message:String) = {
+    messages.append(LogEntry(message, level))
+    while ( messages.size > 1000 ) {
+      message.drop(1)
+    }
+    next
+  }
+  
+  def getName = next.getName
+
+  def isWarnEnabled(marker: Marker) = true
+  def isWarnEnabled = true
+  def warn(msg: String) = add("warn", msg).warn(msg) 
+  def warn(msg: String, t: Throwable) =  add("warn", msg).warn(msg, t)
+  def warn(marker: Marker, msg: String, t: Throwable) = throw new UnsupportedOperationException()
+  def warn(marker: Marker, msg: String) = throw new UnsupportedOperationException()
+  def warn(marker: Marker, format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def warn(marker: Marker, format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def warn(marker: Marker, format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+  def warn(format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def warn(format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def warn(format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+
+  def isTraceEnabled(marker: Marker) = true
+  def isTraceEnabled = true
+  def trace(msg: String) = add("trace", msg).trace(msg) 
+  def trace(msg: String, t: Throwable) =  add("trace", msg).trace(msg, t)
+  def trace(marker: Marker, msg: String, t: Throwable) = throw new UnsupportedOperationException()
+  def trace(marker: Marker, msg: String) = throw new UnsupportedOperationException()
+  def trace(marker: Marker, format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def trace(marker: Marker, format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def trace(marker: Marker, format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+  def trace(format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def trace(format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def trace(format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()  
+  
+  def isInfoEnabled(marker: Marker) = true
+  def isInfoEnabled = true
+  def info(msg: String) = add("info", msg).info(msg) 
+  def info(msg: String, t: Throwable) =  add("info", msg).info(msg, t)
+  def info(marker: Marker, msg: String, t: Throwable) = throw new UnsupportedOperationException()
+  def info(marker: Marker, msg: String) = throw new UnsupportedOperationException()
+  def info(marker: Marker, format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def info(marker: Marker, format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def info(marker: Marker, format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+  def info(format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def info(format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def info(format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()  
+  
+  def isErrorEnabled(marker: Marker) = true
+  def isErrorEnabled = true
+  def error(msg: String) = add("error", msg).error(msg) 
+  def error(msg: String, t: Throwable) =  add("error", msg).error(msg, t)
+  def error(marker: Marker, msg: String, t: Throwable) = throw new UnsupportedOperationException()
+  def error(marker: Marker, msg: String) = throw new UnsupportedOperationException()
+  def error(marker: Marker, format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def error(marker: Marker, format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def error(marker: Marker, format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+  def error(format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def error(format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def error(format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()  
+  
+  def isDebugEnabled(marker: Marker) = true
+  def isDebugEnabled = true
+  def debug(msg: String) = add("debug", msg).debug(msg) 
+  def debug(msg: String, t: Throwable) =  add("debug", msg).debug(msg, t)
+  def debug(marker: Marker, msg: String, t: Throwable) = throw new UnsupportedOperationException()
+  def debug(marker: Marker, msg: String) = throw new UnsupportedOperationException()
+  def debug(marker: Marker, format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def debug(marker: Marker, format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def debug(marker: Marker, format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()
+  def debug(format: String, argArray: Array[AnyRef]) = throw new UnsupportedOperationException()
+  def debug(format: String, arg: AnyRef) = throw new UnsupportedOperationException()
+  def debug(format: String, arg1: AnyRef, arg2: AnyRef) = throw new UnsupportedOperationException()  
+}

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/LoggingTracker.scala Fri Jun 10 20:51:31 2011
@@ -39,11 +39,11 @@ class LoggingTracker(name:String, val lo
   }
 
   def start(service:Service) = {
-    service.start(task(service.toString))
+    service.start(task("start "+service))
   }
 
   def stop(service:Service) = {
-    service.stop(task(service.toString))
+    service.stop(task("stop "+service))
   }
 
 }

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=1134439&r1=1134438&r2=1134439&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 Fri Jun 10 20:51:31 2011
@@ -45,7 +45,7 @@ class ApolloListener extends ServletCont
         // Only start the broker up if it's enabled..
         info("starting broker");
         broker = new Broker()
-        broker.configure(config, LoggingReporter(ApolloListener))
+        broker.config = config
         broker.start()
       }
     } catch {

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/osgi/OsgiWebServerFactory.scala Fri Jun 10 20:51:31 2011
@@ -17,8 +17,6 @@
 package org.apache.activemq.apollo.web.osgi
 
 import org.apache.activemq.apollo.broker.web.{WebServerFactory, WebServer}
-import org.apache.activemq.apollo.util.{Reporter, ReporterLevel}
-import org.apache.activemq.apollo.dto.WebAdminDTO
 import org.apache.activemq.apollo.broker.Broker
 import org.apache.activemq.apollo.broker.osgi.BrokerService
 
@@ -33,31 +31,28 @@ class OsgiWebServerFactory  extends WebS
   // So that the factory class does not load, if we cannot load OSGi
   private val broker_service = BrokerService
 
-  def create(broker:Broker): WebServer = new WebServer {
-
-    def start: Unit = {
-      // TODO: see if we can poke around and get the endpoint address
-      // of our deployment to pax web
-    }
-
-    def stop: Unit = {
-    }
-
-    def start(onComplete: Runnable): Unit = {
-      start
-      onComplete.run
-    }
-    def stop(onComplete: Runnable): Unit = {
-      stop
-      onComplete.run
-    }
+  def create(broker:Broker): WebServer = if( broker_service.context == null ) {
+      return null
+  } else {
+    new WebServer {
 
-  }
+      def start: Unit = {
+        // TODO: see if we can poke around and get the endpoint address
+        // of our deployment to pax web
+      }
+
+      def stop: Unit = {
+      }
+
+      def start(onComplete: Runnable): Unit = {
+        start
+        onComplete.run
+      }
+      def stop(onComplete: Runnable): Unit = {
+        stop
+        onComplete.run
+      }
 
-  def validate(config: List[WebAdminDTO], reporter: Reporter): ReporterLevel.ReporterLevel = {
-    if( broker_service.context == null ) {
-      return null
     }
-    return ReporterLevel.INFO
   }
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala Fri Jun 10 20:51:31 2011
@@ -71,7 +71,7 @@ case class BrokerResource() extends Reso
           result.virtual_hosts.add( host.id )
         }
 
-        broker.connectors.foreach{ c=>
+        broker.connectors.values.foreach{ c=>
           result.connectors.add( c.id )
         }
 
@@ -477,7 +477,7 @@ case class BrokerResource() extends Reso
 
     with_broker { broker =>
       monitoring(broker) {
-        val records = broker.connectors.map { value =>
+        val records = broker.connectors.values.map { value =>
           Success(status(value))
         }
         FutureResult(narrow(classOf[ConnectorStatusDTO], records, f, q, p, ps))

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala?rev=1134439&r1=1134438&r2=1134439&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala Fri Jun 10 20:51:31 2011
@@ -291,7 +291,7 @@ abstract class Resource(parent:Resource=
 
   protected def with_connector[T](id:String)(func: (org.apache.activemq.apollo.broker.Connector)=>FutureResult[T]):FutureResult[T] = {
     with_broker { broker =>
-      broker.connectors.find(_.id == id) match {
+      broker.connectors.get(id) match {
         case Some(connector)=>
           func(connector)
         case None=> result(NOT_FOUND)



Mime
View raw message