msb protocol synch change
[msb/apigateway.git] / msb-core / apiroute / apiroute-standalone / src / assembly / resource / apiroute / run.bat
1 @REM
2 @REM Copyright 2016 ZTE Corporation.
3 @REM
4 @REM Licensed under the Apache License, Version 2.0 (the "License");
5 @REM you may not use this file except in compliance with the License.
6 @REM You may obtain a copy of the License at
7 @REM
8 @REM     http://www.apache.org/licenses/LICENSE-2.0
9 @REM
10 @REM Unless required by applicable law or agreed to in writing, software
11 @REM distributed under the License is distributed on an "AS IS" BASIS,
12 @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 @REM See the License for the specific language governing permissions and
14 @REM limitations under the License.
15 @REM
16 @REM     Author: Zhaoxing Meng
17 @REM     email: meng.zhaoxing1@zte.com.cn
18 @REM
19
20 @echo off
21 title apiroute-service
22
23 set RUNHOME=%~dp0
24 echo ### RUNHOME: %RUNHOME%
25
26 echo ### Starting apiroute-service
27 rem cd /d %RUNHOME%
28
29 rem set JAVA_HOME=D:\JDK1.7\jdk\jdk\windows
30 set JAVA="%JAVA_HOME%\bin\java.exe"
31 set port=8777
32
33 setlocal enabledelayedexpansion
34 set index=1
35 FOR /F "tokens=3 delims= " %%a in ('"%JAVA% -version 2>&1"')do (
36   if !index! equ 1 set JAVA_VERSION=%%a
37   set /a index=index+1
38 )
39 set JAVA_VERSION=%JAVA_VERSION:~1,3%
40 if "%JAVA_VERSION%"=="1.8" (
41    set jvm_opts=-Xms16m -Xmx128m -XX:+UseSerialGC -XX:MaxMetaspaceSize=64m  -XX:NewRatio=2 
42 ) else (
43    set jvm_opts=-Xms16m -Xmx128m -XX:+UseSerialGC  -XX:MaxPermSize=64m -XX:NewRatio=2
44 )
45
46 set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
47 set class_path=%RUNHOME%;%RUNHOME%apiroute-service.jar
48 echo ### jvm_opts: %jvm_opts%
49 echo ### class_path: %class_path%
50
51 %JAVA% -classpath %class_path% %jvm_opts% org.openo.msb.ApiRouteApp  server %RUNHOME%conf/apiroute.yml
52
53 IF ERRORLEVEL 1 goto showerror
54 exit
55 :showerror
56 echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!
57 echo After checking, press any key to close 
58 pause
59 exit