mbeanServer.invoke(objectName, "sendMessage", new Object[] {"Test"}, new String[] {"java.lang.String"});
Thread.sleep(1000);
List<String> msgs = (List<String>)mbeanServer.invoke(objectName, "readMessages", new Object[] {"Test"}, new String[] {"java.lang.String"});
System.out.println("Received messages: " + msgs);
} finally {
utils.undeploy();
safeClose(utils);
}
}
}