Package org.apache.activemq.broker.jmx

Examples of org.apache.activemq.broker.jmx.QueueViewMBean.purge()


        createProducerAndSendMessages(90000);
        QueueViewMBean proxy = getProxyToQueueViewMBean();
        createConsumer();
        long start = System.currentTimeMillis();
        LOG.info("purging..");
        proxy.purge();
        LOG.info("purge done: " + (System.currentTimeMillis() - start) + "ms");
        assertEquals("Queue size is not zero, it's " + proxy.getQueueSize(), 0,
                proxy.getQueueSize());
    }
View Full Code Here


    return brokers;
  }
 
  public void purgeQueue(ActiveMQDestination destination) throws Exception {
    QueueViewMBean queue = getQueue(destination.getPhysicalName());
    queue.purge();
  }
 
  public ManagementContext getManagementContext() {
    throw new IllegalStateException("not supported");
  }
View Full Code Here

    return masterBrokers;
  }
 
  public void purgeQueue(ActiveMQDestination destination) throws Exception {
    QueueViewMBean queue = getQueue(destination.getPhysicalName());
    queue.purge();
  }
 
  public ManagementContext getManagementContext() {
    throw new IllegalStateException("not supported");
  }
View Full Code Here

        Level level = log4jLogger.getLevel();
        log4jLogger.setLevel(Level.INFO);
        log4jLogger.addAppender(appender);
        try {

            proxy.purge();

        } finally {
            log4jLogger.setLevel(level);
            log4jLogger.removeAppender(appender);
        }
View Full Code Here

        createProducerAndSendMessages(NUM_TO_SEND);
        QueueViewMBean proxy = getProxyToQueueViewMBean();
        createConsumer();
        long start = System.currentTimeMillis();
        LOG.info("purging..");
        proxy.purge();
        LOG.info("purge done: " + (System.currentTimeMillis() - start) + "ms");
        assertEquals("Queue size is not zero, it's " + proxy.getQueueSize(), 0,
                proxy.getQueueSize());
        assertEquals("usage goes to duck", 0, proxy.getMemoryPercentUsage());
        Message msg;
View Full Code Here

    private void purge() throws Exception {
        ObjectName[] queues = brokerService.getAdminView().getQueues();
        if (queues.length == 1) {
            QueueViewMBean queueViewMBean = (QueueViewMBean)
                brokerService.getManagementContext().newProxyInstance(queues[0], QueueViewMBean.class, false);
            queueViewMBean.purge();
        }
    }

    @Test
    @Ignore("comparison test - takes too long and really needs a peek at the graph")
View Full Code Here

                    }
                    BrokerViewMBean brokerMBean = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(server, brokerObjectName, BrokerViewMBean.class, true);
                    brokerMBean.addQueue(destinationInfo.getPhysicalName());
                }
                proxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(server, destinationObjectName, QueueViewMBean.class, true);
                proxy.purge();
            } else {
                throw new JMSException("Purge action on topic is not supported");
            }
        } catch (MalformedObjectNameException e) {
            throw createJMSException("Fail to find the target object name", e);
View Full Code Here

        return brokers;
    }

    public void purgeQueue(ActiveMQDestination destination) throws Exception {
        QueueViewMBean queue = getQueue(destination.getPhysicalName());
        queue.purge();
    }

    public ManagementContext getManagementContext() {
        throw new IllegalStateException("not supported");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.