activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r961209 [1/2] - in /activemq/sandbox/activemq-apollo-actor: activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/ activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/ activemq-broker/src/test/scala/org/apache/a...
Date Wed, 07 Jul 2010 04:20:55 GMT
Author: chirino
Date: Wed Jul  7 04:20:53 2010
New Revision: 961209

URL: http://svn.apache.org/viewvc?rev=961209&view=rev
Log:
- changed the DTOs to use lower case + under scores for the feilds.
- html view now does a better rendering of memory based fields and time fields.

Added:
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.java
      - copied, changed from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IntMetricDTO.java
      - copied, changed from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/TimeMetricDTO.java
      - copied, changed from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/JavaBaseService.java
      - copied, changed from r961208, activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.java
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.scaml
Removed:
    activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.java
Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/XMLBrokerFactoryTest.scala
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
    activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/main/scala/org/apache/activemq/broker/store/cassandra/CassandraStore.scala
    activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/test/scala/org/apache/activemq/broker/store/cassandra/CassandraStoreTest.scala
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationSummaryDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/LongIdDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StringIdDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.java
    activemq/sandbox/activemq-apollo-actor/activemq-dto/src/test/java/org/apache/activemq/apollo/dto/XmlEncoderDecoderTest.java
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStore.scala
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreBenchmark.scala
    activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreTest.scala
    activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
    activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala
    activemq/sandbox/activemq-apollo-actor/activemq-store/src/main/scala/org/apache/activemq/apollo/store/Store.scala
    activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
    activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/TimeCounter.scala
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.scaml
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectionStatusDTO.scaml
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/ConnectorStatusDTO.scaml
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.scaml
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.scaml
    activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/web/resources/RootResource.index.scaml

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Wed Jul  7 04:20:53 2010
@@ -126,7 +126,7 @@ object Broker extends Log {
     rc.id = "default"
     rc.enabled = true
     rc.notes = "A default configuration"
-    rc.virtualHosts.add(VirtualHost.defaultConfig)
+    rc.virtual_hosts.add(VirtualHost.defaultConfig)
     rc.connectors.add(Connector.defaultConfig)
     rc.basedir = "./activemq-data/default"
     rc
@@ -140,14 +140,14 @@ object Broker extends Log {
       if( empty(config.id) ) {
         error("Broker id must be specified.")
       }
-      if( config.virtualHosts.isEmpty ) {
+      if( config.virtual_hosts.isEmpty ) {
         error("Broker must define at least one virtual host.")
       }
       if( empty(config.basedir) ) {
         error("Broker basedir must be defined.")
       }
 
-      for (host <- config.virtualHosts ) {
+      for (host <- config.virtual_hosts ) {
         result |= VirtualHost.validate(host, reporter)
       }
       for (connector <- config.connectors ) {
@@ -214,7 +214,7 @@ class Broker() extends BaseService with 
     {
       dataDirectory = new File(config.basedir)
       defaultVirtualHost = null
-      for (c <- config.virtualHosts) {
+      for (c <- config.virtual_hosts) {
         val host = new VirtualHost(this, virtual_host_id_counter.incrementAndGet)
         host.configure(c, this)
         virtualHosts += ascii(c.id)-> host

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala Wed Jul  7 04:20:53 2010
@@ -54,7 +54,7 @@ object VirtualHost extends Log {
     val rc = new VirtualHostDTO
     rc.id = "default"
     rc.enabled = true
-    rc.hostNames.add("localhost")
+    rc.host_names.add("localhost")
 
 //    val store = new CassandraStoreDTO
 //    store.hosts.add("localhost:9160")
@@ -72,7 +72,7 @@ object VirtualHost extends Log {
   def validate(config: VirtualHostDTO, reporter:Reporter):ReporterLevel = {
      new Reporting(reporter) {
 
-      if( config.hostNames.isEmpty ) {
+      if( config.host_names.isEmpty ) {
         error("Virtual host must be configured with at least one host name.")
       }
 
@@ -145,7 +145,7 @@ class VirtualHost(val broker: Broker, va
           getKeyDone.run
         }
 
-        if( config.purgeOnStartup ) {
+        if( config.purge_on_startup ) {
           storeStartupDone.name = "store purge"
           store.purge {
             storeStartupDone.run
@@ -221,7 +221,7 @@ class VirtualHost(val broker: Broker, va
       cb(null)
     } else {
       var queue = queues.get(destination.getName);
-      if( queue==null && config.autoCreateQueues ) {
+      if( queue==null && config.auto_create_queues ) {
         addQueue(destination)(cb)
       } else  {
         cb(queue)

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/XMLBrokerFactoryTest.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/XMLBrokerFactoryTest.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/XMLBrokerFactoryTest.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/jaxb/XMLBrokerFactoryTest.scala Wed Jul  7 04:20:53 2010
@@ -47,7 +47,7 @@ class XMLBrokerFactoryTest extends FunSu
     }
 
     expect(2) {
-      broker.config.virtualHosts.size()
+      broker.config.virtual_hosts.size()
     }
 
     //		Assert.assertNotNull(broker.defaultVirtualHost().getDatabase())

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala Wed Jul  7 04:20:53 2010
@@ -199,8 +199,8 @@ abstract class BrokerPerfSupport extends
     connector.advertise = connectUri
     connector.protocol = getBrokerWireFormat
 
-    val host = config.virtualHosts.get(0)
-    host.purgeOnStartup = true
+    val host = config.virtual_hosts.get(0)
+    host.purge_on_startup = true
     config
   }
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/main/scala/org/apache/activemq/broker/store/cassandra/CassandraStore.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/main/scala/org/apache/activemq/broker/store/cassandra/CassandraStore.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/main/scala/org/apache/activemq/broker/store/cassandra/CassandraStore.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/main/scala/org/apache/activemq/broker/store/cassandra/CassandraStore.scala Wed Jul  7 04:20:53 2010
@@ -23,7 +23,6 @@ import java.util.concurrent.atomic.Atomi
 import collection.mutable.ListBuffer
 import java.util.HashMap
 import org.apache.activemq.apollo.broker.{Logging, Log, BaseService}
-import org.apache.activemq.apollo.dto.{CassandraStoreDTO, StoreDTO}
 import collection.{JavaConversions, Seq}
 import org.apache.activemq.apollo.broker.{Reporting, ReporterLevel, Reporter}
 import com.shorrockin.cascal.utils.Conversions._
@@ -32,6 +31,7 @@ import ReporterLevel._
 import java.util.concurrent._
 import org.apache.activemq.apollo.util.{TimeCounter, IntCounter}
 import org.apache.activemq.apollo.store._
+import org.apache.activemq.apollo.dto.{StoreStatusDTO, CassandraStoreDTO, StoreDTO}
 
 object CassandraStore extends Log {
 
@@ -80,7 +80,12 @@ class CassandraStore extends Store with 
   def configure(config: StoreDTO, reporter: Reporter) = configure(config.asInstanceOf[CassandraStoreDTO], reporter)
 
 
-  def storeType = "cassandra"
+  def storeStatusDTO(callback:(StoreStatusDTO)=>Unit) = dispatchQueue {
+    val rc = new StoreStatusDTO
+    rc.state = serviceState.toString
+    rc.state_since = serviceState.since
+    callback(rc)
+  }
 
   def configure(config: CassandraStoreDTO, reporter: Reporter) = {
     if ( CassandraStore.validate(config, reporter) < ERROR ) {
@@ -380,10 +385,10 @@ class CassandraStore extends Store with 
         }
       }
 
-      if( !uow.completeListeners.isEmpty || config.flushDelay <= 0 ) {
+      if( !uow.completeListeners.isEmpty || config.flush_delay <= 0 ) {
         flush(uow_id)
       } else {
-        dispatchQueue.dispatchAfter(config.flushDelay, TimeUnit.MILLISECONDS, ^{flush(uow_id)})
+        dispatchQueue.dispatchAfter(config.flush_delay, TimeUnit.MILLISECONDS, ^{flush(uow_id)})
       }
 
     }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/test/scala/org/apache/activemq/broker/store/cassandra/CassandraStoreTest.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/test/scala/org/apache/activemq/broker/store/cassandra/CassandraStoreTest.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/test/scala/org/apache/activemq/broker/store/cassandra/CassandraStoreTest.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-cassandra/src/test/scala/org/apache/activemq/broker/store/cassandra/CassandraStoreTest.scala Wed Jul  7 04:20:53 2010
@@ -25,7 +25,7 @@ class CassandraStoreTest extends StoreFu
 
   def createStore(flushDelay:Long):Store = {
     val rc = new CassandraStore
-    rc.config.flushDelay = flushDelay
+    rc.config.flush_delay = flushDelay
     rc
   }
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerDTO.java Wed Jul  7 04:20:53 2010
@@ -44,9 +44,8 @@ public class BrokerDTO extends ServiceDT
     /**
      * Used to track who last modified the configuration.
      */
-    @JsonProperty("modified_by")
     @XmlAttribute(name="modified-by")
-    public String modifiedBy;
+    public String modified_by;
 
     /**
      * Used to store any configuration notes.
@@ -58,9 +57,8 @@ public class BrokerDTO extends ServiceDT
     /**
      * A broker can service many virtual hosts.
      */
-    @JsonProperty("virtual_hosts")
     @XmlElement(name="virtual-host")
-    public List<VirtualHostDTO> virtualHosts = new ArrayList<VirtualHostDTO>();
+    public List<VirtualHostDTO> virtual_hosts = new ArrayList<VirtualHostDTO>();
 
     /**
      * A broker accepts connections via it's configured connectors.

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/BrokerStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -36,28 +36,24 @@ public class
     /**
      * The current time on the broker machine.  In milliseconds since the epoch.
      */
-    @JsonProperty("current_time")
 	@XmlAttribute(name="current-time")
-	public long currentTime;
+	public long current_time;
 
     /**
      * Ids of all the virtual hosts running on the broker
      */
-    @JsonProperty("virtual_hosts")
     @XmlElement(name="virtual-host")
-    public List<Long> virtualHosts = new ArrayList<Long>();
+    public List<Long> virtual_hosts = new ArrayList<Long>();
 
     /**
      * Ids of all the connectors running on the broker
      */
-    @JsonProperty("connectors")
     @XmlElement(name="connector")
     public List<Long> connectors = new ArrayList<Long>();
 
     /**
      * Ids of all the connections running on the broker
      */
-    @JsonProperty("connections")
     @XmlElement(name="connection")
     public List<Long> connections = new ArrayList<Long>();
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectionStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -36,16 +36,14 @@ public class ConnectionStatusDTO extends
     /**
      * The number of bytes that have been read from the connection.
      */
-    @JsonProperty("read_counter")
 	@XmlAttribute(name="read-counter")
-	public Long readCounter;
+	public long read_counter;
 
     /**
      * The number of bytes that have been written to the connection.
      */
-    @JsonProperty("write_counter")
 	@XmlAttribute(name="write-counter")
-	public Long writeCounter;
+	public long write_counter;
 
     /**
      * The protocol the connection is using.
@@ -64,9 +62,8 @@ public class ConnectionStatusDTO extends
     /**
      * The remote address of the connection
      */
-    @JsonProperty("remote_address")
 	@XmlAttribute(name="remote-address")
-	public String remoteAddress;
+	public String remote_address;
 
     /**
      * The connected user

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ConnectorStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -35,14 +35,12 @@ public class ConnectorStatusDTO extends 
     /**
      * The number of connections that this connector has accepted.
      */
-    @JsonProperty
-	@XmlAttribute
-	public Long accepted;
+    @XmlAttribute
+    public long accepted;
 
     /**
      * Ids of all open connections that the connector is managing.
      */
-    @JsonProperty("connections")
     @XmlElement(name="connection")
     public List<Long> connections = new ArrayList<Long>();
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -38,21 +38,18 @@ public class DestinationStatusDTO extend
     /**
      * Ids of all connections that are producing to the destination
      */
-    @JsonProperty("producers")
     @XmlElement(name="producer")
     public List<Long> producers = new ArrayList<Long>();
 
     /**
      * Ids of all connections that are consuming from the destination
      */
-    @JsonProperty("consumers")
     @XmlElement(name="consumer")
     public List<Long> consumers = new ArrayList<Long>();
 
     /**
      * Ids of all queues that are associated with the destination
      */
-    @JsonProperty("queues")
     @XmlElement(name="queue")
     public List<Long> queues = new ArrayList<Long>();
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationSummaryDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationSummaryDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationSummaryDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationSummaryDTO.java Wed Jul  7 04:20:53 2010
@@ -33,15 +33,13 @@ public class DestinationSummaryDTO exten
     /**
      * The destination name
      */
-    @JsonProperty
-    @XmlElement
+    @XmlAttribute
     public String name;
 
     /**
      * The routing domain
      */
-    @JsonProperty
-    @XmlElement
+    @XmlAttribute
     public String domain;
     
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -36,28 +36,22 @@ public class EntryStatusDTO {
     /**
      * A unique id of the object within it's container
      */
-    @JsonProperty
 	@XmlAttribute
 	public long seq;
 
-    @JsonProperty
     @XmlAttribute
     public int count;
 
-    @JsonProperty
     @XmlAttribute
     public int size;
 
-    @JsonProperty
     @XmlAttribute
     public String state;
 
-    @JsonProperty("consumer_count")
     @XmlAttribute(name = "consumer-count")
-    public int consumerCount;
+    public int consumer_count;
 
-    @JsonProperty("prefetch_count")
     @XmlAttribute(name = "prefetch-count")
-    public int prefetchCount;
+    public int prefetch_count;
 
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreDTO.java Wed Jul  7 04:20:53 2010
@@ -31,41 +31,32 @@ import java.io.File;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class HawtDBStoreDTO extends StoreDTO {
 
-    @JsonProperty
     @XmlAttribute
     public File directory;
 
-    @JsonProperty("archive_directory")
     @XmlAttribute(name="archive-directory")
-    public File archiveDirectory;
+    public File archive_directory;
 
-    @JsonProperty("index_flush_interval")
 	@XmlAttribute(name="index-flush-interval")
-	public long indexFlushInterval = 5 * 1000L;
+	public long index_flush_interval = 5 * 1000L;
 
-    @JsonProperty("cleanup_interval")
 	@XmlAttribute(name="cleanup-interval")
-	public long cleanupInterval = 30 * 1000L;
+	public long cleanup_interval = 30 * 1000L;
 
-    @JsonProperty("journal_log_size")
 	@XmlAttribute(name="journal-log-size")
-	public int journalLogSize = 1024*1024*64;
+	public int journal_log_size = 1024*1024*64;
 
-    @JsonProperty("journal_batch_size")
     @XmlAttribute(name="journal-batch-size")
-    public int journalBatchSize = 1024*256;
+    public int journal_batch_size = 1024*256;
 
-    @JsonProperty("index_cache_size")
     @XmlAttribute(name="index-cache-size")
-    public int indexCacheSize = 5000;
+    public int index_cache_size = 5000;
 
-    @JsonProperty("index_page_size")
     @XmlAttribute(name="index-page-size")
-    public short indexPageSize = 512;
+    public short index_page_size = 512;
 
-    @JsonProperty("fail_if_locked")
     @XmlAttribute(name="fail-if-locked")
-    public boolean failIfLocked = false;
+    public boolean fail_if_locked = false;
 
 
 }

Copied: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.java (from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.java?p2=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.java&p1=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java&r1=961208&r2=961209&rev=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/HawtDBStoreStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -16,27 +16,25 @@
  */
 package org.apache.activemq.apollo.dto;
 
-import org.codehaus.jackson.annotate.JsonProperty;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="id-list")
+@XmlRootElement(name="hawtdb-store-status")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class IdListDTO {
+public class HawtDBStoreStatusDTO extends StoreStatusDTO {
+
+    @XmlElement(name="journal-append-latency")
+    public TimeMetricDTO journal_append_latency;
+
+    @XmlElement(name="index-update-latency")
+    public TimeMetricDTO index_update_latency;
 
-    /**
-     * A list of ids.
-     */
-    @JsonProperty("ids")
-    @XmlElement
-    public List<String> ids = new ArrayList<String>();
+    @XmlElement(name="message-load-batch-size")
+    public IntMetricDTO message_load_batch_size;
 
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IdListDTO.java Wed Jul  7 04:20:53 2010
@@ -35,8 +35,7 @@ public class IdListDTO {
     /**
      * A list of ids.
      */
-    @JsonProperty("ids")
-    @XmlElement
+    @XmlElement(name="id")
     public List<String> ids = new ArrayList<String>();
 
 }
\ No newline at end of file

Copied: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IntMetricDTO.java (from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IntMetricDTO.java?p2=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IntMetricDTO.java&p1=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java&r1=961208&r2=961209&rev=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/IntMetricDTO.java Wed Jul  7 04:20:53 2010
@@ -22,42 +22,46 @@ import javax.xml.bind.annotation.XmlAcce
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.concurrent.TimeUnit;
 
 /**
- * <p>
- * </p>
+ *
+ *
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="entry-status")
+@XmlRootElement(name = "int-metric")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class EntryStatusDTO {
+public class IntMetricDTO {
 
     /**
-     * A unique id of the object within it's container
+     * The number of events
      */
-    @JsonProperty
-	@XmlAttribute
-	public long seq;
-
-    @JsonProperty
     @XmlAttribute
     public int count;
 
-    @JsonProperty
+    /**
+     * The total amount added
+     */
     @XmlAttribute
-    public int size;
+    public int total;
 
-    @JsonProperty
+    /**
+     * The maximum amount added in an event
+     */
     @XmlAttribute
-    public String state;
+    public int max;
+
+    /**
+     * The minimum amount added in an event
+     */
+    @XmlAttribute
+    public int min;
+
+
+    public float avg() {
+        return count==0 ? 0f : ((float)total) / count;
+    }
 
-    @JsonProperty("consumer_count")
-    @XmlAttribute(name = "consumer-count")
-    public int consumerCount;
-
-    @JsonProperty("prefetch_count")
-    @XmlAttribute(name = "prefetch-count")
-    public int prefetchCount;
 
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/LongIdDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/LongIdDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/LongIdDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/LongIdDTO.java Wed Jul  7 04:20:53 2010
@@ -33,7 +33,6 @@ public class LongIdDTO {
     /**
      * A unique id of the object within it's container
      */
-    @JsonProperty
 	@XmlAttribute
 	public long id;
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -35,66 +35,51 @@ public class QueueStatusDTO extends Long
     /**
      * A unique id of the object within it's container
      */
-    @JsonProperty
 	@XmlAttribute
 	public long id;
 
-    @JsonProperty("enqueue_item_counter")
     @XmlAttribute(name="enqueue-item-counter")
-    public long enqueueItemCounter;
+    public long enqueue_item_counter;
 
-    @JsonProperty("dequeue_item_counter")
     @XmlAttribute(name="dequeue-item-counter")
-    public long dequeueItemCounter;
+    public long dequeue_item_counter;
 
-    @JsonProperty("enqueue_size_counter")
     @XmlAttribute(name="enqueue-size-counter")
-    public long enqueueSizeCounter;
+    public long enqueue_size_counter;
 
-    @JsonProperty("dequeue_size_counter")
     @XmlAttribute(name="dequeue-size-counter")
-    public long dequeueSizeCounter;
+    public long dequeue_size_counter;
 
-    @JsonProperty("nack_item_counter")
     @XmlAttribute(name="nack-item-counter")
-    public long nackItemCounter;
+    public long nack_item_counter;
 
-    @JsonProperty("nack_size_counter")
     @XmlAttribute(name="nack-size-counter")
-    public long nackSizeCounter;
+    public long nack_size_counter;
 
-    @JsonProperty("queue_size")
     @XmlAttribute(name="queue-size")
-    public long queueSize;
+    public long queue_size;
 
-    @JsonProperty("queue_items")
     @XmlAttribute(name="queue-items")
-    public long queueItems;
+    public long queue_items;
 
-    @JsonProperty("loading_size")
     @XmlAttribute(name="loading-size")
-    public int loadingSize;
+    public int loading_size;
 
-    @JsonProperty("flushing_size")
     @XmlAttribute(name="flushing-size")
-    public int flushingSize;
+    public int flushing_size;
 
-    @JsonProperty("flushing_items")
     @XmlAttribute(name="flushed-items")
-    public int flushedItems;
+    public int flushed_items;
 
-    @JsonProperty("capacity_used")
     @XmlAttribute(name="capacity-used")
-    public int capacityUsed;
+    public int capacity_used;
 
-    @JsonProperty
     @XmlAttribute
     public int capacity;
 
     /**
      * Status of the entries in the queue
      */
-    @JsonProperty("entries")
     @XmlElement(name="entry")
     public List<EntryStatusDTO> entries = new ArrayList<EntryStatusDTO>();
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceDTO.java Wed Jul  7 04:20:53 2010
@@ -33,7 +33,6 @@ public class ServiceDTO<ID> extends Stri
     /**
      * Should this service be running?
      */
-    @JsonProperty
     @XmlAttribute
     public boolean enabled = true;
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/ServiceStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.apollo.dto;
 
-import org.codehaus.jackson.annotate.JsonProperty;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -32,16 +30,15 @@ public class ServiceStatusDTO extends Lo
 
     /**
      * The state of the service.
+	 * @XmlAttribute
      */
-    @JsonProperty
-	@XmlAttribute
+    @XmlAttribute
 	public String state;
 
     /**
      * Since when has the broker in in this state?  In milliseconds since the epoch. 
      */
-    @JsonProperty("state_since")
 	@XmlAttribute(name="state-since")
-	public long stateSince;
+	public long state_since;
 
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreDTO.java Wed Jul  7 04:20:53 2010
@@ -38,9 +38,8 @@ public abstract class StoreDTO {
      * be invalidated shortly thereafter by another unit of work which
      * would negate the operation.
      */
-    @JsonProperty("flush_delay")
     @XmlAttribute(name="flush-delay", required=false)
-    public long flushDelay = 100;
+    public long flush_delay = 100;
 
 
 }

Added: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java?rev=961209&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java (added)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.apollo.dto;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonTypeInfo;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+@XmlType(name = "store-status-type")
+@XmlSeeAlso({HawtDBStoreStatusDTO.class})
+@JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class")
+public class StoreStatusDTO {
+
+    /**
+     * The state of the service.
+     */
+	@XmlAttribute
+	public String state;
+
+    /**
+     * Since when has the service been in in this state?  In milliseconds since the epoch. 
+     */
+	@XmlAttribute(name="state-since")
+	public long state_since;
+
+    /**
+     * The number of message stores that were canceled before they were flushed.
+     */
+    @XmlAttribute(name="canceled-message-counter")
+    public long canceled_message_counter;
+
+    /**
+     * The number of message stores that were flushed.
+     */
+    @XmlAttribute(name="flushed-message-counter")
+    public long flushed_message_counter;
+
+    /**
+     * The number of enqueues that were canceled before they were flushed.
+     */
+    @XmlAttribute(name="canceled-enqueue-counter")
+    public long canceled_enqueue_counter;
+
+    /**
+     * The number of enqueues that were flushed.
+     */
+    @XmlAttribute(name="flushed-enqueue-counter")
+    public long flushed_enqueue_counter;
+
+    /**
+     * The amount of time it takes to load a message from the store.
+     */
+    @XmlElement(name="message-load-latency")
+    public TimeMetricDTO message_load_latency;
+
+    /**
+     * The amount of time it takes to flush a unit of work to the store
+     */
+    @XmlElement(name="flush-latency")
+    public TimeMetricDTO flush_latency;
+
+}
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StringIdDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StringIdDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StringIdDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/StringIdDTO.java Wed Jul  7 04:20:53 2010
@@ -32,7 +32,6 @@ public class StringIdDTO {
     /**
      * A unique id of the object within it's container
      */
-    @JsonProperty
 	@XmlAttribute
 	public String id;
 

Copied: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/TimeMetricDTO.java (from r961208, activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/TimeMetricDTO.java?p2=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/TimeMetricDTO.java&p1=activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java&r1=961208&r2=961209&rev=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/EntryStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/TimeMetricDTO.java Wed Jul  7 04:20:53 2010
@@ -22,42 +22,59 @@ import javax.xml.bind.annotation.XmlAcce
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.concurrent.TimeUnit;
 
 /**
- * <p>
- * </p>
+ *
+ *
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="entry-status")
+@XmlRootElement(name = "time-metric")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class EntryStatusDTO {
+public class TimeMetricDTO {
 
     /**
-     * A unique id of the object within it's container
+     * The number of timed events
      */
-    @JsonProperty
-	@XmlAttribute
-	public long seq;
+    @XmlAttribute
+    public long count;
 
-    @JsonProperty
+    /**
+     * The total time in nanoseconds
+     */
     @XmlAttribute
-    public int count;
+    public long total;
 
-    @JsonProperty
+    /**
+     * The maximum time in nanoseconds spent in an event
+     */
     @XmlAttribute
-    public int size;
+    public long max;
 
-    @JsonProperty
+    /**
+     * The minimum time in nanoseconds spent in an event
+     */
     @XmlAttribute
-    public String state;
+    public long min;
 
-    @JsonProperty("consumer_count")
-    @XmlAttribute(name = "consumer-count")
-    public int consumerCount;
-
-    @JsonProperty("prefetch_count")
-    @XmlAttribute(name = "prefetch-count")
-    public int prefetchCount;
 
+    public float max(TimeUnit unit) {
+        return ((float)max) / unit.toNanos(1);
+    }
+    public float min(TimeUnit unit) {
+        return ((float)min) / unit.toNanos(1);
+    }
+    public float total(TimeUnit unit) {
+        return ((float)total) / unit.toNanos(1);
+    }
+
+    public float avg(TimeUnit unit) {
+        return count==0 ? 0f : total(unit) / count;
+    }
+
+    public float frequency(TimeUnit unit) {
+        return ((float)1) / avg(unit);
+    }
+    
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostDTO.java Wed Jul  7 04:20:53 2010
@@ -29,11 +29,9 @@ import javax.xml.bind.annotation.*;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class VirtualHostDTO extends ServiceDTO<String> {
 
-    @JsonProperty("host_names")
     @XmlElement(name="host-name", required=true)
-    public ArrayList<String> hostNames = new ArrayList<String>();
+    public ArrayList<String> host_names = new ArrayList<String>();
 
-    @JsonProperty
     @XmlElementRef
     public StoreDTO store;
 
@@ -43,12 +41,11 @@ public class VirtualHostDTO extends Serv
      */
     @JsonProperty("auto_create_queues")
     @XmlAttribute(name="auto-create-queues")
-    public boolean autoCreateQueues = true;
+    public boolean auto_create_queues = true;
 
     /**
      * Should queues be purged on startup?
      */
-    @JsonProperty("purge_on_startup")
     @XmlAttribute(name="purge-on-startup")
-    public boolean purgeOnStartup = false;
+    public boolean purge_on_startup = false;
 }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/main/java/org/apache/activemq/apollo/dto/VirtualHostStatusDTO.java Wed Jul  7 04:20:53 2010
@@ -33,16 +33,14 @@ import java.util.List;
 public class VirtualHostStatusDTO extends ServiceStatusDTO {
 
     /**
-     * The type of store the virtual host is using.
+     * The status of the store
      */
-    @JsonProperty("store_type")
-    @XmlAttribute(name="store-type")
-    public String storeType;
+    @XmlElementRef
+    public StoreStatusDTO store;
 
     /**
      * Ids of all the destinations running on the broker
      */
-    @JsonProperty("destinations")
     @XmlElement(name="destination")
     public List<DestinationSummaryDTO> destinations = new ArrayList<DestinationSummaryDTO>();
 
@@ -50,7 +48,6 @@ public class VirtualHostStatusDTO extend
     /**
      * The current running configuration of the object
      */
-    @JsonProperty
     @XmlElement
     public VirtualHostDTO config = null;
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-dto/src/test/java/org/apache/activemq/apollo/dto/XmlEncoderDecoderTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-dto/src/test/java/org/apache/activemq/apollo/dto/XmlEncoderDecoderTest.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-dto/src/test/java/org/apache/activemq/apollo/dto/XmlEncoderDecoderTest.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-dto/src/test/java/org/apache/activemq/apollo/dto/XmlEncoderDecoderTest.java Wed Jul  7 04:20:53 2010
@@ -39,10 +39,10 @@ public class XmlEncoderDecoderTest {
         assertNotNull(dto);
         assertEquals("default", dto.id);
         assertEquals(true, dto.enabled);
-        assertEquals("vh-local", dto.virtualHosts.get(0).id);
-        assertEquals(true, dto.virtualHosts.get(0).enabled);
-        assertEquals("localhost", dto.virtualHosts.get(0).hostNames.get(0));
-        assertEquals("example.com", dto.virtualHosts.get(0).hostNames.get(1));
+        assertEquals("vh-local", dto.virtual_hosts.get(0).id);
+        assertEquals(true, dto.virtual_hosts.get(0).enabled);
+        assertEquals("localhost", dto.virtual_hosts.get(0).host_names.get(0));
+        assertEquals("example.com", dto.virtual_hosts.get(0).host_names.get(1));
     }
 
 
@@ -55,9 +55,9 @@ public class XmlEncoderDecoderTest {
         VirtualHostDTO host = new VirtualHostDTO();
         host.id = "vh-local";
         host.enabled = true;
-        host.hostNames.add("localhost");
-        host.hostNames.add("example.com");
-        broker.virtualHosts.add(host);
+        host.host_names.add("localhost");
+        host.host_names.add("example.com");
+        broker.virtual_hosts.add(host);
 
         ConnectorDTO connector = new ConnectorDTO();
         connector.id = "port-61616";

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBClient.scala Wed Jul  7 04:20:53 2010
@@ -97,13 +97,13 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
   private def directory = config.directory
 
-  private def journalMaxFileLength = config.journalLogSize
+  private def journalMaxFileLength = config.journal_log_size
 
-  private def checkpointInterval = config.indexFlushInterval
+  private def checkpointInterval = config.index_flush_interval
 
-  private def cleanupInterval = config.cleanupInterval
+  private def cleanupInterval = config.cleanup_interval
 
-  private def failIfDatabaseIsLocked = config.failIfLocked
+  private def failIfDatabaseIsLocked = config.fail_if_locked
 
   private def indexFile = indexFileFactory.getTxPageFile()
 
@@ -150,8 +150,8 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
       journal = new Journal()
       journal.setDirectory(directory)
-      journal.setMaxFileLength(config.journalLogSize)
-      journal.setMaxWriteBatchSize(config.journalBatchSize);
+      journal.setMaxFileLength(config.journal_log_size)
+      journal.setMaxWriteBatchSize(config.journal_batch_size);
       journal.setChecksum(true);
       journal.setListener( new JournalListener{
         def synced(writes: Array[JournalListener.Write]) = {
@@ -168,8 +168,8 @@ class HawtDBClient(hawtDBStore: HawtDBSt
         }
       })
 
-      if( config.archiveDirectory!=null ) {
-        journal.setDirectoryArchive(config.archiveDirectory)
+      if( config.archive_directory!=null ) {
+        journal.setDirectoryArchive(config.archive_directory)
         journal.setArchiveDataLogs(true)
       }
       journal.start
@@ -178,8 +178,8 @@ class HawtDBClient(hawtDBStore: HawtDBSt
       indexFileFactory.setDrainOnClose(false)
       indexFileFactory.setSync(true)
       indexFileFactory.setUseWorkerThread(true)
-      indexFileFactory.setPageSize(config.indexPageSize)
-      indexFileFactory.setCacheSize(config.indexCacheSize);
+      indexFileFactory.setPageSize(config.index_page_size)
+      indexFileFactory.setCacheSize(config.index_cache_size);
 
       indexFileFactory.open
 
@@ -372,15 +372,18 @@ class HawtDBClient(hawtDBStore: HawtDBSt
     rc
   }
 
-  val metric_load_from_index = new TimeCounter
-  val metric_load_from_journal = new TimeCounter
+  val metric_load_from_index_counter = new TimeCounter
+  var metric_load_from_index = metric_load_from_index_counter(false)
+
+  val metric_load_from_journal_counter = new TimeCounter
+  var metric_load_from_journal = metric_load_from_journal_counter(false)
 
   def loadMessages(requests: ListBuffer[(Long, (Option[MessageRecord])=>Unit)]) = {
     val locations = withTx { tx =>
       val helper = new TxHelper(tx)
       import helper._
       requests.flatMap { case (messageKey, callback)=>
-        val location = metric_load_from_index.time {
+        val location = metric_load_from_index_counter.time {
           messageKeyIndex.get(messageKey)
         }
         if( location==null ) {
@@ -394,7 +397,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
     }
 
     locations.foreach { case (location, callback)=>
-      val addMessage = metric_load_from_journal.time {
+      val addMessage = metric_load_from_journal_counter.time {
         load(location, classOf[AddMessage.Getter])
       }
       callback( addMessage.map( x => toMessageRecord(x) ) )
@@ -403,7 +406,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
   }
 
   def loadMessage(messageKey: Long): Option[MessageRecord] = {
-    metric_load_from_index.start { end =>
+    metric_load_from_index_counter.start { end =>
       withTx { tx =>
         val helper = new TxHelper(tx)
         import helper._
@@ -412,7 +415,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
         end()
 
         if (location != null) {
-          metric_load_from_journal.time {
+          metric_load_from_journal_counter.time {
             load(location, classOf[AddMessage.Getter]) match {
               case Some(x) =>
                 val messageRecord: MessageRecord = x
@@ -462,8 +465,11 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
   private def _store(update: TypeCreatable, onComplete: Runnable): Unit = _store(-1, update, onComplete)
 
-  val metric_journal_append = new TimeCounter
-  val metric_index_update = new TimeCounter
+  val metric_journal_append_counter = new TimeCounter
+  var metric_journal_append = metric_journal_append_counter(false)
+
+  val metric_index_update_counter = new TimeCounter
+  var metric_index_update = metric_index_update_counter(false)
 
   /**
    * All updated are are funneled through this method. The updates are logged to
@@ -482,7 +488,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
 
     val buffer = baos.toBuffer()
     append(buffer) { (helper, location) =>
-      metric_index_update.time {
+      metric_index_update_counter.time {
         executeStore(helper, location, batch, update, onComplete)
       }
     }
@@ -636,7 +642,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
   /////////////////////////////////////////////////////////////////////
 
   private def append(data: Buffer)(cb: (TxHelper, Location) => List[Runnable]): Unit = {
-    metric_journal_append.start { end =>
+    metric_journal_append_counter.start { end =>
       def cbintercept(tx:TxHelper,location:Location) = {
         end()
         cb(tx, location)
@@ -934,7 +940,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
         }
       }
     }
-    dispatchQueue.dispatchAfter(config.indexFlushInterval, TimeUnit.MILLISECONDS, ^ {try_flush})
+    dispatchQueue.dispatchAfter(config.index_flush_interval, TimeUnit.MILLISECONDS, ^ {try_flush})
   }
 
   def flush() = {
@@ -957,7 +963,7 @@ class HawtDBClient(hawtDBStore: HawtDBSt
         }
       }
     }
-    dispatchQueue.dispatchAfter(config.cleanupInterval, TimeUnit.MILLISECONDS, ^ {try_cleanup})
+    dispatchQueue.dispatchAfter(config.cleanup_interval, TimeUnit.MILLISECONDS, ^ {try_cleanup})
   }
 
   /**

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStore.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStore.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/main/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStore.scala Wed Jul  7 04:20:53 2010
@@ -20,7 +20,6 @@ import org.fusesource.hawtdispatch.BaseR
 import java.util.concurrent.atomic.AtomicLong
 import collection.mutable.ListBuffer
 import java.util.HashMap
-import org.apache.activemq.apollo.dto.{HawtDBStoreDTO, StoreDTO}
 import collection.{JavaConversions, Seq}
 import org.fusesource.hawtdispatch.ScalaDispatch._
 import org.apache.activemq.apollo.broker._
@@ -28,8 +27,9 @@ import java.io.File
 import ReporterLevel._
 import java.util.concurrent._
 import org.apache.activemq.apollo.store._
-import org.apache.activemq.apollo.util.{IntMetricCounter, TimeCounter, IntCounter}
 import org.apache.activemq.broker.store.{StoreUOW, Store}
+import org.apache.activemq.apollo.dto._
+import org.apache.activemq.apollo.util._
 
 object HawtDBStore extends Log {
   val DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
@@ -79,8 +79,6 @@ class HawtDBStore extends Store with Bas
 
   def configure(config: StoreDTO, reporter: Reporter) = configure(config.asInstanceOf[HawtDBStoreDTO], reporter)
 
-  def storeType = "hawtdb"
-
   def configure(config: HawtDBStoreDTO, reporter: Reporter) = {
     if ( HawtDBStore.validate(config, reporter) < ERROR ) {
       if( serviceState.isStarted ) {
@@ -101,7 +99,7 @@ class HawtDBStore extends Store with Bas
       }
     })
     client.config = config
-    schedualDisplayStats
+    poll_stats
     executor_pool {
       client.start(^{
         next_msg_key.set( client.rootBuffer.getLastMessageKey.longValue +1 )
@@ -184,7 +182,7 @@ class HawtDBStore extends Store with Bas
 
 
   def loadMessage(messageKey: Long)(callback: (Option[MessageRecord]) => Unit) = {
-    message_load_latency.start { end=>
+    message_load_latency_counter.start { end=>
       load_source.merge((messageKey, { (result)=>
         end()
         callback(result)
@@ -194,7 +192,7 @@ class HawtDBStore extends Store with Bas
 
   def drain_loads = {
     var data = load_source.getData
-    message_load_batch_size += data.size
+    message_load_batch_size_counter += data.size
     executor_pool ^{
       client.loadMessages(data)
     }
@@ -262,7 +260,7 @@ class HawtDBStore extends Store with Bas
 
     var delayable_actions = 0
 
-    def delayable = !disableDelay && delayable_actions>0 && config.flushDelay>=0
+    def delayable = !disableDelay && delayable_actions>0 && config.flush_delay>=0
 
     def rm(msg:Long) = {
       actions -= msg
@@ -327,7 +325,7 @@ class HawtDBStore extends Store with Bas
     }
 
     def onPerformed() = this.synchronized {
-      commit_latency += System.nanoTime-dispose_start
+      commit_latency_counter += System.nanoTime-dispose_start
       completeListeners.foreach { x=>
         x.run
       }
@@ -340,9 +338,14 @@ class HawtDBStore extends Store with Bas
   var metric_flushed_message_counter:Long = 0
   var metric_flushed_enqueue_counter:Long = 0
 
-  val commit_latency = new TimeCounter
-  val message_load_batch_size = new IntMetricCounter
-  val message_load_latency = new TimeCounter
+  val commit_latency_counter = new TimeCounter
+  var commit_latency = commit_latency_counter(false)
+
+  val message_load_latency_counter = new TimeCounter
+  var message_load_latency = message_load_latency_counter(false)
+
+  val message_load_batch_size_counter = new IntMetricCounter
+  var message_load_batch_size = message_load_batch_size_counter(false)
 
   var canceled_add_message:Long = 0
   var canceled_enqueue:Long = 0
@@ -360,49 +363,62 @@ class HawtDBStore extends Store with Bas
 
   var next_batch_id = new IntCounter(1)
 
-  def schedualDisplayStats:Unit = {
-    val st = System.nanoTime
-    val ss = (metric_canceled_message_counter, metric_canceled_enqueue_counter, metric_flushed_message_counter, metric_flushed_enqueue_counter)
+  implicit def toTimeMetricDTO( m: TimeMetric) = {
+    val rc = new TimeMetricDTO()
+    rc.count = m.count
+    rc.max = m.max
+    rc.min = m.min
+    rc.total = m.total
+    rc
+  }
+
+  implicit def toIntMetricDTO( m: IntMetric) = {
+    val rc = new IntMetricDTO()
+    rc.count = m.count
+    rc.max = m.max
+    rc.min = m.min
+    rc.total = m.total
+    rc
+  }
+
+  def storeStatusDTO(callback:(StoreStatusDTO)=>Unit) = dispatchQueue {
+    val rc = new HawtDBStoreStatusDTO
+
+    rc.state = serviceState.toString
+    rc.state_since = serviceState.since
+
+    rc.flush_latency = flush_latency
+    rc.message_load_latency = message_load_latency
+    rc.message_load_batch_size = message_load_batch_size
+
+    rc.journal_append_latency = client.metric_journal_append
+    rc.index_update_latency = client.metric_index_update
+
+    rc.canceled_message_counter = metric_canceled_message_counter
+    rc.canceled_enqueue_counter = metric_canceled_enqueue_counter
+    rc.flushed_message_counter = metric_flushed_message_counter
+    rc.flushed_enqueue_counter = metric_flushed_enqueue_counter
+
+    callback(rc)
+  }
+
+
+  def poll_stats:Unit = {
     def displayStats = {
       if( serviceState.isStarted ) {
-        val et = System.nanoTime
-        val es = (metric_canceled_message_counter, metric_canceled_enqueue_counter, metric_flushed_message_counter, metric_flushed_enqueue_counter)
-        def rate(x:Long, y:Long):Float = ((y-x)*1000.0f)/TimeUnit.NANOSECONDS.toMillis(et-st)
-
-        val m1 = rate(ss._1,es._1)
-        val m2 = rate(ss._2,es._2)
-        val m3 = rate(ss._3,es._3)
-        val m4 = rate(ss._4,es._4)
-
-        if( m1>0f || m2>0f || m3>0f || m4>0f ) {
-          info("metrics: cancled: { messages: %,.3f, enqeues: %,.3f }, flushed: { messages: %,.3f, enqeues: %,.3f }",
-            m1, m2, m3, m4 )
-        }
 
-        def displayTime(name:String, counter:TimeCounter) = {
-          var t = counter.apply(true)
-          if( t.count > 0 ) {
-            info("%s latency in ms: avg: %,.3f, min: %,.3f, max: %,.3f", name, t.avgTime(TimeUnit.MILLISECONDS), t.minTime(TimeUnit.MILLISECONDS), t.maxTime(TimeUnit.MILLISECONDS))
-          }
-        }
-        def displayInt(name:String, counter:IntMetricCounter) = {
-          var t = counter.apply(true)
-          if( t.count > 0 ) {
-            info("%s: avg: %,.3f, min: %d, max: %d", name, t.avg, t.min, t.max )
-          }
-        }
-
-        displayTime("commit", commit_latency)
-        displayTime("store", store_latency)
-        displayTime("message load", message_load_latency)
-        displayTime("journal append", client.metric_journal_append)
-        displayTime("index update", client.metric_index_update)
-        displayInt("load batch size", message_load_batch_size)
+        flush_latency = flush_latency_counter(true)
+        message_load_latency = message_load_latency_counter(true)
+        client.metric_journal_append = client.metric_journal_append_counter(true)
+        client.metric_index_update = client.metric_index_update_counter(true)
+        commit_latency = commit_latency_counter(true)
+        message_load_batch_size =  message_load_batch_size_counter(true)
 
-        schedualDisplayStats
+        poll_stats
       }
     }
-    dispatchQueue.dispatchAfter(5, TimeUnit.SECONDS, ^{ displayStats })
+    
+    dispatchQueue.dispatchAfter(1, TimeUnit.SECONDS, ^{ displayStats })
   }
 
   def drain_uows = {
@@ -455,7 +471,7 @@ class HawtDBStore extends Store with Bas
 
       val batch_id = uow.uow_id
       if( uow.delayable ) {
-        dispatchQueue.dispatchAfter(config.flushDelay, TimeUnit.MILLISECONDS, ^{flush(batch_id)})
+        dispatchQueue.dispatchAfter(config.flush_delay, TimeUnit.MILLISECONDS, ^{flush(batch_id)})
       } else {
         flush(batch_id)
       }
@@ -471,7 +487,8 @@ class HawtDBStore extends Store with Bas
   flush_source.setEventHandler(^{drain_flushes});
   flush_source.resume
 
-  val store_latency = new TimeCounter
+  val flush_latency_counter = new TimeCounter
+  var flush_latency = flush_latency_counter(false)
 
   def drain_flushes:Unit = {
 
@@ -493,7 +510,7 @@ class HawtDBStore extends Store with Bas
     }
 
     if( !uows.isEmpty ) {
-      store_latency.start { end=>
+      flush_latency_counter.start { end=>
         executor_pool {
           client.store(uows, ^{
             dispatchQueue {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreBenchmark.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreBenchmark.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreBenchmark.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreBenchmark.scala Wed Jul  7 04:20:53 2010
@@ -26,7 +26,7 @@ class HawtDBStoreBenchmark extends Store
 
   def createStore(flushDelay:Long):Store = {
     val rc = new HawtDBStore
-    rc.config.flushDelay = flushDelay
+    rc.config.flush_delay = flushDelay
     rc
   }
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreTest.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreTest.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreTest.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-hawtdb/src/test/scala/org/apache/activemq/broker/store/hawtdb/HawtDBStoreTest.scala Wed Jul  7 04:20:53 2010
@@ -26,7 +26,7 @@ class HawtDBStoreTest extends StoreFunSu
 
   def createStore(flushDelay:Long):Store = {
     val rc = new HawtDBStore
-    rc.config.flushDelay = flushDelay
+    rc.config.flush_delay = flushDelay
     rc
   }
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompBroker.scala Wed Jul  7 04:20:53 2010
@@ -61,8 +61,8 @@ object StompBroker {
         rc.hosts.add("localhost:9160")
         rc
     }
-    broker.config.virtualHosts.get(0).store = store
-    broker.config.virtualHosts.get(0).purgeOnStartup = purge
+    broker.config.virtual_hosts.get(0).store = store
+    broker.config.virtual_hosts.get(0).purge_on_startup = purge
 
 
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala Wed Jul  7 04:20:53 2010
@@ -74,7 +74,7 @@ class StompHawtDBPersistentBrokerPerfTes
     val store = new HawtDBStoreDTO
     store.directory = new File(new File(testDataDir, getClass.getName), name)
 
-    rc.virtualHosts.get(0).store = store
+    rc.virtual_hosts.get(0).store = store
     rc
   }
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-store/src/main/scala/org/apache/activemq/apollo/store/Store.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-store/src/main/scala/org/apache/activemq/apollo/store/Store.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-store/src/main/scala/org/apache/activemq/apollo/store/Store.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-store/src/main/scala/org/apache/activemq/apollo/store/Store.scala Wed Jul  7 04:20:53 2010
@@ -18,8 +18,8 @@ package org.apache.activemq.broker.store
 
 import org.apache.activemq.apollo.store._
 import org.apache.activemq.apollo.broker.Reporter
-import org.apache.activemq.apollo.dto.StoreDTO
 import org.apache.activemq.apollo.ServiceTrait
+import org.apache.activemq.apollo.dto.{StoreStatusDTO, StoreDTO}
 
 /**
  * <p>
@@ -31,7 +31,7 @@ import org.apache.activemq.apollo.Servic
  */
 trait Store extends ServiceTrait {
 
-  def storeType:String
+  def storeStatusDTO(callback:(StoreStatusDTO)=>Unit)
 
   /**
    * Creates a store uow which is used to perform persistent

Modified: activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java Wed Jul  7 04:20:53 2010
@@ -16,22 +16,19 @@
  */
 package org.apache.activemq.transport.tcp;
 
-import org.apache.activemq.apollo.util.BaseService;
+import org.apache.activemq.apollo.util.JavaBaseService;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportListener;
 import org.apache.activemq.wireformat.WireFormat;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.fusesource.hawtbuf.DataByteArrayOutputStream;
 import org.fusesource.hawtdispatch.Dispatch;
 import org.fusesource.hawtdispatch.DispatchQueue;
 import org.fusesource.hawtdispatch.DispatchSource;
 import org.fusesource.hawtdispatch.Retained;
 
-import java.io.EOFException;
 import java.io.IOException;
 import java.net.*;
-import java.nio.ByteBuffer;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 import java.util.LinkedList;
@@ -42,7 +39,7 @@ import java.util.Map;
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-public class TcpTransport extends BaseService implements Transport {
+public class TcpTransport extends JavaBaseService implements Transport {
 
     private static final Log LOG = LogFactory.getLog(TcpTransport.class);
 

Copied: activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/JavaBaseService.java (from r961208, activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/JavaBaseService.java?p2=activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/JavaBaseService.java&p1=activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.java&r1=961208&r2=961209&rev=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/BaseService.java (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/JavaBaseService.java Wed Jul  7 04:20:53 2010
@@ -28,7 +28,7 @@ import java.util.LinkedList;
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-public abstract class BaseService implements Service {
+public abstract class JavaBaseService implements Service {
 
     public static class State {
         public String toString() {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/TimeCounter.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/TimeCounter.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/TimeCounter.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/util/TimeCounter.scala Wed Jul  7 04:20:53 2010
@@ -31,7 +31,11 @@ class TimeCounter extends MetricProducer
   private var count = 0
 
   def apply(reset: Boolean):TimeMetric = {
-    val rc = TimeMetric(count, total, min, max)
+    val rc = if(count==0) {
+      TimeMetric(0, 0, 0, 0)
+    } else {
+      TimeMetric(count, total, min, max)
+    }
     if (reset) {
       clear()
     }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala Wed Jul  7 04:20:53 2010
@@ -33,6 +33,7 @@ import org.apache.activemq.apollo.broker
 import collection.JavaConversions._
 import com.sun.jersey.api.core.ResourceContext
 import org.fusesource.scalate.RenderContext
+import java.util.concurrent.TimeUnit
 
 /**
  * Defines the default representations to be used on resources
@@ -60,7 +61,23 @@ abstract class Resource(private val pare
 
 }
 
+object ViewHelper {
+
+  val KB: Long = 1024
+  val MB: Long = KB * 1024
+  val GB: Long = MB * 1024
+  val TB: Long = GB * 1024
+
+  val SECONDS: Long = TimeUnit.SECONDS.toMillis(1)
+  val MINUTES: Long = TimeUnit.MINUTES.toMillis(1)
+  val HOURS: Long = TimeUnit.HOURS.toMillis(1)
+  val DAYS: Long = TimeUnit.DAYS.toMillis(1)
+  val YEARS: Long = DAYS * 365
+
+
+}
 class ViewHelper {
+  import ViewHelper._
 
   lazy val uri_info = RenderContext().attribute[UriInfo]("uri_info")
 
@@ -68,6 +85,38 @@ class ViewHelper {
     uri_info.getAbsolutePathBuilder().path(value.toString).build()
   }
 
+  def memory(value:Int):String = memory(value.toLong)
+  def memory(value:Long):String = {
+
+    if( value < KB ) {
+      "%d bytes".format(value)
+    } else if( value < MB ) {
+       "%,.2f kb".format(value.toFloat/KB)
+    } else if( value < GB ) {
+      "%,.3f mb".format(value.toFloat/MB)
+    } else if( value < TB ) {
+      "%,.4f gb".format(value.toDouble/GB)
+    } else {
+      "%,.5f tb".format(value.toDouble/TB)
+    }
+  }
+
+  def uptime(value:Long):String = {
+    val duration = System.currentTimeMillis - value
+    if( duration < SECONDS ) {
+      "%d ms".format(duration)
+    } else if (duration < MINUTES) {
+      "%,.2f seconds".format(duration.toFloat / SECONDS)
+    } else if (duration < HOURS) {
+      "%,.2f minutes".format(duration.toFloat / MINUTES)
+    } else if (duration < DAYS) {
+      "%,.2f hours".format(duration.toFloat / HOURS)
+    } else if (duration < YEARS) {
+      "%,.2f days".format(duration.toDouble / DAYS)
+    } else {
+      "%,.2f years".format(duration.toDouble / YEARS)
+    }
+  }
 }
 
 /**

Modified: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/scala/org/apache/activemq/apollo/web/resources/RuntimeResource.scala Wed Jul  7 04:20:53 2010
@@ -71,13 +71,13 @@ case class RuntimeResource(parent:Broker
       val result = new BrokerStatusDTO
 
       result.id = broker.id
-      result.currentTime = System.currentTimeMillis
+      result.current_time = System.currentTimeMillis
       result.state = broker.serviceState.toString
-      result.stateSince - broker.serviceState.since
+      result.state_since - broker.serviceState.since
       result.config = broker.config
 
       broker.virtualHosts.values.foreach{ host=>
-        result.virtualHosts.add( host.id )
+        result.virtual_hosts.add( host.id )
       }
 
       broker.connectors.foreach{ c=>
@@ -97,7 +97,7 @@ case class RuntimeResource(parent:Broker
 
   @GET @Path("virtual-hosts")
   def virtualHosts :Array[jl.Long] = {
-    val list: List[jl.Long] = get.virtualHosts
+    val list: List[jl.Long] = get.virtual_hosts
     list.toArray(new Array[jl.Long](list.size))
   }
 
@@ -107,13 +107,9 @@ case class RuntimeResource(parent:Broker
       val result = new VirtualHostStatusDTO
       result.id = virtualHost.id
       result.state = virtualHost.serviceState.toString
-      result.stateSince = virtualHost.serviceState.since
+      result.state_since = virtualHost.serviceState.since
       result.config = virtualHost.config
 
-
-      if( virtualHost.store != null ) {
-        result.storeType = virtualHost.store.storeType
-      }
       virtualHost.router.destinations.valuesIterator.foreach { node=>
         val summary = new DestinationSummaryDTO
         summary.id = node.id
@@ -121,8 +117,25 @@ case class RuntimeResource(parent:Broker
         summary.domain = node.destination.getDomain.toString
         result.destinations.add(summary)
       }
-      cb(Some(result))
+
+      if( virtualHost.store != null ) {
+        virtualHost.store.storeStatusDTO { x=>
+          result.store = x
+          cb(Some(result))
+        }
+      } else {
+        cb(Some(result))
+      }
+    }
+  }
+
+  @GET @Path("virtual-hosts/{id}/store")
+  def store(@PathParam("id") id : Long):StoreStatusDTO = {
+    val rc =  virtualHost(id).store
+    if( rc == null ) {
+      result(NOT_FOUND)
     }
+    rc
   }
 
   @GET @Path("virtual-hosts/{id}/destinations/{dest}")
@@ -154,22 +167,22 @@ case class RuntimeResource(parent:Broker
 
             val result = new QueueStatusDTO
             result.id = q.id
-            result.capacityUsed = q.capacity_used
+            result.capacity_used = q.capacity_used
             result.capacity = q.capacity
 
-            result.enqueueItemCounter = q.enqueue_item_counter
-            result.dequeueItemCounter = q.dequeue_item_counter
-            result.enqueueSizeCounter = q.enqueue_size_counter
-            result.dequeueSizeCounter = q.dequeue_size_counter
-            result.nackItemCounter = q.nack_item_counter
-            result.nackSizeCounter = q.nack_size_counter
-
-            result.queueSize = q.queue_size
-            result.queueItems = q.queue_items
-
-            result.loadingSize = q.loading_size
-            result.flushingSize = q.flushing_size
-            result.flushedItems = q.flushed_items
+            result.enqueue_item_counter = q.enqueue_item_counter
+            result.dequeue_item_counter = q.dequeue_item_counter
+            result.enqueue_size_counter = q.enqueue_size_counter
+            result.dequeue_size_counter = q.dequeue_size_counter
+            result.nack_item_counter = q.nack_item_counter
+            result.nack_size_counter = q.nack_size_counter
+
+            result.queue_size = q.queue_size
+            result.queue_items = q.queue_items
+
+            result.loading_size = q.loading_size
+            result.flushing_size = q.flushing_size
+            result.flushed_items = q.flushed_items
 
             if( entries ) {
               var cur = q.head_entry
@@ -179,8 +192,8 @@ case class RuntimeResource(parent:Broker
                 e.seq = cur.seq
                 e.count = cur.count
                 e.size = cur.size
-                e.consumerCount = cur.parked.size
-                e.prefetchCount = cur.prefetched
+                e.consumer_count = cur.parked.size
+                e.prefetch_count = cur.prefetched
                 e.state = cur.label
 
                 result.entries.add(e)
@@ -218,7 +231,7 @@ case class RuntimeResource(parent:Broker
           val result = new ConnectorStatusDTO
           result.id = connector.id
           result.state = connector.serviceState.toString
-          result.stateSince = connector.serviceState.since
+          result.state_since = connector.serviceState.since
           result.config = connector.config
 
           result.accepted = connector.accept_counter.get
@@ -255,14 +268,14 @@ case class RuntimeResource(parent:Broker
             val result = new ConnectionStatusDTO
             result.id = connection.id
             result.state = connection.serviceState.toString
-            result.stateSince = connection.serviceState.since
+            result.state_since = connection.serviceState.since
             result.protocol = connection.protocol
             result.transport = connection.transport.getTypeId
-            result.remoteAddress = connection.transport.getRemoteAddress
+            result.remote_address = connection.transport.getRemoteAddress
             val wf = connection.transport.getWireformat
             if( wf!=null ) {
-              result.writeCounter = wf.getWriteCounter
-              result.readCounter = wf.getReadCounter
+              result.write_counter = wf.getWriteCounter
+              result.read_counter = wf.getReadCounter
             }
             cb(Some(result))
           }

Modified: activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.scaml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.scaml?rev=961209&r1=961208&r2=961209&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.scaml (original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/BrokerStatusDTO.scaml Wed Jul  7 04:20:53 2010
@@ -2,11 +2,11 @@
 - val helper = new org.apache.activemq.apollo.web.resources.ViewHelper
 - import helper._
 
-%p state: #{state} since: #{ new java.util.Date(stateSince) }
+%p state: #{state} for #{ uptime(state_since) }
 
 %h2 Virtual Hosts
 %ul
-  - for( x <- virtualHosts )
+  - for( x <- virtual_hosts )
     %li
       %a(href="runtime/virtual-hosts/#{x}") #{x}
 



Mime
View raw message