use of com.sun.messaging.jmq.jmsserver.service.ConnectionManager in project openmq by eclipse-ee4j.
the class GetConsumersHandler method getConnectionInfo.
public static ConnectionInfo getConnectionInfo(long id) {
ConnectionManager cm = Globals.getConnectionManager();
ConnectionInfo cxnInfo = null;
IMQConnection cxn = null;
cxn = (IMQConnection) cm.getConnection(new ConnectionUID(id));
if (cxn == null) {
return (null);
}
cxnInfo = cxn.getConnectionInfo();
return (cxnInfo);
}
use of com.sun.messaging.jmq.jmsserver.service.ConnectionManager in project openmq by eclipse-ee4j.
the class DestinationList method destroyConnections.
private static void destroyConnections(Set destroyConns, int reason, String reasonstr) {
ConnectionManager cm = Globals.getConnectionManager();
Iterator cnitr = destroyConns.iterator();
while (cnitr.hasNext()) {
IMQBasicConnection conn = (IMQBasicConnection) cm.getConnection((ConnectionUID) cnitr.next());
if (conn == null) {
continue;
}
Globals.getLogger().log(Logger.INFO, "Destroying connection " + conn + " because " + reasonstr);
if (DEBUG) {
conn.dump();
}
conn.destroyConnection(true, reason, reasonstr);
conn.waitForRelease(Globals.getConfig().getLongProperty(Globals.IMQ + "." + conn.getService().getName() + ".destroy_timeout", 30) * 1000);
}
}
use of com.sun.messaging.jmq.jmsserver.service.ConnectionManager in project openmq by eclipse-ee4j.
the class ConnectionUtil method getProducerIDs.
public static List getProducerIDs(long cxnId) {
ConnectionManager cm = Globals.getConnectionManager();
IMQConnection cxn = null;
List producerIDs;
cxn = (IMQConnection) cm.getConnection(new ConnectionUID(cxnId));
producerIDs = cxn.getProducerIDs();
return (producerIDs);
}
use of com.sun.messaging.jmq.jmsserver.service.ConnectionManager in project openmq by eclipse-ee4j.
the class ConnectionUtil method destroyConnection.
public static void destroyConnection(long cxnId, String reasonString) {
ConnectionManager cm = Globals.getConnectionManager();
IMQConnection cxn = null;
cxn = (IMQConnection) cm.getConnection(new ConnectionUID(cxnId));
if (cxn != null) {
cxn.destroyConnection(true, GoodbyeReason.ADMIN_KILLED_CON, reasonString);
}
}
use of com.sun.messaging.jmq.jmsserver.service.ConnectionManager in project openmq by eclipse-ee4j.
the class ConnectionUtil method getConnections.
/**
* Returns a List of IMQConnection for a given service
*/
public static List getConnections(String service) {
ConnectionManager cm = Globals.getConnectionManager();
List connections = null;
try {
Service s = null;
if (service != null) {
s = Globals.getServiceManager().getService(service);
/*
* If service object is null, service may not exist or is inactive
*/
if (s == null) {
return (connections);
}
}
connections = cm.getConnectionList(s);
} catch (Exception e) {
BrokerResources rb = Globals.getBrokerResources();
Logger logger = Globals.getLogger();
logger.log(Logger.WARNING, rb.getString(rb.W_JMX_FAILED_TO_OBTAIN_CONNECTION_LIST), e);
}
return (connections);
}
Aggregations