use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerHandler method removeProducer.
public void removeProducer(ProducerUID pid, boolean isIndemp, IMQConnection con, String msg) throws BrokerException {
String reason = null;
int status = Status.OK;
Producer p = (Producer) Producer.getProducer(pid);
if (p == null && isIndemp) {
// dont flag error, we already processed it
} else if (p == null) {
logger.log(Logger.INFO, BrokerResources.E_INTERNAL_BROKER_ERROR, "Internal error Unable to find producer " + pid + "\n\t checking if producer was removed recently " + Producer.checkProducer(pid));
reason = "unknown producer";
status = Status.ERROR;
throw new BrokerException(reason, status);
} else if (p.getConnectionUID() != con.getConnectionUID()) {
logger.log(Logger.INFO, BrokerResources.E_INTERNAL_BROKER_ERROR, " error connection " + "removing producer it doesnt own" + "\n\tPID=" + pid + "\n\tconnectionUID of request " + con.getConnectionUID() + "\n\tconnectionUID of creator " + p.getConnectionUID() + "\n\tchecking producer state: " + Producer.checkProducer(pid));
reason = "unknown producer";
status = Status.ERROR;
throw new BrokerException(reason, status);
} else {
con.removeProducer(pid, msg, coreLifecycle);
}
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getHost.
public static String getHost(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());
if (cxnInfo == null) {
return (null);
}
String host = null;
if (cxnInfo.remoteIP != null) {
host = String.valueOf(IPAddress.rawIPToString(cxnInfo.remoteIP, true, true));
}
return (host);
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerUtil method getProducerIDs.
public static String[] getProducerIDs() {
int numProducers = Producer.getNumProducers();
String[] ids;
Iterator producers;
if (numProducers <= 0) {
return (null);
}
ids = new String[numProducers];
producers = Producer.getAllProducers();
int i = 0;
while (producers.hasNext()) {
Producer oneProd = (Producer) producers.next();
long prodID = oneProd.getProducerUID().longValue();
ids[i] = Long.toString(prodID);
i++;
}
return (ids);
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerManagerConfig method getProducerIDs.
public String[] getProducerIDs() throws MBeanException {
int numProducers = getNumProducers().intValue();
String[] ids;
Iterator producers;
if (numProducers <= 0) {
return (null);
}
ids = new String[numProducers];
producers = Producer.getAllProducers();
int i = 0;
while (producers.hasNext()) {
Producer oneProd = (Producer) producers.next();
long prodID = oneProd.getProducerUID().longValue();
String id;
try {
id = Long.toString(prodID);
ids[i] = id;
} catch (Exception ex) {
handleOperationException(ProducerOperations.GET_PRODUCER_IDS, ex);
}
i++;
}
return (ids);
}
use of com.sun.messaging.jmq.jmsserver.core.Producer in project openmq by eclipse-ee4j.
the class ProducerManagerMonitor method getProducerWildcards.
public String[] getProducerWildcards() throws MBeanException {
ArrayList<String> al = new ArrayList<>();
String[] list = null;
int numWildcardProducers = Producer.getNumWildcardProducers();
Iterator producers;
if (numWildcardProducers <= 0) {
return (null);
}
producers = Producer.getWildcardProducers();
if (producers == null) {
return (null);
}
while (producers.hasNext()) {
ProducerUID pid = (ProducerUID) producers.next();
Producer oneProd = (Producer) Producer.getProducer(pid);
DestinationUID id = oneProd.getDestinationUID();
al.add(id.getName());
}
if (al.size() > 0) {
list = new String[al.size()];
list = al.toArray(list);
}
return (list);
}
Aggregations