1 18 package org.apache.activemq.web.controller; 19 20 import org.apache.activemq.web.BrokerFacade; 21 import org.apache.activemq.web.DestinationFacade; 22 import org.springframework.web.servlet.ModelAndView; 23 import org.springframework.web.servlet.mvc.Controller; 24 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 28 32 public class PurgeDestination extends DestinationFacade implements Controller { 33 34 public PurgeDestination(BrokerFacade brokerFacade) { 35 super(brokerFacade); 36 } 37 38 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { 39 purgeDestination(); 40 return redirectToBrowseView(); 41 } 42 43 public void purgeDestination() throws Exception { 44 if (isQueue()) { 45 getBrokerFacade().purgeQueue(createDestination()); 46 } 47 else { 48 throw new UnsupportedOperationException ("Purge supported for queues only. Receieved JMSDestinationType=" + getJMSDestinationType()); 49 } 50 } 51 } 52 53 | Popular Tags |