git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1430862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2013-01-09 13:53:12 +00:00
parent 8ab1c8d551
commit 881c1b7005
3 changed files with 5 additions and 3 deletions

View File

@ -57,7 +57,7 @@ public class ListCommand extends AbstractJmxCommand {
protected void runTask(List tokens) throws Exception {
try {
Set<String> propsView = new HashSet<String>();
propsView.add("BrokerName");
propsView.add("brokerName");
context.printMBean(JmxMBeansUtil.filterMBeansView(JmxMBeansUtil.getAllBrokers(createJmxConnection()), propsView));
} catch (Exception e) {
context.printException(new RuntimeException("Failed to execute list task. Reason: " + e));

View File

@ -96,7 +96,7 @@ public class PurgeCommand extends AbstractJmxCommand {
// Iterate through the queue names
for (Iterator<String> i = tokens.iterator(); i.hasNext();) {
List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "Type=Queue,Destination=" + i.next() + ",*");
List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "destinationType=Queue,destinationName=" + i.next() + ",*");
for (Iterator j = queueList.iterator(); j.hasNext();) {
ObjectName queueName = ((ObjectInstance)j.next()).getObjectName();
@ -150,7 +150,7 @@ public class PurgeCommand extends AbstractJmxCommand {
* @throws Exception
*/
public void purgeQueue(ObjectName queue) throws Exception {
context.printInfo("Purging all messages in queue: " + queue.getKeyProperty("Destination"));
context.printInfo("Purging all messages in queue: " + queue.getKeyProperty("destinationName"));
createJmxConnection().invoke(queue, "purge", new Object[] {}, new String[] {});
}

View File

@ -71,6 +71,8 @@ public class MBeansObjectNameQueryFilter extends AbstractQueryFilter {
if (pos >= 0) {
val = key.substring(pos + 1);
key = key.substring(0, pos);
} else {
objNameQuery += delimiter + key;
}
if (val.startsWith(QUERY_EXP_PREFIX)) {