1 16 17 18 package org.apache.catalina.launcher; 19 20 21 import java.util.ArrayList ; 22 import org.apache.commons.launcher.LaunchCommand; 23 import org.apache.commons.launcher.LaunchFilter; 24 import org.apache.tools.ant.BuildException; 25 26 27 34 public class CatalinaLaunchFilter implements LaunchFilter { 35 36 38 41 private static String CATALINA_BOOTSTRAP_CLASS_NAME = "org.apache.catalina.startup.Bootstrap"; 42 43 45 57 public void filter(LaunchCommand launchCommand) throws BuildException { 58 59 String mainClassName = launchCommand.getClassname(); 61 boolean waitForChild = launchCommand.getWaitforchild(); 62 ArrayList argsList = launchCommand.getArgs(); 63 String [] args = (String [])argsList.toArray(new String [argsList.size()]); 64 65 if (CatalinaLaunchFilter.CATALINA_BOOTSTRAP_CLASS_NAME.equals(mainClassName)) { 67 if (args.length == 0 || !"start".equals(args[args.length - 1])) { 69 launchCommand.setWaitforchild(true); 70 return; 71 } 72 73 for (int i = 0; i < args.length - 1; i++) { 76 if ("-config".equals(args[i])) { 77 if (args.length > i + 1) { 79 i++; 80 } else { 81 launchCommand.setWaitforchild(true); 82 return; 83 } 84 } else if ("-debug".equals(args[i])) { 85 } else if ("-nonaming".equals(args[i])) { 87 } else { 89 launchCommand.setWaitforchild(true); 90 return; 91 } 92 } 93 } 94 95 } 96 97 } 98 | Popular Tags |