use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerManagerMonitor method getNumWildcardProducers.
public Integer getNumWildcardProducers(String wildcard) throws MBeanException {
int numWildcardProducers = Producer.getNumWildcardProducers();
if (numWildcardProducers <= 0) {
return (Integer.valueOf(0));
}
Iterator producers = Producer.getWildcardProducers();
if (producers == null) {
return (Integer.valueOf(0));
}
int count = 0;
while (producers.hasNext()) {
ProducerUID pid = (ProducerUID) producers.next();
Producer oneProd = (Producer) Producer.getProducer(pid);
/*
* 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));
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getConnectionUID.
public static ConnectionUID getConnectionUID(ProducerUID pid) {
Producer p = (Producer) Producer.getProducer(pid);
ConnectionUID cxnId;
if (p == null) {
return (null);
}
cxnId = p.getConnectionUID();
return (cxnId);
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getDestinationNames.
private static String[] getDestinationNames(ProducerUID pid) {
Producer p = (Producer) Producer.getProducer(pid);
String[] ret = null;
if (p == null) {
return (null);
}
ArrayList<String> al = new ArrayList<>();
Set dests = p.getDestinations();
Iterator itr = dests.iterator();
while (itr.hasNext()) {
DestinationUID duid = (DestinationUID) itr.next();
al.add(duid.getName());
}
if (al.size() > 0) {
ret = new String[al.size()];
ret = al.toArray(ret);
}
return (ret);
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getServiceName.
public static String getServiceName(ProducerUID pid) {
Producer p = (Producer) Producer.getProducer(pid);
ConnectionUID cxnId = null;
if (p == null) {
return (null);
}
cxnId = p.getConnectionUID();
if (cxnId == null) {
return (null);
}
return (ConnectionUtil.getServiceOfConnection(cxnId.longValue()));
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getUser.
public static String getUser(ProducerUID pid) {
Producer p = (Producer) Producer.getProducer(pid);
ConnectionUID cxnId = null;
if (p == null) {
return (null);
}
cxnId = p.getConnectionUID();
if (cxnId == null) {
return (null);
}
ConnectionInfo cxnInfo = ConnectionUtil.getConnectionInfo(cxnId.longValue());
return (cxnInfo.user);
}
Aggregations