Package com.sun.messaging.jmq.admin.bkrutil

Examples of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin


  return true;
    }

    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;

  if (ba != null) {
      ba.setInitiator(true);
            /*
             * This value should be true only when restart is requested.
             */
      ba.setReconnect(true);
            restartBroker(ba, bCObj);
        }
    }
View Full Code Here


    private BrokerDestCObj addDestination(BrokerCObj bCObj, BrokerAdminEvent bae) {

  BrokerDestCObj bDestCObj;
  DestinationInfo destInfo = createDestination(bae);
  BrokerAdmin 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(bCObj);

  String destName = destInfo.name;
  try {
      ba.sendCreateDestinationMessage(destInfo);
      ba.receiveCreateDestinationReplyMessage();
      bDestCObj = new BrokerDestCObj(bCObj, destInfo);
            app.getStatusArea().appendText
    (acr.getString(acr.S_BROKER_DEST_ADD, destInfo.name, ba.getKey()));

        } catch (BrokerAdminException baex) {
            JOptionPane.showOptionDialog(app.getFrame(),
                acr.getString(acr.E_ADD_DEST_BROKER, destName, ba.getKey()) +
                   printBrokerAdminExceptionDetails(baex),
                acr.getString(acr.I_ADD_BROKER_DEST) + ": " +
                   acr.getString(acr.I_ERROR_CODE,
                      AdminConsoleResources.E_ADD_DEST_BROKER),
                JOptionPane.YES_NO_OPTION,
View Full Code Here

  return destInfo;
    }

    private void doDeleteDestination(BrokerDestCObj bDestCObj) {

  BrokerAdmin 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);

  DestinationInfo destInfo = bDestCObj.getDestinationInfo();

  int result = JOptionPane.showConfirmDialog(app.getFrame(),
                acr.getString(acr.Q_BROKER_DELETE_DEST, destInfo.name, ba.getKey()),
                acr.getString(acr.I_DELETE_BROKER_DEST),
                JOptionPane.YES_NO_OPTION);

  if (result == JOptionPane.NO_OPTION)
            return;
View Full Code Here

        return true;
    }

    private void doPurgeDestination(BrokerDestCObj bDestCObj) {

        BrokerAdmin ba = bDestCObj.getBrokerAdmin();
        DestinationInfo destInfo = bDestCObj.getDestinationInfo();

        int result = JOptionPane.showConfirmDialog(app.getFrame(),
                acr.getString(acr.Q_BROKER_PURGE_DEST, destInfo.name, ba.getKey()),
                acr.getString(acr.I_PURGE_MESSAGES),
                JOptionPane.YES_NO_OPTION);

  if (result == JOptionPane.NO_OPTION)
      return;
View Full Code Here

  }

  Vector v = baMgr.getBrokerAdmins();

  for (int i = 0; i < v.size(); i++) {
      BrokerAdmin ba = (BrokerAdmin)v.get(i);
      ConsoleObj brokerCObj= new BrokerCObj(ba);
      /*
       * Add code to populate broker node here if connected
       */

 
View Full Code Here

      bCObj.toString()));
        }
    }

    private boolean isLatestBrokerAvailable(BrokerCObj bCObj) {
        BrokerAdmin ba = bCObj.getBrokerAdmin();
        /*
         * Check to see if BrokerAdmin can connect to the broker by
         * sending a hello message.  It acts like a ping (verified w/ Joe.)
         */
        try {
            ba.sendHelloMessage();
            ba.receiveHelloReplyMessage();
      return true;

  } catch (BrokerAdminException bae) {
            JOptionPane.showOptionDialog(app.getFrame(),
                acr.getString(acr.E_BROKER_NOT_CONNECTED, ba.getKey()) +
       printBrokerAdminExceptionDetails(bae),
                acr.getString(acr.I_BROKER_REFRESH) + ": " +
                   acr.getString(acr.I_ERROR_CODE,
                      AdminConsoleResources.E_BROKER_NOT_CONNECTED),
                JOptionPane.YES_NO_OPTION,
                JOptionPane.ERROR_MESSAGE, null, close, close[0]);

      ba.setIsConnected(false);
            bCObj.setBrokerProps(null);
            /*
             * Remove destinations and services from this broker's node
             * hierarchy.
             */
 
View Full Code Here

    public void deleteBrokerAdmin(BrokerAdmin ba) {

  String baKey = ba.getKey();

  for (int i = 0; i < admins.size(); i++) {
      BrokerAdmin ba2 = (BrokerAdmin)admins.get(i);
      String ba2Key = ba2.getKey();
      if (baKey.equals(ba2Key)) {
    admins.remove(i);
          return;
      }
  }
View Full Code Here

  BrokerListProperties  blProps = readFromFile();

  int count = blProps.getBrokerCount();

  for (int i = 0; i < count; ++i)  {
      BrokerAdmin ba = blProps.getBrokerAdmin(i);

      addBrokerAdmin(ba);
  }
    }
View Full Code Here

    public void writeBrokerAdminsToFile() throws UserPropertiesException  {

  BrokerListProperties  blProps = new BrokerListProperties();

  for (int i = 0; i < admins.size(); i++) {
      BrokerAdmin ba = (BrokerAdmin)admins.get(i);
      blProps.addBrokerAdmin(ba);
  }


  writeToFile(blProps);
View Full Code Here

     * Returns true if the key of BrokerAdmin exists in the list.
     * Returns false otherwise.
     */
    public boolean exist(String key) {
  for (int i = 0; i < admins.size(); i++) {
      BrokerAdmin ba = (BrokerAdmin)admins.get(i);
      String baKey = ba.getKey();
      if (key.equals(baKey)) {
    return true;
      }
  }

View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.admin.bkrutil.BrokerAdmin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.