Title: [802] trunk/assembly: SM-171 : use classworlds to boostrap
Revision
802
Author
gnt
Date
2005-11-11 18:15:39 -0500 (Fri, 11 Nov 2005)

Log Message

SM-171 : use classworlds to boostrap

Modified Paths


Added Paths

Removed Paths

Diff

Modified: trunk/assembly/project.xml (801 => 802)

--- trunk/assembly/project.xml	2005-11-11 19:37:54 UTC (rev 801)
+++ trunk/assembly/project.xml	2005-11-11 23:15:39 UTC (rev 802)
@@ -726,6 +726,47 @@
         <lib>true</lib>
       </properties>
     </dependency>
+    
+    <dependency>
+      <groupId>servicemix</groupId>
+      <artifactId>DdlUtils</artifactId>
+      <version>${ddlutils_version}</version>
+      <properties>
+        <lib>true</lib>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>${commons_lang_version}</version>
+      <properties>
+        <lib>true</lib>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-betwixt</groupId>
+      <artifactId>commons-betwixt</artifactId>
+      <version>${commons_betwixt_version}</version>
+      <properties>
+        <lib>true</lib>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-digester</groupId>
+      <artifactId>commons-digester</artifactId>
+      <version>${commons_digester_version}</version>
+      <properties>
+        <lib>true</lib>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>classworlds</groupId>
+      <artifactId>classworlds</artifactId>
+      <version>${classworlds_version}</version>
+      <properties>
+        <lib>true</lib>
+      </properties>
+    </dependency>
   </dependencies>
 
 </project>

Deleted: trunk/assembly/src/release/bin/lcp.bat (801 => 802)

--- trunk/assembly/src/release/bin/lcp.bat	2005-11-11 19:37:54 UTC (rev 801)
+++ trunk/assembly/src/release/bin/lcp.bat	2005-11-11 23:15:39 UTC (rev 802)
@@ -1,16 +0,0 @@
-REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
-REM   reserved.
-
-set _CLASSPATHCOMPONENT=%1
-if ""%1""=="""" goto gotAllArgs
-shift
-
-:argCheck
-if ""%1""=="""" goto gotAllArgs
-set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
-shift
-goto argCheck
-
-:gotAllArgs
-set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH%
-

Modified: trunk/assembly/src/release/bin/servicemix (801 => 802)

--- trunk/assembly/src/release/bin/servicemix	2005-11-11 19:37:54 UTC (rev 801)
+++ trunk/assembly/src/release/bin/servicemix	2005-11-11 23:15:39 UTC (rev 802)
@@ -1,185 +1,231 @@
 #!/bin/sh
-
-#   ServiceMix shell script
 #
-#   $Id$
+# $Id$
 #
-#   This script is heavily based on the Ant script
-#
-#   Copyright (c) 2005 The Apache Software Foundation.  All rights
-#   reserved.
 
-# load system-wide servicemix configuration
-if [ -f "/etc/servicemix.conf" ] ; then
-  . /etc/servicemix.conf
-fi
+DIRNAME=`dirname $0`
+PROGNAME=`basename $0`
 
-# provide default values for people who don't use RPMs
-if [ -z "$usejikes" ] ; then
-  usejikes=false;
-fi
+warn() {
+    echo "${PROGNAME}: $*"
+}
 
-# load user servicemix configuration
-if [ -f "$HOME/.servicemixrc" ] ; then
-  . "$HOME/.servicemixrc"
-fi
+die() {
+    warn "$*"
+    exit 1
+}
 
-# OS specific support.  $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-case "`uname`" in
-  CYGWIN*) cygwin=true ;;
-  Darwin*) darwin=true
-           if [ -z "$JAVA_HOME" ] ; then
-             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
-           fi
-           ;;
-esac
+maybeSource() {
+    file="$1"
+    if [ -f "$file" ] ; then
+        . $file
+    fi
+}
 
-if [ -z "$SERVICEMIX_HOME" ] ; then
-  # try to find SERVICEMIX
-  if [ -d /opt/servicemix ] ; then
-    SERVICEMIX_HOME=/opt/servicemix
-  fi
+detectOS() {
+    # OS specific support (must be 'true' or 'false').
+    cygwin=false;
+    darwin=false;
+    case "`uname`" in
+        CYGWIN*)
+            cygwin=true
+            ;;
+        
+        Darwin*)
+            darwin=true
+            ;;
+    esac
+}
 
