AMQ-500 reconciled windows start script with o.a.a.broker.Main

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@371767 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dennis Cook 2006-01-24 01:38:07 +00:00
parent d2d1c6d63d
commit f9a763586a
2 changed files with 39 additions and 25 deletions

View File

@ -53,7 +53,6 @@ public class Main {
// Convert arguments to collection for easier management // Convert arguments to collection for easier management
List tokens = new LinkedList(Arrays.asList(args)); List tokens = new LinkedList(Arrays.asList(args));
// Parse for extension directory option // Parse for extension directory option
app.parseExtensions(tokens); app.parseExtensions(tokens);
@ -75,44 +74,55 @@ public class Main {
if (tokens.isEmpty()) { if (tokens.isEmpty()) {
return; return;
} }
int tokencnt = tokens.size();
for (int i = 0; i < tokens.size(); i++) String token = (String) tokens.remove(0);
for (int processedcnt = 0; processedcnt < tokencnt; processedcnt++)
{ {
String token = (String)tokens.get(i);
// If token is an extension dir option // If token is an extension dir option
if (token.equals("--extdir")) { if (token.equals("--extdir")) {
// Process token
tokens.remove(0);
// If no extension directory is specified, or next token is another option // If no extension directory is specified, or next token is another option
if (tokens.isEmpty() || ((String)tokens.get(0)).startsWith("-")) { if (!tokens.isEmpty()) {
System.out.println("Extension directory not specified."); token = (String) tokens.remove(0);
System.out.println("Ignoring extension directory option."); if (token.startsWith("-"))
return; {
System.out.println("Extension directory not specified.");
System.out.println("Ignoring extension directory option.");
continue;
}
} else
{
break;
} }
// Process extension dir token // Process token
File extDir = new File((String)tokens.remove(0)); processedcnt++;
if(!canUseExtdir()) { 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("Extension directory feature not available due to the system classpath being able to load: " + TASK_DEFAULT_CLASS);
System.out.println("Ignoring extension directory option."); System.out.println("Ignoring extension directory option.");
return; } else
} {
// Process extension dir token
File extDir = new File(token);
if (!extDir.isDirectory()) { if (!extDir.isDirectory()) {
System.out.println("Extension directory specified is not valid directory: " + extDir); System.out.println("Extension directory specified is not valid directory: " + extDir);
System.out.println("Ignoring extension directory option."); System.out.println("Ignoring extension directory option.");
return; continue;
} }
addExtensionDirectory(extDir); addExtensionDirectory(extDir);
}
} else if (token.equals("--noDefExt")) { // If token is --noDefExt option } else if (token.equals("--noDefExt")) { // If token is --noDefExt option
useDefExt = false; System.out.println("Bypassing default ext add.");
useDefExt = false;
} else } else
{ {
break; break;
} }
if (!tokens.isEmpty()) token = (String) tokens.remove(0);
} }
} }
@ -162,11 +172,13 @@ public class Main {
ArrayList urls = new ArrayList(); ArrayList urls = new ArrayList();
for (Iterator iter = extensions.iterator(); iter.hasNext();) { for (Iterator iter = extensions.iterator(); iter.hasNext();) {
File dir = (File) iter.next(); File dir = (File) iter.next();
try{ System.out.println("Adding to classpath: " + dir.getCanonicalPath()); }catch(Exception e){}
urls.add(dir.toURL()); urls.add(dir.toURL());
File[] files = dir.listFiles(); File[] files = dir.listFiles();
if( files!=null ) { if( files!=null ) {
for (int j = 0; j < files.length; j++) { for (int j = 0; j < files.length; j++) {
if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar") ) { if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar") ) {
try{ System.out.println("Adding to classpath: " + files[j].getCanonicalPath()); }catch(Exception e){}
urls.add(files[j].toURL()); urls.add(files[j].toURL());
} }
} }

View File

@ -90,6 +90,9 @@ echo.
if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xmx512M -Dderby.system.home="..\data" -Dderby.storage.fileSyncTransactionLog=true if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xmx512M -Dderby.system.home="..\data" -Dderby.storage.fileSyncTransactionLog=true
rem set SUNJMX=
set SUNJMX=-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
REM Uncomment to enable YourKit profiling REM Uncomment to enable YourKit profiling
REM SET ACTIVEMQ_DEBUG_OPTS="-Xrunyjpagent" REM SET ACTIVEMQ_DEBUG_OPTS="-Xrunyjpagent"
@ -99,9 +102,8 @@ REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:tra
set LOCALCLASSPATH=%ACTIVEMQ_HOME%\conf;%LOCALCLASSPATH% set LOCALCLASSPATH=%ACTIVEMQ_HOME%\conf;%LOCALCLASSPATH%
set ACTIVEMQ_TASK="start" set ACTIVEMQ_TASK="start"
"%_JAVACMD%" %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% -Djava.ext.dirs="%JAVA_EXT_DIRS%" -classpath "%LOCALCLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -jar %ACTIVEMQ_HOME%/bin/run.jar %ACTIVEMQ_TASK% %ACTIVEMQ_CMD_LINE_ARGS% "%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% -Dactivemq.home="%ACTIVEMQ_HOME%" -jar %ACTIVEMQ_HOME%/bin/run.jar %ACTIVEMQ_CMD_LINE_ARGS% %ACTIVEMQ_TASK%
pause
goto end goto end