use of com.sun.messaging.jmq.util.admin.ServiceInfo in project openmq by eclipse-ee4j.
the class ServiceMonitor method getPktBytesOut.
public Long getPktBytesOut() {
ServiceInfo si = ServiceUtil.getServiceInfo(service);
MetricCounters metrics = si.metrics;
if (metrics != null) {
return (Long.valueOf(metrics.packetBytesOut));
} else {
return (Long.valueOf(-1));
}
}
use of com.sun.messaging.jmq.util.admin.ServiceInfo in project openmq by eclipse-ee4j.
the class ServiceUtil method getVisibleServices.
/*
* Returns an ArrayList of services (ServiceInfo) that are visible to the outside
*/
public static List getVisibleServices() {
List serviceNames = getVisibleServiceNames();
Iterator iter = serviceNames.iterator();
ArrayList al = new ArrayList();
while (iter.hasNext()) {
String service = (String) iter.next();
/*
* System.out.println("\t" + service);
*/
ServiceInfo sInfo = GetServicesHandler.getServiceInfo(service);
al.add(sInfo);
}
return (al);
}
use of com.sun.messaging.jmq.util.admin.ServiceInfo in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method refreshBrokerServiceCObj.
private boolean refreshBrokerServiceCObj(BrokerServiceCObj bSvcCObj) {
ServiceInfo oldSvcInfo = bSvcCObj.getServiceInfo();
BrokerAdmin ba = bSvcCObj.getBrokerAdmin();
/*
* Broker may take more time to complete the task than the specified timeout value. This value is used when refreshing
* the console in such cases.
*/
if (!ba.isBusy()) {
ba.setAssociatedObj(bSvcCObj);
}
Vector svc = null;
try {
ba.sendGetServicesMessage(oldSvcInfo.name);
/*
* False because users do not need to know whether or not the operation had succeeded after timeout.
*/
svc = ba.receiveGetServicesReplyMessage(false);
} catch (BrokerAdminException baex) {
JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_RETRIEVE_SVC, oldSvcInfo.name) + printBrokerAdminExceptionDetails(baex), acr.getString(acr.I_BROKER_SVC_PROPS) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_RETRIEVE_SVC), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
return false;
}
if ((svc != null) && (svc.size() == 1)) {
Enumeration e = svc.elements();
ServiceInfo sInfo = (ServiceInfo) e.nextElement();
bSvcCObj.setServiceInfo(sInfo);
return true;
}
return false;
}
use of com.sun.messaging.jmq.util.admin.ServiceInfo in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method refreshBrokerServiceList.
private void refreshBrokerServiceList(Vector svcs, BrokerServiceListCObj bSvclCObj) {
BrokerCObj bCObj = bSvclCObj.getBrokerCObj();
// if the new services is NOT null.
if (svcs != null) {
bSvclCObj.removeAllChildren();
BrokerServiceCObj bSvcCObj;
int i = 0;
Enumeration e = svcs.elements();
while (e.hasMoreElements()) {
ServiceInfo sInfo = (ServiceInfo) e.nextElement();
bSvcCObj = new BrokerServiceCObj(bCObj, sInfo);
bSvclCObj.insert(bSvcCObj, i++);
}
}
}
use of com.sun.messaging.jmq.util.admin.ServiceInfo in project openmq by eclipse-ee4j.
the class BrokerAdminHandler method queryServiceInfo.
private ServiceInfo queryServiceInfo(BrokerAdmin ba, String svcName) {
ServiceInfo svcInfo = null;
try {
ba.sendGetServicesMessage(svcName);
/*
* False because users do not need to know whether or not the operation had succeeded after timeout.
*/
Vector svc = ba.receiveGetServicesReplyMessage(false);
if ((svc != null) && (svc.size() == 1)) {
Enumeration e = svc.elements();
svcInfo = (ServiceInfo) e.nextElement();
}
} catch (BrokerAdminException bae) {
JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_SERVICE_QUERY, svcName) + printBrokerAdminExceptionDetails(bae), acr.getString(acr.I_BROKER) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_SERVICE_QUERY), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
}
return svcInfo;
}
Aggregations