From d3aa9bf2be44fa3bb57aec4889ed7047b8bd52f8 Mon Sep 17 00:00:00 2001 From: Dennis Cook Date: Tue, 17 Jan 2006 19:05:51 +0000 Subject: [PATCH] Allow defeat of auto include of $ACTIVEMQ_HOME/conf in classpath (after refactor) git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@369868 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/broker/Main.java | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/Main.java b/activemq-core/src/main/java/org/apache/activemq/broker/Main.java index 841141e363..1a512050e9 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/Main.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/Main.java @@ -76,40 +76,44 @@ public class Main { return; } - String token = (String)tokens.get(0); + for (int i = 0; i < tokens.size(); i++) + { + String token = (String)tokens.get(i); + // If token is an extension dir option + if (token.equals("--extdir")) { + // Process token + tokens.remove(0); - // If token is an extension dir option - if (token.equals("--extdir")) { - // Process token - tokens.remove(0); + // If no extension directory is specified, or next token is another option + if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { + System.out.println("Extension directory not specified."); + System.out.println("Ignoring extension directory option."); + return; + } - // If no extension directory is specified, or next token is another option - if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { - System.out.println("Extension directory not specified."); - System.out.println("Ignoring extension directory option."); - return; + // Process extension dir token + File extDir = new File((String)tokens.remove(0)); + + if(!canUseExtdir()) { + System.out.println("Extension directory feature not available due to the system classpath being able to load: " + TASK_DEFAULT_CLASS); + System.out.println("Ignoring extension directory option."); + return; + } + + if (!extDir.isDirectory()) { + System.out.println("Extension directory specified is not valid directory: " + extDir); + System.out.println("Ignoring extension directory option."); + return; + } + + addExtensionDirectory(extDir); + } else if (token.equals("--noDefExt")) { // If token is --noDefExt option + useDefExt = false; + } else + { + break; } - - // Process extension dir token - File extDir = new File((String)tokens.remove(0)); - - if(!canUseExtdir()) { - System.out.println("Extension directory feature not available due to the system classpath being able to load: " + TASK_DEFAULT_CLASS); - System.out.println("Ignoring extension directory option."); - return; - } - - if (!extDir.isDirectory()) { - System.out.println("Extension directory specified is not valid directory: " + extDir); - System.out.println("Ignoring extension directory option."); - return; - } - - addExtensionDirectory(extDir); - } else if (token.equals("--noDefExt")) { // If token is --noDefExt option - useDefExt = false; - } - + } } public void runTaskClass(List tokens) throws Throwable {