Modify the producer and consumer system to recognize -D parameters

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@417701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-06-28 08:54:23 +00:00
parent 0dbcc1f4af
commit a783a42f7a
2 changed files with 14 additions and 6 deletions

View File

@ -69,9 +69,13 @@ public class JmsConsumerSystem extends AbstractJmsClientSystem {
public static void main(String[] args) {
Properties props = new Properties();
for (int i=0; i<args.length; i++) {
int index = args[i].indexOf("=");
String key = args[i].substring(0, index);
String val = args[i].substring(index + 1);
String arg = args[i];
if (arg.startsWith("-D") || arg.startsWith("-d")) {
arg = arg.substring(2);
}
int index = arg.indexOf("=");
String key = arg.substring(0, index);
String val = arg.substring(index + 1);
props.setProperty(key, val);
}

View File

@ -69,9 +69,13 @@ public class JmsProducerSystem extends AbstractJmsClientSystem {
public static void main(String[] args) {
Properties props = new Properties();
for (int i=0; i<args.length; i++) {
int index = args[i].indexOf("=");
String key = args[i].substring(0, index);
String val = args[i].substring(index + 1);
String arg = args[i];
if (arg.startsWith("-D") || arg.startsWith("-d")) {
arg = arg.substring(2);
}
int index = arg.indexOf("=");
String key = arg.substring(0, index);
String val = arg.substring(index + 1);
props.setProperty(key, val);
}