activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r473056 - in /incubator/activemq/trunk/activemq-web-console/src/main: java/org/apache/activemq/web/controller/PurgeDestination.java webapp/WEB-INF/dispatcher-servlet.xml webapp/queues.jsp webapp/xml/queues.jsp
Date Thu, 09 Nov 2006 20:12:30 GMT
Author: aco
Date: Thu Nov  9 12:12:29 2006
New Revision: 473056

URL: http://svn.apache.org/viewvc?view=rev&rev=473056
Log:
https://issues.apache.org/activemq/browse/AMQ-1036
- Fix some browsing problems in the web console.
- Added a purge queue action.

Added:
    incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
  (with props)
Modified:
    incubator/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    incubator/activemq/trunk/activemq-web-console/src/main/webapp/queues.jsp
    incubator/activemq/trunk/activemq-web-console/src/main/webapp/xml/queues.jsp

Added: incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java?view=auto&rev=473056
==============================================================================
--- incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
(added)
+++ incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
Thu Nov  9 12:12:29 2006
@@ -0,0 +1,59 @@
+/**
+ *
+ * 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.web.controller;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.region.Queue;
+import org.apache.activemq.web.DestinationFacade;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.Controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ *
+ * @version $Revision$
+ */
+public class PurgeDestination extends DestinationFacade implements Controller {
+
+    public PurgeDestination(BrokerService brokerService) {
+        super(brokerService);
+    }
+
+    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws Exception {
+        purgeDestination();
+        return redirectToBrowseView();
+    }
+
+    public void purgeDestination() throws Exception {
+        if (isQueue()) {
+            Set destinations = getManagedBroker().getQueueRegion().getDestinations(createDestination());
+            for (Iterator i=destinations.iterator(); i.hasNext();) {
+                Queue regionQueue = (Queue)i.next();
+                regionQueue.purge();
+            }
+        }
+        else {
+            throw new UnsupportedOperationException("Purge supported for queues only. Receieved
JMSDestinationType=" + getJMSDestinationType());
+        }
+    }
+}
+

Propchange: incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/controller/PurgeDestination.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml?view=diff&rev=473056&r1=473055&r2=473056
==============================================================================
--- incubator/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
(original)
+++ incubator/activemq/trunk/activemq-web-console/src/main/webapp/WEB-INF/dispatcher-servlet.xml
Thu Nov  9 12:12:29 2006
@@ -31,6 +31,7 @@
   <bean name="/createSubscriber.action" class="org.apache.activemq.web.controller.CreateSubscriber"
autowire="constructor"  singleton="false"/>
   <bean name="/deleteSubscriber.action" class="org.apache.activemq.web.controller.DeleteSubscriber"
autowire="constructor"  singleton="false"/>
   <bean name="/sendMessage.action" class="org.apache.activemq.web.controller.SendMessage"
autowire="constructor"  singleton="false"/>
+  <bean name="/purgeDestination.action" class="org.apache.activemq.web.controller.PurgeDestination"
autowire="constructor"  singleton="false"/>
   
   <!--
     - This bean resolves specific types of exception to corresponding error views.

Modified: incubator/activemq/trunk/activemq-web-console/src/main/webapp/queues.jsp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-web-console/src/main/webapp/queues.jsp?view=diff&rev=473056&r1=473055&r2=473056
==============================================================================
--- incubator/activemq/trunk/activemq-web-console/src/main/webapp/queues.jsp (original)
+++ incubator/activemq/trunk/activemq-web-console/src/main/webapp/queues.jsp Thu Nov  9 12:12:29
2006
@@ -54,10 +54,10 @@
 <c:forEach items="${requestContext.brokerQuery.queues}" var="row">
 <tr>
 <td><a href="browse.jsp?JMSDestination=${row.name}">${row.name}</a></td>
-<td>${row.queueSize}</td>
-<td>${row.consumerCount}</td>
-<td>${row.enqueueCount}</td>
-<td>${row.dequeueCount}</td>
+<td>${row.destinationStatistics.messages.count}</td>
+<td>${row.destinationStatistics.consumers.count}</td>
+<td>${row.destinationStatistics.enqueues.count}</td>
+<td>${row.destinationStatistics.dequeues.count}</td>
 <td>
     <a href="browse.jsp?JMSDestination=${row.name}">Browse</a>
 <%--    

Modified: incubator/activemq/trunk/activemq-web-console/src/main/webapp/xml/queues.jsp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-web-console/src/main/webapp/xml/queues.jsp?view=diff&rev=473056&r1=473055&r2=473056
==============================================================================
--- incubator/activemq/trunk/activemq-web-console/src/main/webapp/xml/queues.jsp (original)
+++ incubator/activemq/trunk/activemq-web-console/src/main/webapp/xml/queues.jsp Thu Nov 
9 12:12:29 2006
@@ -19,7 +19,11 @@
 <c:forEach items="${requestContext.brokerQuery.queues}" var="row">
 <queue name="${row.name}">
 
-  <stats size="${row.queueSize}" consumerCount="${row.consumerCount}" enqueueCount="${row.enqueueCount}"
dequeueCount="${row.dequeueCount}"/>
+  <stats size="${row.destinationStatistics.messages.count}"
+         consumerCount="${row.destinationStatistics.consumers.count}"
+         enqueueCount="${row.destinationStatistics.enqueues.count}"
+         dequeueCount="${row.destinationStatistics.dequeues.count}"/>
+
 
   <feed>
     <atom><c:url value="queueBrowse/${row.name}?view=rss&amp;feedType=atom_1.0"/></atom>



Mime
View raw message