geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment RemoteDeployer.java
Date Wed, 23 Jun 2004 22:45:20 GMT
jboynes     2004/06/23 15:45:20

  Added:       modules/deployment/src/java/org/apache/geronimo/deployment
                        RemoteDeployer.java
  Log:
  Gross hack as Dain wants to see how this works
  
  Revision  Changes    Path
  1.1                  incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/RemoteDeployer.java
  
  Index: RemoteDeployer.java
  ===================================================================
  package org.apache.geronimo.deployment;
  
  import java.io.File;
  import javax.enterprise.deploy.spi.DeploymentManager;
  import javax.enterprise.deploy.spi.Target;
  import javax.enterprise.deploy.spi.status.ProgressObject;
  import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
  
  import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
  
  /**
   * Created by IntelliJ IDEA.
   * User: jeremy
   * Date: Jun 23, 2004
   * Time: 1:23:53 PM
   * To change this template use File | Settings | File Templates.
   */
  public class RemoteDeployer {
      public static void main(String[] args) throws Exception {
          new DeploymentFactoryImpl();
          String uri = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
          DeploymentManager manager = DeploymentFactoryManager.getInstance().getDeploymentManager(uri,
"system", "manager");
          Target[] targets = manager.getTargets();
          File module = new File(args[0]);
          ProgressObject po = manager.distribute(targets, module, null);
          while (po.getDeploymentStatus().isRunning()) {
              Thread.sleep(100);
          }
          System.out.println(po.getDeploymentStatus().getMessage());
          if (po.getDeploymentStatus().isCompleted()) {
              manager.start(po.getResultTargetModuleIDs());
          }
      }
  }
  
  
  

Mime
View raw message