/**
  * Undeploy a deployment
  *
  * @param deployment the deployment
  */
 public void undeploy(final KernelDeployment deployment) throws Throwable {
   HornetQBootstrapServer.log.debug("Undeploying " + deployment.getName());
   deployments.remove(deployment);
   try {
     deployer.undeploy(deployment);
     HornetQBootstrapServer.log.debug("Undeployed " + deployment.getName());
   } catch (Throwable t) {
     HornetQBootstrapServer.log.warn("Error during undeployment: " + deployment.getName(), t);
   }
 }
  public void shutDown() {
    log.info("Stopping HornetQ Server...");

    ListIterator<KernelDeployment> iterator = deployments.listIterator(deployments.size());
    while (iterator.hasPrevious()) {
      KernelDeployment deployment = iterator.previous();
      try {
        undeploy(deployment);
      } catch (Throwable t) {
        HornetQBootstrapServer.log.warn("Unable to undeploy: " + deployment.getName(), t);
      }
    }
  }