diff options
Diffstat (limited to 'wso2bpel-ext/wso2bpel-core/distribution')
8 files changed, 443 insertions, 0 deletions
diff --git a/wso2bpel-ext/wso2bpel-core/distribution/pom.xml b/wso2bpel-ext/wso2bpel-core/distribution/pom.xml new file mode 100644 index 0000000..1c0a794 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/pom.xml @@ -0,0 +1,33 @@ +<!-- + + Copyright 2016 [ZTE] and others. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <groupId>org.openo.common-services.common-utilities</groupId> + <artifactId>wso2bpel-core-parent</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <artifactId>distribution</artifactId> + <!--name>openo/commonservice/commonutilities/distribution</name--> + <packaging>pom</packaging> + + <modules> + <module>standalone</module> + </modules> +</project> diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml new file mode 100644 index 0000000..af35250 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/pom.xml @@ -0,0 +1,153 @@ +<!-- + + Copyright 2016 [ZTE] and others. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <groupId>org.openo.common-services.common-utilities</groupId> + <artifactId>distribution</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <artifactId>standalone</artifactId> + <!--name>openo/commonservice/commonutilities/distribution/standalone</name--> + <packaging>pom</packaging> + + <properties> + <packagename>openo-commonservice-commonutilities</packagename> + </properties> + + <build> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <phase>process-resources</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${basedir}/target/assembly/</outputDirectory> + <resources> + <resource> + <directory>src/main/assembly/</directory> + <filtering>false</filtering> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + <overwrite>true</overwrite> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-jar</id> + <goals> + <goal>copy</goal> + </goals> + <phase>prepare-package</phase> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.openo.common-services.common-utilities</groupId> + <artifactId>wso2bpel-mgr</artifactId> + <type>jar</type> + <overWrite>true</overWrite> + <outputDirectory>target/assembly/</outputDirectory> + <destFileName>wso2bpel-service.jar</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>zip</id> + <phase>package</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks name="${project.artifactId}"> + <zip destfile="target/${packagename}-${project.version}.zip" update="true"> + <zipfileset dir="target/assembly" includes="**" /> + </zip> + <copy todir="target/assembly/lib"> + <fileset dir="../../wso2bpel-mgr/lib"> + <include name="*" /> + </fileset> + </copy> + <copy todir="target/assembly/lib"> + <fileset dir="../../wso2bpel-mgr/target/dependency"> + <include name="*" /> + </fileset> + </copy> + <copy todir="target/assembly/classes"> + <fileset dir="../../wso2bpel-mgr/target/classes"> + <include name="**/*" /> + </fileset> + </copy> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>attach-artifacts</id> + <phase>package</phase> + <goals> + <goal>attach-artifact</goal> + </goals> + <configuration> + <artifacts> + <artifact> + <file>target/${packagename}-${project.version}.zip</file> + <type>zip</type> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.openo.common-services.common-utilities</groupId> + <artifactId>wso2bpel-mgr</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> +</project> + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml new file mode 100644 index 0000000..530a2b8 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/conf/wso2bpel.yml @@ -0,0 +1,76 @@ +#
+# Copyright 2016 [ZTE] and others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+template: Hello, %s!
+
+#defaultName: ${DW_DEFAULT_NAME:-Stranger}
+
+msbServerAddr: http://127.0.0.1:80
+#database
+#database:
+
+# # the name of your JDBC driver
+# driverClass: com.mysql.jdbc.Driver
+
+# # the username
+# user: wso2bpel
+
+# # the password
+# password: wso2bpel
+
+# # the JDBC URL
+# url: jdbc:mysql://127.0.0.1:3306/wso2bpel
+
+# use the simple server factory if you only want to run on a single port
+#server:
+# type: simple
+# connector:
+# type: http
+# port: 8080
+server:
+ type: simple
+ rootPath: '/*'
+ applicationContextPath: /
+ adminContextPath: /admin
+ connector:
+ type: http
+ port: 8101
+
+# Logging settings.
+logging:
+
+ # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
+ level: ALL
+
+ # Logger-specific levels.
+ loggers:
+
+ # Sets the level for 'com.example.app' to DEBUG.
+ org.openo.carbon.bpel.Wso2BpelApplication: INFO
+
+ appenders:
+ - type: console
+ threshold: INFO
+ timeZone: UTC
+ logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
+ - type: file
+ threshold: INFO
+ logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
+ currentLogFilename: ./logs/wso2bpel-ext.log
+ archivedLogFilenamePattern: ./logs/zip/wso2bpel-ext-%d{yyyy-MM-dd}.log.gz
+ archivedFileCount: 7
+ timeZone: UTC
+
diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat new file mode 100644 index 0000000..3e4e981 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/find_kill_process.bat @@ -0,0 +1,25 @@ +@REM
+@REM
+@REM Copyright 2016 [ZTE] and others.
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+echo %1 | findstr %2 >NUL
+echo ERRORLEVEL=%ERRORLEVEL%
+IF ERRORLEVEL 1 goto findend
+for /f "tokens=1" %%a in (%1) do (
+ echo kill %1
+ taskkill /F /pid %%a
+)
+:findend
\ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat new file mode 100644 index 0000000..5f6d093 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.bat @@ -0,0 +1,41 @@ +@REM
+@REM
+@REM Copyright 2016 [ZTE] and others.
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+title wso2bpel-service
+
+set RUNHOME=%~dp0
+echo ### RUNHOME: %RUNHOME%
+echo ### Starting wso2bpel-service
+
+set JAVA="%JAVA_HOME%\bin\java.exe"
+set port=8312
+set jvm_opts=-Xms50m -Xmx128m
+rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
+set class_path=%RUNHOME%;lib\*;%RUNHOME%wso2bpel-service.jar
+echo ### jvm_opts: %jvm_opts%
+echo ### class_path: %class_path%
+
+%JAVA% -classpath %class_path% %jvm_opts% org.openo.carbon.bpel.Wso2BpelApplication server %RUNHOME%conf/wso2bpel.yml
+
+IF ERRORLEVEL 1 goto showerror
+exit
+:showerror
+echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!
+echo After checking, press any key to close
+pause
+exit
\ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh new file mode 100644 index 0000000..6046356 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/run.sh @@ -0,0 +1,35 @@ +# +# +# Copyright 2016 [ZTE] and others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DIRNAME=`dirname $0` +RUNHOME=`cd $DIRNAME/; pwd` +echo @RUNHOME@ $RUNHOME + +echo @JAVA_HOME@ $JAVA_HOME +JAVA="$JAVA_HOME/bin/java" +echo @JAVA@ $JAVA + +JAVA_OPTS="-Xms50m -Xmx128m" +port=8312 +#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" +echo @JAVA_OPTS@ $JAVA_OPTS + +class_path="$RUNHOME/:dependency\*:$RUNHOME/wso2bpel-service.jar" +echo @class_path@ $class_path + +"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.carbon.bpel.Wso2BpelApplication server "$RUNHOME/conf/wso2bpel.yml" + diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat new file mode 100644 index 0000000..3d3e42a --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.bat @@ -0,0 +1,35 @@ +@REM
+@REM
+@REM Copyright 2016 [ZTE] and others.
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+title stopping wso2bpel-service
+
+set HOME=%~dp0
+set Main_Class="org.openo.carbon.bpel.Wso2BpelApplication"
+
+echo ================== wso2bpel-service info =============================================
+echo HOME=$HOME
+echo Main_Class=%Main_Class%
+echo ===============================================================================
+
+echo ### Stopping wso2bpel-service
+cd /d %HOME%
+
+for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do (
+ call find_kill_process "%%i" %Main_Class%
+)
+exit
\ No newline at end of file diff --git a/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh new file mode 100644 index 0000000..0b03b41 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/distribution/standalone/src/main/assembly/stop.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# +# +# Copyright 2016 [ZTE] and others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DIRNAME=`dirname $0` +HOME=`cd $DIRNAME/; pwd` +Main_Class="org.openo.carbon.bpel.Wso2BpelApplication" + +echo ================== wso2bpel-service info ============================================= +echo HOME=$HOME +echo Main_Class=$Main_Class +echo =============================================================================== +cd $HOME; pwd + +echo @WORK_DIR@ $HOME + +function save_service_pid(){ + service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'` + echo @service_pid@ $service_pid +} + +function kill_service_process(){ + ps -p $service_pid + if [ $? == 0 ]; then + kill -9 $service_pid + fi +} + +save_service_pid; +echo @C_CMD@ kill -9 $service_pid +kill_service_process; |