*/
public void flushJMSDestination(String destName, String destType, String tgtName)
throws JMSAdminException {
// check and use JMX
try {
Target target = getResourceTarget(tgtName);
if (JMSDestination.useJMX(target)) {
JMSDestination jmsd = new JMSDestination();
if (isClustered(tgtName)) {
/* The MQ 4.1 JMX Apis do not clean up all
* the destintations in all the instances
* in a broker cluster, in other words, JMX
* operation purge is not cluster aware
* So we have to ensure that we purge each instance
* in the cluster one by one.
* If one of them fail just log and proceed, we will
* flag an error towards the end. Issue 6523135
* This works because we resolve the port numbers
* even for standalone instances in MQAddressList.
*/
boolean success = true;
Server [] servers = target.getServers();
for (int server = 0; server < servers.length; server++) {
try {
jmsd.purgeJMSDestination(destName, destType, servers[server].getName());
} catch (Exception e) {
success = false;