activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r399298 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: jmx/DestinationView.java region/Destination.java region/Queue.java region/Topic.java
Date Wed, 03 May 2006 13:38:28 GMT
Author: jstrachan
Date: Wed May  3 06:38:26 2006
New Revision: 399298

URL: http://svn.apache.org/viewcvs?rev=399298&view=rev
Log:
added helper methods to Destination POJOs so the MBeans are not required

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java?rev=399298&r1=399297&r2=399298&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
Wed May  3 06:38:26 2006
@@ -46,46 +46,48 @@
     }
 
     
-    public void gc(){
+    public void gc() {
         destination.gc();
     }
 
     public String getName() {
-        return destination.getActiveMQDestination().getPhysicalName();
+        return destination.getName();
     }
 
-    public void resetStatistics(){
-        destination.getDestinationStatistics().reset();
+    public void resetStatistics() {
+        destination.resetStatistics();
     }
 
-    public long getEnqueueCount(){
-        return destination.getDestinationStatistics().getEnqueues().getCount();
+    public long getEnqueueCount() {
+        return destination.getEnqueueCount();
     }
 
-    public long getDequeueCount(){
-        return destination.getDestinationStatistics().getDequeues().getCount();
+    public long getDequeueCount() {
+        return destination.getDequeueCount();
     }
 
-    public long getConsumerCount(){
-        return destination.getDestinationStatistics().getConsumers().getCount();
+    public long getConsumerCount() {
+        return destination.getConsumerCount();
     }
 
-    public long getQueueSize(){
-        return destination.getDestinationStatistics().getMessages().getCount();
+    public long getQueueSize() {
+        return destination.getQueueSize();
     }
 
-    public long getMessagesCached(){
-        return destination.getDestinationStatistics().getMessagesCached().getCount();
+    public long getMessagesCached() {
+        return destination.getMessagesCached();
     }
 
     public int getMemoryPercentageUsed() {
-        return destination.getUsageManager().getPercentUsage();
+        return destination.getMemoryPercentageUsed();
     }
+
     public long getMemoryLimit() {
-        return destination.getUsageManager().getLimit();
+        return destination.getMemoryLimit();
     }
+
     public void setMemoryLimit(long limit) {
-        destination.getUsageManager().setLimit(limit);
+        destination.setMemoryLimit(limit);
     }
 
     public CompositeData[] browse() throws OpenDataException{

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java?rev=399298&r1=399297&r2=399298&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
Wed May  3 06:38:26 2006
@@ -54,4 +54,15 @@
     DeadLetterStrategy getDeadLetterStrategy();
     
     public Message[] browse();
+    
+    public void resetStatistics();
+    public String getName();
+    public long getEnqueueCount();
+    public long getDequeueCount();
+    public long getConsumerCount();
+    public long getQueueSize();
+    public long getMessagesCached();
+    public int getMemoryPercentageUsed();
+    public long getMemoryLimit();
+    public void setMemoryLimit(long limit);
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=399298&r1=399297&r2=399298&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Wed May  3 06:38:26 2006
@@ -391,7 +391,48 @@
     public void setMessageGroupHashBucketCount(int messageGroupHashBucketCount) {
         this.messageGroupHashBucketCount = messageGroupHashBucketCount;
     }
+    
+    public void resetStatistics() {
+        getDestinationStatistics().reset();
+    }
 
+    public String getName() {
+        return getActiveMQDestination().getPhysicalName();
+    }
+
+    public long getEnqueueCount() {
+        return getDestinationStatistics().getEnqueues().getCount();
+    }
+
+    public long getDequeueCount() {
+        return getDestinationStatistics().getDequeues().getCount();
+    }
+
+    public long getConsumerCount() {
+        return getDestinationStatistics().getConsumers().getCount();
+    }
+
+    public long getQueueSize() {
+        return getDestinationStatistics().getMessages().getCount();
+    }
+
+    public long getMessagesCached() {
+        return getDestinationStatistics().getMessagesCached().getCount();
+    }
+
+    public int getMemoryPercentageUsed() {
+        return getUsageManager().getPercentUsage();
+    }
+
+    public long getMemoryLimit() {
+        return getUsageManager().getLimit();
+    }
+
+    public void setMemoryLimit(long limit) {
+        getUsageManager().setLimit(limit);
+    }
+    
+    
     // Implementation methods
     // -------------------------------------------------------------------------
     private MessageReference createMessageReference(Message message) {

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?rev=399298&r1=399297&r2=399298&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Wed May  3 06:38:26 2006
@@ -379,6 +379,47 @@
         this.deadLetterStrategy = deadLetterStrategy;
     }
 
+    public void resetStatistics(){
+        getDestinationStatistics().reset();
+    }
+
+    public String getName() {
+        return getActiveMQDestination().getPhysicalName();
+    }
+
+    public long getEnqueueCount() {
+        return getDestinationStatistics().getEnqueues().getCount();
+    }
+
+    public long getDequeueCount() {
+        return getDestinationStatistics().getDequeues().getCount();
+    }
+
+    public long getConsumerCount() {
+        return getDestinationStatistics().getConsumers().getCount();
+    }
+
+    public long getQueueSize() {
+        return getDestinationStatistics().getMessages().getCount();
+    }
+
+    public long getMessagesCached() {
+        return getDestinationStatistics().getMessagesCached().getCount();
+    }
+
+    public int getMemoryPercentageUsed() {
+        return getUsageManager().getPercentUsage();
+    }
+
+    public long getMemoryLimit() {
+        return getUsageManager().getLimit();
+    }
+
+    public void setMemoryLimit(long limit) {
+        getUsageManager().setLimit(limit);
+    }
+    
+    
     // Implementation methods
     // -------------------------------------------------------------------------
     protected void dispatch(ConnectionContext context, Message message) throws Exception
{



Mime
View raw message