-  if [ -d "${HOME}/opt/servicemix" ] ; then
-    SERVICEMIX_HOME="${HOME}/opt/servicemix"
-  fi
-
-  ## resolve links - $0 may be a link to servicemix's home
-  PRG="$0"
-  progname=`basename "$0"`
-  saveddir=`pwd`
-
-  # need this for relative symlinks
-  dirname_prg=`dirname "$PRG"`
-  cd "$dirname_prg"
-
-  while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '.*/.*' > /dev/null; then
-	PRG="$link"
-    else
-	PRG=`dirname "$PRG"`"/$link"
+unlimitFD() {
+    # Use the maximum available, or set MAX_FD != -1 to use that
+    if [ "x$MAX_FD" = "x" ]; then
+        MAX_FD="maximum"
     fi
-  done
+    
+    # Increase the maximum file descriptors if we can
+    if [ "$cygwin" = "false" ]; then
+        MAX_FD_LIMIT=`ulimit -H -n`
+        if [ $? -eq 0 ]; then
+            if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+                # use the system max
+                MAX_FD="$MAX_FD_LIMIT"
+            fi
+            
+            ulimit -n $MAX_FD
+            if [ $? -ne 0 ]; then
+                warn "Could not set maximum file descriptor limit: $MAX_FD"
+            fi
+        else
+            warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+        fi
+    fi
+}
 
