You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

client.bat 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @echo off
  2. rem
  3. rem
  4. rem Licensed to the Apache Software Foundation (ASF) under one or more
  5. rem contributor license agreements. See the NOTICE file distributed with
  6. rem this work for additional information regarding copyright ownership.
  7. rem The ASF licenses this file to You under the Apache License, Version 2.0
  8. rem (the "License"); you may not use this file except in compliance with
  9. rem the License. You may obtain a copy of the License at
  10. rem
  11. rem http://www.apache.org/licenses/LICENSE-2.0
  12. rem
  13. rem Unless required by applicable law or agreed to in writing, software
  14. rem distributed under the License is distributed on an "AS IS" BASIS,
  15. rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. rem See the License for the specific language governing permissions and
  17. rem limitations under the License.
  18. rem
  19. if not "%ECHO%" == "" echo %ECHO%
  20. setlocal
  21. set DIRNAME=%~dp0%
  22. set PROGNAME=%~nx0%
  23. set ARGS=%*
  24. rem Sourcing environment settings for karaf similar to tomcats setenv
  25. SET KARAF_SCRIPT="client.bat"
  26. if exist "%DIRNAME%setenv.bat" (
  27. call "%DIRNAME%setenv.bat"
  28. )
  29. rem Check console window title. Set to Karaf by default
  30. if not "%KARAF_TITLE%" == "" (
  31. title %KARAF_TITLE%
  32. ) else (
  33. title Karaf
  34. )
  35. rem Check/Set up some easily accessible MIN/MAX params for JVM mem usage
  36. if "%JAVA_MIN_MEM%" == "" (
  37. set JAVA_MIN_MEM=128M
  38. )
  39. if "%JAVA_MAX_MEM%" == "" (
  40. set JAVA_MAX_MEM=512M
  41. )
  42. goto BEGIN
  43. :warn
  44. echo %PROGNAME%: %*
  45. goto :EOF
  46. :BEGIN
  47. rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  48. if not "%KARAF_HOME%" == "" (
  49. call :warn Ignoring predefined value for KARAF_HOME
  50. )
  51. set KARAF_HOME=%DIRNAME%..
  52. if not exist "%KARAF_HOME%" (
  53. call :warn KARAF_HOME is not valid: "%KARAF_HOME%"
  54. goto END
  55. )
  56. if not "%KARAF_BASE%" == "" (
  57. if not exist "%KARAF_BASE%" (
  58. call :warn KARAF_BASE is not valid: "%KARAF_BASE%"
  59. goto END
  60. )
  61. )
  62. if "%KARAF_BASE%" == "" (
  63. set "KARAF_BASE=%KARAF_HOME%"
  64. )
  65. if not "%KARAF_DATA%" == "" (
  66. if not exist "%KARAF_DATA%" (
  67. call :warn KARAF_DATA is not valid: "%KARAF_DATA%"
  68. goto END
  69. )
  70. )
  71. if "%KARAF_DATA%" == "" (
  72. set "KARAF_DATA=%KARAF_BASE%\data"
  73. )
  74. if not "%KARAF_ETC%" == "" (
  75. if not exist "%KARAF_ETC%" (
  76. call :warn KARAF_ETC is not valid: "%KARAF_ETC%"
  77. goto END
  78. )
  79. )
  80. if "%KARAF_ETC%" == "" (
  81. set "KARAF_ETC=%KARAF_BASE%\etc"
  82. )
  83. rem Support for loading native libraries
  84. set PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\lib
  85. rem Setup the Java Virtual Machine
  86. if not "%JAVA%" == "" goto :Check_JAVA_END
  87. set JAVA=java
  88. if "%JAVA_HOME%" == "" call :warn JAVA_HOME not set; results may vary
  89. if not "%JAVA_HOME%" == "" set JAVA=%JAVA_HOME%\bin\java
  90. if not exist "%JAVA_HOME%" (
  91. call :warn JAVA_HOME is not valid: "%JAVA_HOME%"
  92. goto END
  93. )
  94. :Check_JAVA_END
  95. if "%JAVA_OPTS%" == "" set JAVA_OPTS=%DEFAULT_JAVA_OPTS%
  96. if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END
  97. set JAVA_OPTS=%JAVA_OPTS% %EXTRA_JAVA_OPTS%
  98. :KARAF_EXTRA_JAVA_OPTS_END
  99. set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\org.apache.karaf.client\4.2.1\org.apache.karaf.client-4.2.1.jar
  100. set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\apache\sshd\sshd-core\1.7.0\sshd-core-1.7.0.jar
  101. set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\jline\jline\3.9.0\jline-3.9.0.jar
  102. set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\fusesource\jansi\jansi\1.17.1\jansi-1.17.1.jar
  103. set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\slf4j\slf4j-api\1.7.12\slf4j-api-1.7.12.jar
  104. :EXECUTE
  105. if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8 %9
  106. if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 %9
  107. rem Execute the Java Virtual Machine
  108. "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% org.apache.karaf.client.Main %ARGS%
  109. rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  110. :END
  111. endlocal