PageRenderTime 22ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/resources/bin/ultraesb.bat

https://bitbucket.org/adroitlogic/ultraesb/
Batch | 107 lines | 86 code | 21 blank | 0 comment | 19 complexity | f0457dc7f6879952a12493e21d81f515 MD5 | raw file
Possible License(s): AGPL-3.0
  1. @echo off
  2. if "%OS%"=="Windows_NT" @setlocal
  3. if "%OS%"=="WINNT" @setlocal
  4. rem %~dp0 is expanded pathname of the current script under NT
  5. set ULTRA_HOME=%~dps0..
  6. set ULTRA_XML="%ULTRA_HOME%\conf\ultra-root.xml"
  7. rem Slurp the command line arguments
  8. :setupArgs
  9. if ""%1""=="""" goto doneStart
  10. if ""%1""==""-sample"" goto UltraSample
  11. if ""%1""==""-serverName"" goto serverName
  12. if ""%1""==""-installationName"" goto installationName
  13. if ""%1""==""-xdebug"" goto xdebug
  14. shift
  15. goto setupArgs
  16. :xdebug
  17. set _XDEBUG="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
  18. shift
  19. goto setupArgs
  20. :UltraSample
  21. shift
  22. set ULTRA_XML="--rootConf=%ULTRA_HOME%\samples\conf\ultra-sample-%1.xml"
  23. shift
  24. goto setupArgs
  25. :serverName
  26. shift
  27. set _SERVER_NAME="--serverName=%1"
  28. shift
  29. goto setupArgs
  30. :installationName
  31. shift
  32. set _SERVER_NAME="--installationName=%1"
  33. shift
  34. goto setupArgs
  35. :doneStart
  36. rem find ULTRA_HOME if it does not exist we cannot run
  37. if exist "%ULTRA_HOME%\README.TXT" goto checkJava
  38. echo ULTRA_HOME is set incorrectly or the UltraESB files could not be located.
  39. goto end
  40. :checkJava
  41. if not defined JAVA_HOME goto findJavaHome
  42. rem get rid of any double quotes in JAVA_HOME
  43. set JAVA_HOME=%JAVA_HOME:"=%
  44. if not exist "%JAVA_HOME%\bin\javac.exe" goto findJavaHome
  45. goto checkVersion
  46. :findJavaHome
  47. set JAVA_HOME=
  48. for %%P in (%PATH%) do if exist %%P\javac.exe set JAVA_HOME=%%~fP\..
  49. rem get rid of any double quotes in JAVA_HOME
  50. set JAVA_HOME=%JAVA_HOME:"=%
  51. rem we MUST have JAVA_HOME now, else we must quit
  52. if not defined JAVA_HOME goto noJavaHome
  53. goto checkVersion
  54. :noJavaHome
  55. echo "You must have the JDK in the PATH or set the JAVA_HOME variable before running UltraESB"
  56. goto end
  57. :checkVersion
  58. rem we REQUIRE a Java DEVELOPMENT Kit (JDK) of version 1.7.x (a JRE might not be adequate for all scenarios)
  59. "%JAVA_HOME%\bin\javac" -version 2>&1 | findstr /r "1.[7|8]" >NUL
  60. IF ERRORLEVEL 1 goto nojdk
  61. goto runServer
  62. :nojdk
  63. echo "The UltraESB REQUIRES a Java DEVELOPMENT Kit (JDK) version 1.7.x or later, and Java MUST be available in the PATH. (A JRE may not be sufficient)"
  64. goto end
  65. :runServer
  66. @rem @echo on
  67. cd %ULTRA_HOME%
  68. echo "Starting AdroitLogic UltraESB ..."
  69. echo Using ULTRA_HOME: %ULTRA_HOME%
  70. echo Using JAVA_HOME: %JAVA_HOME%
  71. rem ----- Uncomment the following line to enable the SSL debug options ----------
  72. rem set ULTRA_OPTS="-Djavax.net.debug=all"
  73. set ULTRA_OPTS=%ULTRA_OPTS% -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration
  74. set ULTRA_OPTS=%ULTRA_OPTS% -Djava.endorsed.dirs=%ULTRA_HOME%\lib\endorsed
  75. set ULTRA_OPTS=%ULTRA_OPTS% -Dehcache.disk.store.dir=%ULTRA_HOME%\data
  76. set ULTRA_OPTS=%ULTRA_OPTS% -Dorg.terracotta.quartz.skipUpdateCheck=true
  77. set ULTRA_OPTS=%ULTRA_OPTS% -Dfile.encoding=UTF-8
  78. set ULTRA_OPTS=%ULTRA_OPTS% -Dsun.jnu.encoding=UTF-8
  79. set CLASSPATH=conf;"%JAVA_HOME%\lib\tools.jar";lib\patches;conf\mediation\classes;lib\patches\*;lib\*;lib\custom\*;lib\optional\*;lib\samples\*
  80. set ULTRA_CONF="--confDir=%ULTRA_HOME%\conf"
  81. "%JAVA_HOME%\bin\java" -server -Xms1024M -Xmx1024M %_XDEBUG% %ULTRA_OPTS% -cp %CLASSPATH% org.adroitlogic.ultraesb.UltraServer %ULTRA_CONF% %ULTRA_XML% %SERVER_NAME%
  82. if not errorlevel 1 goto :end
  83. :end
  84. pause
  85. if "%OS%"=="Windows_NT" @endlocal
  86. if "%OS%"=="WINNT" @endlocal