Package com.sun.messaging.jmq.jmsserver

Examples of com.sun.messaging.jmq.jmsserver.BrokerStateHandler$QuiesceRunnable


      if (con instanceof IMQBasicConnection)  {
          IMQBasicConnection ipCon = (IMQBasicConnection)con;
            ipCon.flushControl(1000);
      }

       BrokerStateHandler bsh = Globals.getBrokerStateHandler();
       if (time == null || time.intValue() == 0) {
           // stop new connections
           // set the flag to notify everyone we are shutting down
           BrokerStateHandler.shuttingDown = true;
           bsh.prepareShutdown(failover);
         }

         //if we aren't doing an unsafe exit, give us time to complete any operations
         waitForHandlersToComplete(20);

         // logging
         if (shouldRestart) {
           logger.log(Logger.INFO, BrokerResources.I_ADMIN_RESTART_REQUEST);
         } else {
           logger.log(Logger.INFO, BrokerResources.I_ADMIN_SHUTDOWN_REQUEST);
         }
        
         // shutdown the broker
         bsh.initiateShutdown("admin", (time == null ? 0 : time.longValue())* 1000, failover, (shouldRestart ? BrokerStateHandler.getRestartCode() : 0), true);
                  
        }
        return true;
    }
View Full Code Here


        logger.log(Logger.INFO,
              BrokerResources.I_ADMIN_TAKEOVER,
              brokerID);

        try {
            BrokerStateHandler bsh = Globals.getBrokerStateHandler();
            bsh.takeoverBroker(brokerID, true);
        } catch (Exception ex) {
            logger.logStack(Logger.ERROR, Globals.getBrokerResources().getKString(
                   BrokerResources.E_UNABLE_TO_TAKEOVER_BKR, brokerID, ex.getMessage()), ex);
            status = Status.ERROR;
            errMsg =ex.toString();
View Full Code Here

            errMsg =  rb.getString(rb.E_CANNOT_PROCEED_TAKEOVER_IN_PROCESS);

            logger.log(Logger.ERROR, this.getClass().getName() + ": " + errMsg);
  } else  {
        try {
            BrokerStateHandler bsh = Globals.getBrokerStateHandler();
            bsh.quiesce();
        } catch (Exception ex) {
            errMsg = ex.toString();
            status = Status.ERROR;
        }
        }
View Full Code Here

            errMsg =  rb.getString(rb.E_CANNOT_PROCEED_TAKEOVER_IN_PROCESS);

            logger.log(Logger.ERROR, this.getClass().getName() + ": " + errMsg);
  } else  {
        try {
            BrokerStateHandler bsh = Globals.getBrokerStateHandler();
            bsh.stopQuiesce();
        } catch (Exception ex) {
            errMsg = ex.toString();
            status = Status.ERROR;
        }
        }
View Full Code Here

    public String getVersion()  {
  return (brokerProps.getProperty("imq.product.version"));
    }

    public void quiesce() throws MBeanException  {
  BrokerStateHandler bsh = Globals.getBrokerStateHandler();

  logger.log(Logger.INFO, "Quiesce request received by MBean " + getMBeanName());

  try  {
      bsh.quiesce();
  } catch (BrokerException e)  {
      handleOperationException(BrokerOperations.QUIESCE, e);
  }
    }
View Full Code Here

          logger.log(Logger.WARNING,
              "BrokerConfig MBean: "+message);
          return;
        }
     
        BrokerStateHandler bsh = Globals.getBrokerStateHandler();
        logger.log(Logger.INFO, "Restart request received by MBean " + getMBeanName());

        bsh.initiateShutdown("jmx",
            0,
            true,
            bsh.getRestartCode(),
            true, Broker.isInProcess(), false);
    }
View Full Code Here

     
      shutdown(Boolean.FALSE, new Long(0));
  }

    public void shutdown(Boolean noFailover, Long time)  {
  BrokerStateHandler bsh = Globals.getBrokerStateHandler();
  boolean failover = (noFailover == null ? true
        : !(noFailover.booleanValue()));

  logger.log(Logger.INFO, "Shutdown request received by MBean " + getMBeanName());

  bsh.initiateShutdown("jmx",
    (time == null ? 0 : time.longValue())* 1000,
    failover,
    0,
    true, Broker.isInProcess(), false);
    }
View Full Code Here

    0,
    true, Broker.isInProcess(), false);
    }

    public void takeover(String brokerID) throws MBeanException  {
  BrokerStateHandler bsh = Globals.getBrokerStateHandler();

  logger.log(Logger.INFO, "Request to takeover broker "
    + brokerID
    + " received by MBean " + getMBeanName());

  try  {
      bsh.takeoverBroker(brokerID, true);
  } catch (BrokerException e)  {
      handleOperationException(BrokerOperations.TAKEOVER, e);
  }
    }
View Full Code Here

      handleOperationException(BrokerOperations.TAKEOVER, e);
  }
    }

    public void unquiesce() throws MBeanException  {
  BrokerStateHandler bsh = Globals.getBrokerStateHandler();

  logger.log(Logger.INFO, "Unquiesce request received by MBean " + getMBeanName());

  try  {
      bsh.stopQuiesce();
  } catch (BrokerException e)  {
      handleOperationException(BrokerOperations.UNQUIESCE, e);
  }
    }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.BrokerStateHandler$QuiesceRunnable

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.