Ejemplo n.º 1
0
 /**
  * Deploy a url
  *
  * @param url the deployment url
  * @throws Throwable for any error
  */
 protected KernelDeployment deploy(final URL url) throws Throwable {
   HornetQBootstrapServer.log.debug("Deploying " + url);
   KernelDeployment deployment = deployer.deploy(url);
   deployments.add(deployment);
   HornetQBootstrapServer.log.debug("Deployed " + url);
   return deployment;
 }
Ejemplo n.º 2
0
 /**
  * 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);
   }
 }
Ejemplo n.º 3
0
  @Override
  public void bootstrap() throws Throwable {
    super.bootstrap();
    deployer = new BeanXMLDeployer(getKernel());
    Runtime.getRuntime().addShutdownHook(new Shutdown());

    for (String arg : args) {
      deploy(arg);
    }

    deployer.validate();
  }
Ejemplo n.º 4
0
  /** Deploys a XML on the container */
  public KernelDeployment deploy(final String name, final String xml) throws Throwable {
    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
    PrintStream printOut = new PrintStream(byteOut);
    printOut.print(xml);
    printOut.flush();
    ByteArrayInputStream is = new ByteArrayInputStream(byteOut.toByteArray());

    KernelDeployment deployment = deployer.deploy(name, is);

    deployments.add(deployment);

    return deployment;
  }