use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class DestinationMonitor method getProducerWildcards.
public String[] getProducerWildcards() throws MBeanException {
ArrayList<String> al = new ArrayList<>();
String[] list = null;
int numProducers = getNumProducers().intValue();
Iterator producers;
if (numProducers <= 0) {
return (null);
}
producers = d.getProducers();
while (producers.hasNext()) {
ProducerSpi oneProd = (ProducerSpi) producers.next();
if (oneProd.isWildcard()) {
DestinationUID id = oneProd.getDestinationUID();
al.add(id.getName());
}
}
if (al.size() > 0) {
list = new String[al.size()];
list = al.toArray(list);
}
return (list);
}
use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class DestinationMonitor method getWildcards.
public String[] getWildcards() throws MBeanException {
ArrayList<String> al = new ArrayList<>();
String[] list = null;
int numConsumers = getNumConsumers().intValue(), numProducers = getNumProducers().intValue();
if (numConsumers > 0) {
Iterator consumers = d.getConsumers();
while (consumers.hasNext()) {
Consumer oneCon = (Consumer) consumers.next();
if (oneCon.isWildcard()) {
DestinationUID id = oneCon.getDestinationUID();
al.add(id.getName());
}
}
}
if (numProducers > 0) {
Iterator producers = d.getProducers();
while (producers.hasNext()) {
ProducerSpi oneProd = (ProducerSpi) producers.next();
if (oneProd.isWildcard()) {
DestinationUID id = oneProd.getDestinationUID();
al.add(id.getName());
}
}
}
if (al.size() > 0) {
list = new String[al.size()];
list = al.toArray(list);
}
return (list);
}
use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class DestinationMonitor method getProducerIDs.
public String[] getProducerIDs() throws MBeanException {
int numProducers = getNumProducers().intValue();
String[] ids;
Iterator producers;
if (numProducers <= 0) {
return (null);
}
producers = d.getProducers();
ids = new String[numProducers];
int i = 0;
while (producers.hasNext()) {
ProducerSpi oneProd = (ProducerSpi) producers.next();
long prodID = oneProd.getProducerUID().longValue();
try {
ids[i] = Long.toString(prodID);
} catch (Exception ex) {
handleOperationException(DestinationOperations.GET_PRODUCER_IDS, ex);
}
i++;
}
return (ids);
}
use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class DestinationMonitor method getNumWildcards.
public Integer getNumWildcards() throws MBeanException {
int numConsumers = getNumConsumers().intValue();
int numProducers = getNumProducers().intValue();
int count = 0;
if (numConsumers > 0) {
Iterator consumers = d.getConsumers();
while (consumers.hasNext()) {
Consumer oneCon = (Consumer) consumers.next();
if (oneCon.isWildcard()) {
++count;
}
}
}
if (numProducers > 0) {
Iterator producers = d.getProducers();
while (producers.hasNext()) {
ProducerSpi oneProd = (ProducerSpi) producers.next();
if (oneProd.isWildcard()) {
++count;
}
}
}
return (Integer.valueOf(count));
}
use of com.sun.messaging.jmq.jmsserver.plugin.spi.ProducerSpi in project openmq by eclipse-ee4j.
the class IMQConnection method cleanUpProducers.
/**
* called when the connection is closed
*/
private void cleanUpProducers() {
if (Globals.getMemManager() != null) {
Globals.getMemManager().removeProducer(producers.size());
}
synchronized (producers) {
Iterator itr = producers.values().iterator();
while (itr.hasNext()) {
ProducerSpi p = (ProducerSpi) itr.next();
if (coreLifecycle != null) {
coreLifecycle.destroyProducer(p.getProducerUID(), "cleanup of connection " + this);
} else {
Producer.destroyProducer(p.getProducerUID(), "cleanup of connection " + this);
}
itr.remove();
}
}
}
Aggregations