use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class DestinationMonitor method getNumWildcardProducers.
public Integer getNumWildcardProducers(String wildcard) throws MBeanException {
int numProducers = getNumProducers().intValue();
if (numProducers <= 0) {
return (Integer.valueOf(0));
}
Iterator producers = d.getProducers();
if (producers == null) {
return (Integer.valueOf(0));
}
int count = 0;
while (producers.hasNext()) {
ProducerSpi oneProd = (ProducerSpi) producers.next();
if (oneProd.isWildcard()) {
/*
* If wildcard param is not null, check for matches If it is null, return total count of wildcards
*/
if (wildcard != null) {
DestinationUID id = oneProd.getDestinationUID();
if (id.getName().equals(wildcard)) {
count++;
}
} else {
count++;
}
}
}
return (Integer.valueOf(count));
}
Aggregations