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);
}
}
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);
}
}
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);
}
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;
}
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;
}
Aggregations