Search in sources :

Example 61 with BrokerAdmin

use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.

the class BrokerAdminHandler method doUpdateDestination.

private void doUpdateDestination(BrokerAdminEvent bae, ConsoleObj selObj) {
    BrokerDestCObj bDestCObj;
    BrokerAdmin ba;
    String destName = null;
    int destTypeMask = -1;
    if (!(selObj instanceof BrokerDestCObj)) {
        /*
             * REMINDER: Need to flag this error ?
             */
        return;
    }
    bDestCObj = (BrokerDestCObj) selObj;
    ba = bDestCObj.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(bDestCObj);
    }
    destName = bDestCObj.getDestinationInfo().name;
    destTypeMask = bDestCObj.getDestinationInfo().type;
    DestinationInfo destInfo = bae.getDestinationInfo();
    destInfo.setName(destName);
    destInfo.setType(destTypeMask);
    try {
        ba.sendUpdateDestinationMessage(destInfo);
        ba.receiveUpdateDestinationReplyMessage();
        app.getStatusArea().appendText(acr.getString(acr.S_BROKER_UPDATE_DEST, destName));
        if (bae.isOKAction()) {
            brokerDestPropsDialog.setVisible(false);
        }
    } catch (BrokerAdminException baex) {
        JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_UPDATE_DEST, destName) + printBrokerAdminExceptionDetails(baex), acr.getString(acr.I_BROKER_DEST_PROPS) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_UPDATE_DEST), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return;
    }
    if (refreshBrokerDestCObj(bDestCObj, bae.getType())) {
        app.getInspector().selectedObjectUpdated();
        // Update menu items, buttons.
        controller.setActions(bDestCObj);
    }
}
Also used : BrokerAdminException(com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException) BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin) DestinationInfo(com.sun.messaging.jmq.util.admin.DestinationInfo)

Example 62 with BrokerAdmin

use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.

the class BrokerAdminHandler method doShutdownBroker.

private void doShutdownBroker(BrokerCObj bCObj) {
    BrokerAdmin ba = bCObj.getBrokerAdmin();
    int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_SHUTDOWN, ba.getKey()), acr.getString(acr.I_SHUTDOWN_BROKER), JOptionPane.YES_NO_OPTION);
    if (result == JOptionPane.NO_OPTION) {
        return;
    }
    ba.setInitiator(true);
    /*
         * This value should be true only when restart is requested.
         */
    ba.setReconnect(false);
    if (shutdownBroker(ba)) {
        clearBroker(bCObj);
        app.getExplorer().nodeChanged(bCObj);
        app.getInspector().refresh();
        // Update menu items, buttons.
        controller.setActions(bCObj);
    }
}
Also used : BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin)

Example 63 with BrokerAdmin

use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.

the class BrokerAdminHandler method doRestartBroker.

private void doRestartBroker(BrokerCObj bCObj) {
    BrokerAdmin ba = bCObj.getBrokerAdmin();
    int result = JOptionPane.showConfirmDialog(app.getFrame(), acr.getString(acr.Q_BROKER_RESTART, ba.getKey()), acr.getString(acr.I_RESTART_BROKER), JOptionPane.YES_NO_OPTION);
    if (result == JOptionPane.NO_OPTION) {
        return;
    }
    ba.setInitiator(true);
    /*
         * This value should be true only when restart is requested.
         */
    ba.setReconnect(true);
    restartBroker(ba, bCObj);
}
Also used : BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin)

Example 64 with BrokerAdmin

use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.

the class BrokerAdminHandler method refreshBrokerServiceListCObj.

private boolean refreshBrokerServiceListCObj(BrokerServiceListCObj bSvclCObj) {
    BrokerCObj bCObj;
    BrokerAdmin ba;
    Vector svcs = null;
    bCObj = bSvclCObj.getBrokerCObj();
    ba = bCObj.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(bSvclCObj);
    }
    try {
        ba.sendGetServicesMessage(null);
        svcs = ba.receiveGetServicesReplyMessage();
    } catch (BrokerAdminException baex) {
        JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_REFRESH_SVCLIST) + printBrokerAdminExceptionDetails(baex), acr.getString(acr.I_REFRESH_SVCLIST) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_REFRESH_SVCLIST), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return false;
    }
    refreshBrokerServiceList(svcs, bSvclCObj);
    return true;
}
Also used : BrokerAdminException(com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException) BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin) Vector(java.util.Vector)

Example 65 with BrokerAdmin

use of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin in project openmq by eclipse-ee4j.

the class BrokerAdminHandler method refreshBrokerDestListCObj.

private boolean refreshBrokerDestListCObj(BrokerDestListCObj bDestlCObj) {
    // BrokerCObj bCObj;
    BrokerAdmin ba;
    Vector dests = null;
    // bCObj = bDestlCObj.getBrokerCObj();
    ba = bDestlCObj.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(bDestlCObj);
    }
    try {
        ba.sendGetDestinationsMessage(null, -1);
        dests = ba.receiveGetDestinationsReplyMessage();
    } catch (BrokerAdminException baex) {
        JOptionPane.showOptionDialog(app.getFrame(), acr.getString(acr.E_REFRESH_DESTLIST) + printBrokerAdminExceptionDetails(baex), acr.getString(acr.I_REFRESH_DESTLIST) + ": " + acr.getString(acr.I_ERROR_CODE, AdminConsoleResources.E_REFRESH_DESTLIST), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, close, close[0]);
        return false;
    }
    refreshBrokerDestList(dests, bDestlCObj);
    return true;
}
Also used : BrokerAdminException(com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException) BrokerAdmin(com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin) Vector(java.util.Vector)

Aggregations

BrokerAdmin (com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin)69 BrokerAdminException (com.sun.messaging.jmq.admin.bkrutil.BrokerAdminException)44 SizeString (com.sun.messaging.jmq.util.SizeString)27 Vector (java.util.Vector)20 DestinationInfo (com.sun.messaging.jmq.util.admin.DestinationInfo)14 Enumeration (java.util.Enumeration)14 Properties (java.util.Properties)12 ServiceInfo (com.sun.messaging.jmq.util.admin.ServiceInfo)9 Hashtable (java.util.Hashtable)6 DurableInfo (com.sun.messaging.jmq.util.admin.DurableInfo)2 HashMap (java.util.HashMap)2 UserProperties (com.sun.messaging.jmq.admin.util.UserProperties)1 DestMetricsCounters (com.sun.messaging.jmq.util.DestMetricsCounters)1 MetricCounters (com.sun.messaging.jmq.util.MetricCounters)1 ConsumerInfo (com.sun.messaging.jmq.util.admin.ConsumerInfo)1 Message (jakarta.jms.Message)1 Map (java.util.Map)1