-  SERVICEMIX_HOME=`dirname "$PRG"`/..
-
-  cd "$saveddir"
-
-  # make it fully qualified
-  SERVICEMIX_HOME=`cd "$SERVICEMIX_HOME" && pwd`
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
-  [ -n "$SERVICEMIX_HOME" ] &&
-    SERVICEMIX_HOME=`cygpath --unix "$SERVICEMIX_HOME"`
-  [ -n "$JAVA_HOME" ] &&
-    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-  [ -n "$CLASSPATH" ] &&
-    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# set SERVICEMIX_LIB location
-SERVICEMIX_LIB="${SERVICEMIX_HOME}/lib"
-
-if [ -z "$JAVACMD" ] ; then
-  if [ -n "$JAVA_HOME"  ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
-      # IBM's JDK on AIX uses strange locations for the executables
-      JAVACMD="$JAVA_HOME/jre/sh/java"
-    else
-      JAVACMD="$JAVA_HOME/bin/java"
+locateHome() {
+    if [ "x$SERVICEMIX_HOME" != "x" ]; then
+        warn "Ignoring predefined value for SERVICEMIX_HOME"
     fi
-  else
-    JAVACMD=`which java 2> /dev/null `
-    if [ -z "$JAVACMD" ] ; then
-        JAVACMD=java
+    
+    SERVICEMIX_HOME=`cd $DIRNAME/..; pwd`
+    if [ ! -e "$SERVICEMIX_HOME" ]; then
+        die "SERVICEMIX_HOME is not valid: $SERVICEMIX_HOME"
     fi
-  fi
-fi
+}
 
-if [ ! -x "$JAVACMD" ] ; then
-  echo "Error: JAVA_HOME is not defined correctly."
-  echo "  We cannot execute $JAVACMD"
-  exit 1
-fi
-
-if [ -n "$CLASSPATH" ] ; then
-  LOCALCLASSPATH="$CLASSPATH"
-fi
-
-# add in the core .jar files
-for i in "${SERVICEMIX_HOME}"/*.jar
-do
-  # if the directory is empty, then it will return the input string
-  # this is stupid, so case for it
-  if [ -f "$i" ] ; then
-    if [ -z "$LOCALCLASSPATH" ] ; then
-      LOCALCLASSPATH="$i"
-    else
-      LOCALCLASSPATH="$LOCALCLASSPATH":"$i"
+setupNativePath() {
+    # Support for loading native libraries
+    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$SERVICEMIX_HOME/lib"
+    
+    # For Cygwin, set PATH from LD_LIBRARY_PATH
+    if $cygwin; then
+        LD_LIBRARY_PATH=`cygpath --path --windows "$LD_LIBRARY_PATH"`
+        PATH="$PATH;$LD_LIBRARY_PATH"
+        export PATH
     fi
-  fi
-done
+    export LD_LIBRARY_PATH
+}
 
-# add in the required dependency .jar files
-for i in "${SERVICEMIX_LIB}"/*.jar
-do
-  # if the directory is empty, then it will return the input string
-  # this is stupid, so case for it
-  if [ -f "$i" ] ; then
-    if [ -z "$LOCALCLASSPATH" ] ; then
-      LOCALCLASSPATH="$i"
-    else
-      LOCALCLASSPATH="$LOCALCLASSPATH":"$i"
+locateJava() {
+    # Setup the Java Virtual Machine
+    if $cygwin ; then
+        [ -n "$JAVA" ] && JAVA=`cygpath --unix "$JAVA"`
+        [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
     fi
-  fi
-done
+    
+    if [ "x$JAVA" = "x" ]; then
+        if [ "x$JAVA_HOME" != "x" ]; then
+            if [ ! -d "$JAVA_HOME" ]; then
+                die "JAVA_HOME is not valid: $JAVA_HOME"
+            fi
+            JAVA="$JAVA_HOME/bin/java"
+        else
+            warn "JAVA_HOME not set; results may vary"
+            JAVA="java"
+        fi
+    fi
+}
 
-# add in the optional dependency .jar files
-for i in "${SERVICEMIX_LIB}"/optional/*.jar
-do
-  # if the directory is empty, then it will return the input string
-  # this is stupid, so case for it
-  if [ -f "$i" ] ; then
-    if [ -z "$LOCALCLASSPATH" ] ; then
-      LOCALCLASSPATH="$i"
-    else
-      LOCALCLASSPATH="$LOCALCLASSPATH":"$i"
+setupDebugOptions() {
+    if [ "x$JAVA_OPTS" = "x" ]; then
+        JAVA_OPTS="$DEFAULT_JAVA_OPTS"
     fi
-  fi
-done
+    export JAVA_OPTS
+    
+    # Set Debug options if enabled
+    if [ "x$SERVICEMIX_DEBUG" != "x" ]; then
+        # Use the defaults if JAVA_DEBUG_OPTS was not set
+        if [ "x$JAVA_DEBUG_OPTS" = "x" ]; then
+            JAVA_DEBUG_OPTS="$DEFAULT_JAVA_DEBUG_OPTS"
+        fi
+        
+        JAVA_OPTS="$JAVA_DEBUG_OPTS $JAVA_OPTS"
+        warn "Enabling Java debug options: $JAVA_DEBUG_OPTS"
+    fi
+}
 
-LOCALCLASSPATH="${SERVICEMIX_HOME}/conf:$LOCALCLASSPATH"
+setupDefaults() {
+    ##
+    ## FIXME: The Derby options here should be fixed to use something other than ../*
+    ##
+    DEFAULT_JAVA_OPTS="-server -Xmx512M -Dderby.system.home=../var -Dderby.storage.fileSyncTransactionLog=true -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog"
+    DEFAULT_JAVA_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
+    
+    ##
+    ## TODO: Move to conf/profiler/yourkit.{sh|cmd}
+    ##
+    # Uncomment to enable YourKit profiling
+    #DEFAULT_JAVA_DEBUG_OPTS="-Xrunyjpagent"
+}
 
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
-  SERVICEMIX_HOME=`cygpath --windows "$SERVICEMIX_HOME"`
-  JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
-  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
-  LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
-  CYGHOME=`cygpath --windows "$HOME"`
-fi
+setupClassworlds() {
+    # Setup the classpath
+    CLASSPATH="$SERVICEMIX_HOME/lib/classworlds-1.0.1.jar"
+    
+    # Setup Classworlds options
+    CLASSWORLDS_CONF="$SERVICEMIX_HOME/conf/servicemix.conf"
+}
 
+setupProfiler() {
+    # Load profiler settings
+    if [ "x$SERVICEMIX_PROFILER" != "x" ]; then
+        SERVICEMIX_PROFILER_SCRIPT="$SERVICEMIX_HOME/conf/profiler/$SERVICEMIX_PROFILER.sh"
+        if [ ! -e "$SERVICEMIX_PROFILER_SCRIPT" ]; then
+            die "Missing configuration for profiler '$SERVICEMIX_PROFILER': $SERVICEMIX_PROFILER_SCRIPT"
+        fi
+    fi
+    
+    # Execute the JVM or the load the profiler
+    if [ "x$SERVICEMIX_PROFILER" != "x" ]; then
+        warn "Loading profiler script: $SERVICEMIX_PROFILER_SCRIPT"
+        . "$SERVICEMIX_PROFILER_SCRIPT"
+    fi
+}
 
-if [ -n "SERVICEMIX_OPTS" ] ; then
-  SERVICEMIX_OPTS="-Xmx512M -Dderby.system.home=../var -Dderby.storage.fileSyncTransactionLog=true -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog"
-#  SERVICEMIX_OPTS="-Xmx512M -Dderby.system.home=../var -Dderby.storage.fileSyncTransactionLog=true"
-fi
+init() {
+    # Determine if there is special OS handling we must perform
+    detectOS
+    
+    # Unlimit the number of file descriptors if possible
+    unlimitFD
+    
+    # Locate the ServiceMix home directory
+    locateHome
+    
+    # Load system-wide servicemix configuration
+    maybeSource "/etc/servicemix.conf"
+    
+    # Load installation configuration
+    maybeSource "$SERVICEMIX_HOME/conf/servicemix.rc"
+    
+    # Load user servicemix configuration
+    maybeSource "$HOME/.servicemixrc"
+    
+    # Setup the native library path
+    setupNativePath
+    
+    # Locate the Java VM to execute
+    locateJava
+    
+    # Setup default options
+    setupDefaults
+    
+    # Install debug options
+    setupDebugOptions
+    
+    # Setup the ClassWorlds environment
+    setupClassworlds
+    
+    # Setup profiler specific configuration
+    setupProfiler
+}
 
-# Uncomment to enable YourKit profiling
-#SERVICEMIX_DEBUG_OPTS="-Xrunyjpagent"
+run() {
+    # For Cygwin, switch paths to Windows format before running java
+    if $cygwin; then
+        SERVICEMIX_HOME=`cygpath --path --windows "$SERVICEMIX_HOME"`
+        CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+        CLASSWORLDS_CONF=`cygpath --path --windows "$CLASSWORLDS_CONF"`
+        CYGHOME=`cygpath --windows "$HOME"`
+    fi
+    
+    # Execute the Java Virtual Machine
+    exec $JAVA \
+        $JAVA_OPTS \
+        $SERVICEMIX_OPTS \
+        -classpath "$CLASSPATH" \
+        -Dclassworlds.conf="$CLASSWORLDS_CONF" \
+        -Dservicemix.home="$SERVICEMIX_HOME" \
+        -Dcygwin.user.home="$CYGHOME" \
+        -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
+        org.codehaus.classworlds.Launcher \
+        "$@"
+}
 
-# Uncomment to enable remote debugging
-#SERVICEMIX_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
+main() {
+    init
+    run
+}
 
-if [ -n "$CYGHOME" ]; then
-    exec "$JAVACMD" $SERVICEMIX_DEBUG_OPTS $SERVICEMIX_OPTS -classpath "$LOCALCLASSPATH" -Dservicemix.home="${SERVICEMIX_HOME}" -Dcygwin.user.home="$CYGHOME" org.servicemix.Main $SERVICEMIX_ARGS "$@"
-else
-    exec "$JAVACMD" $SERVICEMIX_DEBUG_OPTS $SERVICEMIX_OPTS -classpath "$LOCALCLASSPATH" -Dservicemix.home="${SERVICEMIX_HOME}" org.servicemix.Main $SERVICEMIX_ARGS "$@"
-fi
+main $@
 

Modified: trunk/assembly/src/release/bin/servicemix.bat (801 => 802)

--- trunk/assembly/src/release/bin/servicemix.bat	2005-11-11 19:37:54 UTC (rev 801)
+++ trunk/assembly/src/release/bin/servicemix.bat	2005-11-11 23:15:39 UTC (rev 802)
@@ -1,105 +1,103 @@
 @echo off
+rem 
+rem $Id$
+rem 
 
-REM   ServiceMix shell script
-REM
-REM   $Id$
-REM
-REM   This script is heavily based on the Ant script
-REM
-REM   Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
-REM   reserved.
+if not "%ECHO%" == "" echo %ECHO%
 
-if exist "%HOME%\servicemixrc_pre.bat" call "%HOME%\servicemixrc_pre.bat"
+setlocal
+set DIRNAME=%~dp0%
+set PROGNAME=%~nx0%
+set ARGS=%*
 
-if "%OS%"=="Windows_NT" @setlocal
+title ServiceMix
 
-rem %~dp0 is expanded pathname of the current script under NT
-set DEFAULT_SERVICEMIX_HOME=%~dp0..
+goto BEGIN
 
-if "%SERVICEMIX_HOME%"=="" set SERVICEMIX_HOME=%DEFAULT_SERVICEMIX_HOME%
-set DEFAULT_SERVICEMIX_HOME=
+:warn
+    echo %PROGNAME%: %*
+goto :EOF
 
-rem Slurp the command line arguments. This loop allows for an unlimited number
-rem of arguments (up to the command line limit, anyway).
-set SERVICEMIX_CMD_LINE_ARGS=%1
-if ""%1""=="""" goto doneStart
-shift
-:setupArgs
-if ""%1""=="""" goto doneStart
-set SERVICEMIX_CMD_LINE_ARGS=%SERVICEMIX_CMD_LINE_ARGS% %1
-shift
-goto setupArgs
-rem This label provides a place for the argument list loop to break out 
-rem and for NT handling to skip to.
+:BEGIN
 
-:doneStart
-rem find SERVICEMIX_HOME if it does not exist due to either an invalid value passed
-rem by the user or the %0 problem on Windows 9x
-if exist "%SERVICEMIX_HOME%\README.txt" goto checkJava
+rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
-rem check for servicemix in Program Files on system drive
-if not exist "%SystemDrive%\Program Files\servicemix" goto checkSystemDrive
-set SERVICEMIX_HOME=%SystemDrive%\Program Files\servicemix
-goto checkJava
+rem 
+rem FIXME: The Derby options here should be fixed to use something other than ../*
+rem 
+set DEFAULT_JAVA_OPTS=-server -Xmx512M -Dderby.system.home="..\var" -Dderby.storage.fileSyncTransactionLog=true -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
+set DEFAULT_JAVA_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
 
-:checkSystemDrive
-rem check for servicemix in root directory of system drive
-if not exist %SystemDrive%\servicemix\README.txt goto checkCDrive
-set SERVICEMIX_HOME=%SystemDrive%\servicemix
-goto checkJava
+rem Setup Servicemix Home
+if not "%SERVICEMIX_HOME%" == "" (
+    call :warn Ignoring predefined value for SERVICEMIX_HOME
+)
+set SERVICEMIX_HOME=%DIRNAME%..
+if not exist "%SERVICEMIX_HOME%" (
+    call :warn SERVICEMIX_HOME is not valid: %SERVICEMIX_HOME%
+    goto END
+)
+if exist "%SERVICEMIX_HOME%\conf\servicemix-rc.cmd" call %SERVICEMIX_HOME%\conf\servicemix-rc.cmd
+if exist "%HOME%\servicemix-rc.cmd" call %HOME%\servicemix-rc.cmd
 
-:checkCDrive
-rem check for servicemix in C:\servicemix for Win9X users
-if not exist C:\servicemix\README.txt goto noAntHome
-set SERVICEMIX_HOME=C:\servicemix
-goto checkJava
+rem Support for loading native libraries
+set PATH=%PATH%;%SERVICEMIX_HOME%\lib
 
-:noAntHome
-echo SERVICEMIX_HOME is set incorrectly or servicemix could not be located. Please set SERVICEMIX_HOME.
-goto end
+rem Setup the Java Virtual Machine
+if not "%JAVA%" == "" goto :Check_JAVA_END
+    set JAVA=java
+    if "%JAVA_HOME%" == "" call :warn JAVA_HOME not set; results may vary
+    if not "%JAVA_HOME%" == "" set JAVA=%JAVA_HOME%\bin\java
+    if not exist "%JAVA_HOME%" (
+        call :warn JAVA_HOME is not valid: %JAVA_HOME%
+        goto END
+    )
+:Check_JAVA_END
 
-:checkJava
-set _JAVACMD=%JAVACMD%
-set LOCALCLASSPATH=%CLASSPATH%
+if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS%
 
-set JAVA_EXT_DIRS=%JAVA_HOME%\lib\ext;%SERVICEMIX_HOME%;%SERVICEMIX_HOME%\lib;%SERVICEMIX_HOME%\lib\optional
+if "%SERVICEMIX_DEBUG%" == "" goto :SERVICEMIX_DEBUG_END
+    rem Use the defaults if JAVA_DEBUG_OPTS was not set
+    if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUG_OPTS%
+    
+    set "JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS%"
+    call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS%
+:SERVICEMIX_DEBUG_END
 
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
-goto runAnt
+if "%SERVICEMIX_PROFILER%" == "" goto :SERVICEMIX_PROFILER_END
+    set SERVICEMIX_PROFILER_SCRIPT=%SERVICEMIX_HOME%\conf\profiler\%SERVICEMIX_PROFILER%.cmd
+    
+    if exist "%SERVICEMIX_PROFILER_SCRIPT%" goto :SERVICEMIX_PROFILER_END
+    call :warn Missing configuration for profiler '%SERVICEMIX_PROFILER%': %SERVICEMIX_PROFILER_SCRIPT%
+    goto END
+:SERVICEMIX_PROFILER_END
 
-:noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=java.exe
-echo.
-echo Warning: JAVA_HOME environment variable is not set.
-echo.
+rem Setup the classpath
+set CLASSPATH=%SERVICEMIX_HOME%\lib\classworlds-1.0.1.jar
 
-:runAnt
+rem Setup boot options
+set CLASSWORLDS_CONF=%SERVICEMIX_HOME%\conf\servicemix.conf
+set BOOT_OPTS=%BOOT_OPTS% -Dclassworlds.conf="%CLASSWORLDS_CONF%"
+set BOOT_OPTS=%BOOT_OPTS% -Dservicemix.home="%SERVICEMIX_HOME%"
+set BOOT_OPTS=%BOOT_OPTS% -Djava.endorsed.dirs="%SERVICEMIX_HOME%\lib\endorsed"
 
-if "%SERVICEMIX_OPTS%" == "" set SERVICEMIX_OPTS=-Xmx512M -Dderby.system.home="..\var" -Dderby.storage.fileSyncTransactionLog=true -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
+rem Execute the JVM or the load the profiler
+if "%SERVICEMIX_PROFILER%" == "" goto :EXECUTE
+    rem Execute the profiler if it has been configured
+    call :warn Loading profiler script: %SERVICEMIX_PROFILER_SCRIPT%
+    call %SERVICEMIX_PROFILER_SCRIPT%
 
-REM Uncomment to enable YourKit profiling
-REM SET SERVICEMIX_DEBUG_OPTS="-Xrunyjpagent"
+:EXECUTE
+    rem Execute the Java Virtual Machine
+    "%JAVA%" %JAVA_OPTS% -classpath "%CLASSPATH%" %BOOT_OPTS% org.codehaus.classworlds.Launcher %ARGS%
 
-REM Uncomment to enable remote debugging
-REM SET SERVICEMIX_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
+rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
-set LOCALCLASSPATH=%SERVICEMIX_HOME%\conf;%LOCALCLASSPATH%
+:END
 
+endlocal
 
-"%_JAVACMD%" %SERVICEMIX_DEBUG_OPTS% %SERVICEMIX_OPTS% -Djava.ext.dirs="%JAVA_EXT_DIRS%" -classpath "%LOCALCLASSPATH%" -Dservicemix.home="%SERVICEMIX_HOME%" org.servicemix.Main %SERVICEMIX_ARGS% %SERVICEMIX_CMD_LINE_ARGS%
+if not "%PAUSE%" == "" pause
 
-goto end
+:END_NO_PAUSE
 
-
-:end
-set LOCALCLASSPATH=
-set _JAVACMD=
-set SERVICEMIX_CMD_LINE_ARGS=
-
-if "%OS%"=="Windows_NT" @endlocal
-
-:mainEnd
-if exist "%HOME%\servicemixrc_post.bat" call "%HOME%\servicemixrc_post.bat"
-

Added: trunk/assembly/src/release/conf/servicemix.conf (801 => 802)

--- trunk/assembly/src/release/conf/servicemix.conf	2005-11-11 19:37:54 UTC (rev 801)
+++ trunk/assembly/src/release/conf/servicemix.conf	2005-11-11 23:15:39 UTC (rev 802)
@@ -0,0 +1,12 @@
+#
+# $Id$
+#
+
+main is org.servicemix.Main from app
+
+[app]
+    load ${servicemix.home}/conf
+    load ${servicemix.home}/*.jar
+    load ${servicemix.home}/lib/*.jar
+    load ${servicemix.home}/lib/optional/*.jar
+

Reply via email to