activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1371265 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/ apollo-dto...
Date Thu, 09 Aug 2012 15:57:48 GMT
Author: chirino
Date: Thu Aug  9 15:57:47 2012
New Revision: 1371265

URL: http://svn.apache.org/viewvc?rev=1371265&view=rev
Log:
Fixes APLO-235: Invalid apollo.xsd

I had mistakenly left some unstable DTO classes as part of the apollo-dto module.  Moved them
to the apollo-network module.

Added:
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/ConsumerLoadDTO.java
      - copied, changed from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConsumerLoadDTO.java
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java
      - copied, changed from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationLoadDTO.java
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java
      - copied, changed from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/LoadStatusDTO.java
Removed:
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConsumerLoadDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationLoadDTO.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/LoadStatusDTO.java
Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
    activemq/activemq-apollo/trunk/apollo-network/src/main/resources/org/apache/activemq/apollo/broker/network/dto/jaxb.index
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerLoadMonitor.scala
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerMetrics.scala
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala
    activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Thu Aug  9 15:57:47 2012
@@ -302,30 +302,6 @@ class Queue(val router: LocalRouter, val
     rc
   }
 
-  def load_status = {
-    val rc = new DestinationLoadDTO
-    rc.id = this.id
-    rc.message_count = queue_size
-    rc.message_size = queue_items
-    rc.message_count_enqueue_counter = enqueue_item_counter
-    rc.message_size_enqueue_counter = enqueue_size_counter
-    rc.message_count_dequeue_counter = dequeue_item_counter
-    rc.message_size_dequeue_counter = dequeue_size_counter
-
-    for( sub <- all_subscriptions.values ) {
-      val dto = new ConsumerLoadDTO
-      dto.user = sub.consumer.user
-      dto.selector = sub.consumer.jms_selector
-      sub.ack_rates match {
-        case Some((items_per_sec, size_per_sec) ) =>
-          dto.ack_item_rate = items_per_sec
-          dto.ack_size_rate = size_per_sec
-        case _ =>
-      }
-      rc.consumers.add(dto)
-    }
-    rc
-  }
   def status(entries:Boolean=false) = {
     val rc = new QueueStatusDTO
     rc.id = this.id

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/org/apache/activemq/apollo/dto/jaxb.index
Thu Aug  9 15:57:47 2012
@@ -22,8 +22,6 @@ AggregateDestMetricsDTO
 AuthenticationDTO
 AutoGCServiceDTO
 BrokerDTO
-LoadStatusDTO
-BrokerStatusDTO
 ConnectionStatusDTO
 ConnectorStatusDTO
 ConnectorTypeDTO
@@ -31,7 +29,6 @@ CustomServiceDTO
 DataPageDTO
 DestMetricsDTO
 DestinationDTO
-DestinationLoadDTO
 DetectDTO
 DurableSubscriptionDTO
 DurableSubscriptionDestinationDTO

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
(original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/test/resources/org/apache/activemq/apollo/dto/XmlCodecTest.xml
Thu Aug  9 15:57:47 2012
@@ -17,12 +17,11 @@
 -->
 <broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
 
-  <access_rule principal="hiram" action="admin"/>
-  <access_rule principal="james" action="admin"/>
-  <access_rule principal="admins" action="admin"/>
+  <access_rule allow="hiram" action="admin"/>
+  <access_rule allow="james" action="admin"/>
+  <access_rule allow="admins" action="admin"/>
 
   <virtual_host id="vh-local">
-    <acl/>
     <host_name>localhost</host_name>
     <host_name>example.com</host_name>
 

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/resources/org/apache/activemq/apollo/broker/network/dto/jaxb.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/resources/org/apache/activemq/apollo/broker/network/dto/jaxb.index?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/resources/org/apache/activemq/apollo/broker/network/dto/jaxb.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/resources/org/apache/activemq/apollo/broker/network/dto/jaxb.index
Thu Aug  9 15:57:47 2012
@@ -18,4 +18,5 @@ NetworkManagerDTO
 BridgeDTO
 MembershipMonitorDTO
 JVMMembershipMonitorDTO
-ZeroconfMembershipMonitorDTO
\ No newline at end of file
+ZeroconfMembershipMonitorDTO
+LoadStatusDTO
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerLoadMonitor.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerLoadMonitor.scala?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerLoadMonitor.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerLoadMonitor.scala
Thu Aug  9 15:57:47 2012
@@ -16,7 +16,8 @@
  */
 package org.apache.activemq.apollo.broker.network
 
-import org.apache.activemq.apollo.dto.{LoadStatusDTO, JsonCodec}
+import dto.LoadStatusDTO
+import org.apache.activemq.apollo.dto.JsonCodec
 import dto.ClusterMemberDTO
 import org.fusesource.hawtdispatch._
 import collection.mutable.HashMap

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerMetrics.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerMetrics.scala?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerMetrics.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/BrokerMetrics.scala
Thu Aug  9 15:57:47 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq.apollo.broker.network
 
-import org.apache.activemq.apollo.dto.LoadStatusDTO
+import dto.LoadStatusDTO
 import org.apache.commons.math.stat.descriptive.DescriptiveStatistics
 import collection.mutable.HashMap
 

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/NetworkManager.scala
Thu Aug  9 15:57:47 2012
@@ -18,11 +18,11 @@ package org.apache.activemq.apollo.broke
 
 import org.apache.activemq.apollo.util._
 import org.fusesource.hawtdispatch._
-import org.apache.activemq.apollo.broker.network.dto._
+import dto._
 import CollectionsSupport._
 import java.util.concurrent.TimeUnit._
 import collection.mutable.{LinkedHashMap, HashSet, ListBuffer, HashMap}
-import org.apache.activemq.apollo.dto.{LoadStatusDTO, CustomServiceDTO}
+import org.apache.activemq.apollo.dto.CustomServiceDTO
 import org.apache.activemq.apollo.broker.{AcceptingConnector, VirtualHost, Broker, CustomServiceFactory}
 import java.net.InetSocketAddress
 

Copied: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/ConsumerLoadDTO.java
(from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConsumerLoadDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/ConsumerLoadDTO.java?p2=activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/ConsumerLoadDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConsumerLoadDTO.java&r1=1371252&r2=1371265&rev=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ConsumerLoadDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/ConsumerLoadDTO.java
Thu Aug  9 15:57:47 2012
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.broker.network.dto;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 
@@ -30,7 +30,7 @@ import java.util.HashSet;
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-@XmlRootElement(name="destination_load")
+@XmlRootElement(name="consumer_load")
 @XmlAccessorType(XmlAccessType.FIELD)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class ConsumerLoadDTO {

Copied: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java
(from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationLoadDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java?p2=activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationLoadDTO.java&r1=1371252&r2=1371265&rev=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DestinationLoadDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/DestinationLoadDTO.java
Thu Aug  9 15:57:47 2012
@@ -15,14 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.broker.network.dto;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 
 import javax.xml.bind.annotation.*;
 import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
 
 /**
  * The

Copied: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java
(from r1371252, activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/LoadStatusDTO.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java?p2=activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/LoadStatusDTO.java&r1=1371252&r2=1371265&rev=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/LoadStatusDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/dto/LoadStatusDTO.java
Thu Aug  9 15:57:47 2012
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.dto;
+package org.apache.activemq.apollo.broker.network.dto;
 
+import org.apache.activemq.apollo.broker.network.dto.DestinationLoadDTO;
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 
 import javax.xml.bind.annotation.*;

Modified: activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala?rev=1371265&r1=1371264&r2=1371265&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-network/src/main/scala/org/apache/activemq/apollo/broker/network/web/NetworkWebModule.scala
Thu Aug  9 15:57:47 2012
@@ -23,10 +23,9 @@ import javax.ws.rs.{PathParam, Produces,
 import scala.Array
 import javax.ws.rs.core.MediaType._
 import com.wordnik.swagger.core.{Api, ApiOperation}
-import org.apache.activemq.apollo.dto.{DestinationLoadDTO, LoadStatusDTO}
-import org.apache.activemq.apollo.broker.LocalRouter
+import org.apache.activemq.apollo.broker.network.dto.{LoadStatusDTO, ConsumerLoadDTO, DestinationLoadDTO}
+import org.apache.activemq.apollo.broker.{Queue, LocalRouter}
 import org.fusesource.hawtdispatch.Future
-import scala.Predef._
 import org.apache.activemq.apollo.util.{FutureResult, Success}
 import FutureResult._
 
@@ -74,7 +73,7 @@ case class NetworkResourceJSON() extends
       val queue_loads = Future.all {
         router.local_queue_domain.destination_by_id.values.map { value  =>
           monitoring[DestinationLoadDTO](value) {
-            value.load_status
+            load_status(value)
           }
         }
       }
@@ -88,4 +87,29 @@ case class NetworkResourceJSON() extends
     }
   }
 
+  def load_status(queue:Queue) = {
+    val rc = new DestinationLoadDTO
+    rc.id = queue.id
+    rc.message_count = queue.queue_size
+    rc.message_size = queue.queue_items
+    rc.message_count_enqueue_counter = queue.enqueue_item_counter
+    rc.message_size_enqueue_counter = queue.enqueue_size_counter
+    rc.message_count_dequeue_counter = queue.dequeue_item_counter
+    rc.message_size_dequeue_counter = queue.dequeue_size_counter
+
+    for( sub <- queue.all_subscriptions.values ) {
+      val dto = new ConsumerLoadDTO
+      dto.user = sub.consumer.user
+      dto.selector = sub.consumer.jms_selector
+      sub.ack_rates match {
+        case Some((items_per_sec, size_per_sec) ) =>
+          dto.ack_item_rate = items_per_sec
+          dto.ack_size_rate = size_per_sec
+        case _ =>
+      }
+      rc.consumers.add(dto)
+    }
+    rc
+  }
+
 }



Mime
View raw message