You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2016/05/13 15:14:40 UTC

incubator-taverna-commandline git commit: TAVERNA-968 Support Taverna Server's system environment variables

Repository: incubator-taverna-commandline
Updated Branches:
  refs/heads/master 78810e14c -> eb9f6d5ab


TAVERNA-968 Support Taverna Server's system environment variables


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/commit/eb9f6d5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/tree/eb9f6d5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/diff/eb9f6d5a

Branch: refs/heads/master
Commit: eb9f6d5ab0d0062f3502545e5ba5e24658f7f26e
Parents: 78810e1
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri May 13 16:07:42 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri May 13 16:14:34 2016 +0100

----------------------------------------------------------------------
 .../src/main/etc/executeworkflow.bat            | 11 ++++
 .../src/main/etc/executeworkflow.sh             | 57 ++++++++++++++++++--
 2 files changed, 64 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/blob/eb9f6d5a/taverna-commandline-product/src/main/etc/executeworkflow.bat
----------------------------------------------------------------------
diff --git a/taverna-commandline-product/src/main/etc/executeworkflow.bat b/taverna-commandline-product/src/main/etc/executeworkflow.bat
index 1a616f6..14c6818 100644
--- a/taverna-commandline-product/src/main/etc/executeworkflow.bat
+++ b/taverna-commandline-product/src/main/etc/executeworkflow.bat
@@ -28,9 +28,20 @@ REM Taverna system properties
 set ARGS=%ARGS% "-Dlog4j.configuration=file:///%TAVERNA_HOME%conf/log4j.properties"
 set ARGS=%ARGS% "-Djava.util.logging.config.file=%TAVERNA_HOME%conf/logging.properties"
 set ARGS=%ARGS% "-Dtaverna.app.startup=%TAVERNA_HOME%."
+set ARGS=%ARGS% -Djava.awt.headless=true
+
+IF NOT x%TAVERNA_APPHOME%==x SET ARGS=%ARGS% "-Dtaverna.app.home=%TAVERNA_APPHOME%"
+IF NOT x%TAVERNA_RUN_ID%==x SET ARGS=%ARGS% "-Dtaverna.runid=%TAVERNA_RUN_ID%"
+IF NOT x%INTERACTION_HOST%==x SET ARGS=%ARGS% "-Dtaverna.interaction.host=%INTERACTION_HOST%"
+IF NOT x%INTERACTION_PORT%==x SET ARGS=%ARGS% "-Dtaverna.interaction.port=%INTERACTION_PORT%"
+IF NOT x%INTERACTION_WEBDAV%==x SET ARGS=%ARGS% "-Dtaverna.interaction.webdav_path=%INTERACTION_WEBDAV%"
+IF NOT x%INTERACTION_FEED%==x SET ARGS=%ARGS% "-Dtaverna.interaction.feed_path=%INTERACTION_FEED%"
+
+
 
 set JAR="%TAVERNA_HOME%lib/org.apache.taverna.commandline/taverna-commandline-launcher-3.1.0-incubating.jar"
 REM find *.launcher jar
 for %%f in ("%TAVERNA_HOME%lib\org.apache.taverna.commandline\taverna-commandline-launcher*.jar") DO set JAR="%%f"
 REM echo %JAR%
+
 java %ARGS% -jar %JAR% %*

http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/blob/eb9f6d5a/taverna-commandline-product/src/main/etc/executeworkflow.sh
----------------------------------------------------------------------
diff --git a/taverna-commandline-product/src/main/etc/executeworkflow.sh b/taverna-commandline-product/src/main/etc/executeworkflow.sh
index cabb8ab..f1ee235 100644
--- a/taverna-commandline-product/src/main/etc/executeworkflow.sh
+++ b/taverna-commandline-product/src/main/etc/executeworkflow.sh
@@ -15,9 +15,31 @@
 ##  See the License for the specific language governing permissions and
 ##  limitations under the License.
 
+# 1 GB memory
+memlimit=-Xmx1g
+
 
 set -e
 
+## Parse the command line to extract the pieces to move around to before or
+## after the JAR filename...
+pre=-Djava.awt.headless=true
+post=
+for arg
+do
+    case $arg in
+        -JXmx*) memlimit=`echo $arg | sed 's/-JX/-X/'` ;;
+        -JXX:MaxPermSize=*) permsize=`echo $arg | sed 's/-JXX/-XX/'` ;;
+        -J*) pre="$pre `echo $arg | sed 's/-J/-/'`" ;;
+        -D*) pre="$pre $arg" ;;
+        *) post="$post \"$arg\"" ;;
+    esac
+done
+eval set x $post
+shift
+
+
+
 ## resolve links - $0 may be a symlink
 prog="$0"
 
@@ -32,10 +54,37 @@ if test -x "$JAVA_HOME/bin/java"; then
     javabin="$JAVA_HOME/bin/java"
 fi
 
-# 1 GB memory
-exec "$javabin" -Xmx1g \
+
+APPHOME_PROP=
+if test x != "x$TAVERNA_APPHOME"; then
+    APPHOME_PROP="-Dtaverna.app.home=$TAVERNA_APPHOME"
+fi  
+RUNID_PROP=
+if test x != "x$TAVERNA_RUN_ID"; then
+    RUNID_PROP="-Dtaverna.runid=$TAVERNA_RUN_ID"
+fi  
+INTERACTION_PROPS=-Dtaverna.interaction.ignore_requests=true
+if test x != "x$INTERACTION_HOST"; then
+    INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.host=$INTERACTION_HOST"
+    INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.port=$INTERACTION_PORT"
+    INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.webdav_path=$INTERACTION_WEBDAV"
+    INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.feed_path=$INTERACTION_FEED"
+    if test x != "x$INTERACTION_PUBLISH"; then
+        INTERACTION_PROPS="$INTERACTION_PROPS -Dtaverna.interaction.publishAddressOverride=$INTERACTION_PUBLISH"
+    fi
+fi  
+
+
+jar=`echo -n "$taverna_home"/lib/org.apache.taverna.commandline/taverna-commandline-launcher-*.jar`
+
+echo "pid:$$"
+
+exec "$javabin" $memlimit $permsize \
   "-Dlog4j.configuration=file://$taverna_home/conf/log4j.properties " \
   "-Djava.util.logging.config.file=$taverna_home/conf/logging.properties " \
-  "-Dtaverna.app.startup=$taverna_home" \
-  -jar "$taverna_home/lib/org.apache.taverna.commandline/taverna-commandline-launcher-3.1.0-incubating-SNAPSHOT.jar" \
+  "-Dtaverna.app.startup=$taverna_home" -Dtaverna.interaction.ignore_requests=true \
+  $APPHOME_PROP $RUNID_PROP $INTERACTION_PROPS -Djava.awt.headless=true \
+  -Dcom.sun.net.ssl.enableECC=false -Djsse.enableSNIExtension=false $pre \
+  -jar "$jar" \
   ${1+"$@"}
+