geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/maven-plugin/src/java/org/apache/geronimo/deployment/mavenplugin StartRemoteServer.java
Date Wed, 01 Sep 2004 16:38:14 GMT
djencks     2004/09/01 09:38:14

  Modified:    modules/maven-plugin/src/java/org/apache/geronimo/deployment/mavenplugin
                        StartRemoteServer.java
  Log:
  specifying a debugPort starts geronimo in debug mode
  
  Revision  Changes    Path
  1.2       +22 -8     incubator-geronimo/modules/maven-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartRemoteServer.java
  
  Index: StartRemoteServer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/maven-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartRemoteServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StartRemoteServer.java	1 Aug 2004 02:09:06 -0000	1.1
  +++ StartRemoteServer.java	1 Sep 2004 16:38:14 -0000	1.2
  @@ -25,15 +25,13 @@
   import java.util.StringTokenizer;
   
   /**
  - *
  - *
    * @version $Revision$ $Date$
  - *
  - * */
  + */
   public class StartRemoteServer {
   
       private String geronimoTarget;
       private String configs;
  +    private String debugPort;
   
       public String getGeronimoTarget() {
           return geronimoTarget;
  @@ -51,25 +49,41 @@
           this.configs = configs;
       }
   
  +    public String getDebugPort() {
  +        return debugPort;
  +    }
  +
  +    public void setDebugPort(String debugPort) {
  +        this.debugPort = debugPort;
  +    }
  +
       public void execute() throws Exception {
           ArrayList cmd = new ArrayList();
           File root = new File(getGeronimoTarget());
           File systemFile = new File(root, "bin/server.jar");
           String s = java.io.File.separator;
  -        String java = System.getProperty("java.home")+s+"bin"+s+"java";
  +        String java = System.getProperty("java.home") + s + "bin" + s + "java";
   
           cmd.add(java);
   
  +        if (debugPort != null) {
  +            cmd.add("-Xdebug");
  +            cmd.add("-Xnoagent");
  +            cmd.add("-Djava.compiler=NONE");
  +            cmd.add("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=" + debugPort);
  +        }
  +
  +        cmd.add("-ea");
           cmd.add("-jar");
           cmd.add(systemFile.getCanonicalPath());
   
  -        for (StringTokenizer st = new StringTokenizer(getConfigs()); st.hasMoreTokens();
) {
  +        for (StringTokenizer st = new StringTokenizer(getConfigs()); st.hasMoreTokens();)
{
               cmd.add(st.nextToken());
           }
           String[] command = (String[]) cmd.toArray(new String[0]);
   
           Runtime runtime = Runtime.getRuntime();
  -        Process server = runtime.exec( command );
  +        Process server = runtime.exec(command);
   
   
           // Pipe the processes STDOUT to ours
  
  
  

Mime
View raw message