Search in sources :

Example 21 with ServiceInfo

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));
    }
}
Also used : ServiceInfo(com.sun.messaging.jmq.util.admin.ServiceInfo) MetricCounters(com.sun.messaging.jmq.util.MetricCounters)

Example 22 with ServiceInfo

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);
}
Also used : ServiceInfo(com.sun.messaging.jmq.util.admin.ServiceInfo) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 23 with ServiceInfo

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;
}
Also used : ServiceInfo(com.sun.messaging.jmq.util.admin.ServiceInfo) BrokerAdminException(com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException) BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin) Enumeration(java.util.Enumeration) Vector(java.util.Vector)

Example 24 with ServiceInfo

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++);
        }
    }
}
Also used : ServiceInfo(com.sun.messaging.jmq.util.admin.ServiceInfo) Enumeration(java.util.Enumeration)

Example 25 with ServiceInfo

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;
}
Also used : ServiceInfo(com.sun.messaging.jmq.util.admin.ServiceInfo) BrokerAdminException(com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException) Enumeration(java.util.Enumeration) Vector(java.util.Vector)

Aggregations

ServiceInfo (com.sun.messaging.jmq.util.admin.ServiceInfo)27 BrokerAdmin (com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin)9 BrokerAdminException (com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException)9 MetricCounters (com.sun.messaging.jmq.util.MetricCounters)9 Enumeration (java.util.Enumeration)9 Vector (java.util.Vector)9 SizeString (com.sun.messaging.jmq.util.SizeString)5 DestinationInfo (com.sun.messaging.jmq.util.admin.DestinationInfo)4 Properties (java.util.Properties)4 Service (com.sun.messaging.jmq.jmsserver.service.Service)2 ServiceManager (com.sun.messaging.jmq.jmsserver.service.ServiceManager)2 IMQService (com.sun.messaging.jmq.jmsserver.service.imq.IMQService)2 DurableInfo (com.sun.messaging.jmq.util.admin.DurableInfo)2 HashMap (java.util.HashMap)2 Hashtable (java.util.Hashtable)2 Iterator (java.util.Iterator)2 List (java.util.List)2 HAMonitorService (com.sun.messaging.jmq.jmsserver.cluster.api.ha.HAMonitorService)1 ConnectionManager (com.sun.messaging.jmq.jmsserver.service.ConnectionManager)1 MetricManager (com.sun.messaging.jmq.jmsserver.service.MetricManager)1