added patch to run broker using a URI

ie. mvn activemq-perf:broker -Durl=broker:(tcp://localhost:61616)?useJmx=false


git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@412386 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonas B. Lim 2006-06-07 12:14:54 +00:00
parent 51eed37625
commit 741cdeec2b
1 changed files with 27 additions and 10 deletions

View File

@ -66,6 +66,13 @@ public class ServerMojo
*/ */
private File configFile; private File configFile;
/**
* Broker URL.
*
* @parameter expression="${url}"
*/
private String url;
public void execute() public void execute()
throws MojoExecutionException { throws MojoExecutionException {
@ -76,20 +83,30 @@ public class ServerMojo
out.mkdirs(); out.mkdirs();
} }
File config;
if (configFile != null) { String[] args = new String[2];
config = configFile; if (url != null) {
args[0] = "start";
args[1] = url;
} else { } else {
config = new File(configDirectory + File.separator + configType + ".xml"); File config;
if (configFile != null) {
config = configFile;
} else {
config = new File(configDirectory + File.separator + configType + ".xml");
}
try {
config = copy(config);
} catch (IOException e) {
throw new MojoExecutionException(e.getMessage());
}
args[0] = "start";
args[1] = "xbean:" + (config.toURI()).toString();
} }
try {
config = copy(config);
} catch (IOException e) {
throw new MojoExecutionException(e.getMessage());
}
String[] args = {"start", "xbean:" + (config.toURI()).toString()};
Main.main(args); Main.main(args);
} }