Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ISPN-1875 Fix demo scripts and add remote jmx port allocation

  • Loading branch information...
commit 646a45cdf1def952cf7ba41b8faf0f502f5121c4 1 parent da69e47
Galder Zamarreño galderz authored maniksurtani committed
109 demos/distexec/src/main/resources/runPiApproximationDemo.sh
View
@@ -1,103 +1,22 @@
#!/bin/bash
-add_to_classpath()
-{
- DIR=${1}
- for i in ${DIR}/*.jar ; do
- CP=${CP}:${i}
- done
-}
+source "`dirname "$0"`/functions.sh"
-# OS specific support.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- if [ -z "$JAVA_VERSION" ] ; then
- JAVA_VERSION="CurrentJDK"
- else
- echo "Using Java version: $JAVA_VERSION"
- fi
- if [ -z "$JAVA_HOME" ] ; then
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
- fi
- ;;
-esac
+add_classpath "${ISPN_HOME}"/*.jar
+add_classpath "${ISPN_HOME}/lib"
+add_classpath "${ISPN_HOME}/modules/demos/distexec"
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly."
- echo " We cannot execute $JAVACMD"
- exit 1
-fi
-
-DIRNAME=`dirname $0`
-
-# Setup ISPN_HOME
-if [ "x$ISPN_HOME" = "x" ]; then
- # get the full path (without any relative bits)
- ISPN_HOME=`cd $DIRNAME/..; pwd`
-fi
-export ISPN_HOME
-
-CP=${CP}:${ISPN_HOME}/etc:${ISPN_HOME}/etc/config-samples/distexec-demo
-
-
-add_to_classpath ${ISPN_HOME}
-add_to_classpath ${ISPN_HOME}/lib
-add_to_classpath ${ISPN_HOME}/modules/demos/distexec
-add_to_classpath ${ISPN_HOME}/modules/demos/distexec/lib
-
-if $cygwin; then
- # Turn paths into Windows style for Cygwin
- CP=`cygpath -wp ${CP}`
- LOG4J_CONFIG=`cygpath -w ${ISPN_HOME}/etc/log4j.xml`
-else
- LOG4J_CONFIG=${ISPN_HOME}/etc/log4j.xml
-fi
-
-JVM_PARAMS="${JVM_PARAMS} -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${LOG4J_CONFIG}"
+add_jvm_args $JVM_PARAMS
+add_jvm_args '-Djava.net.preferIPv4Stack=true'
# RHQ monitoring options
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.ssl=false"
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.authenticate=false"
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.port=6996"
+add_jvm_args '-Dcom.sun.management.jmxremote.ssl=false'
+add_jvm_args '-Dcom.sun.management.jmxremote.authenticate=false'
+add_jvm_args -Dcom.sun.management.jmxremote.port=$(find_tcp_port)
+
+# Sample JPDA settings for remote socket debugging
+#add_jvm_args "-Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
-# Sample JPDA settings for remote socket debuging
-#JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
-#echo Classpath is $CP
+add_program_args $@
-${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.demo.distexec.PiApproximationDemo "$@"
+start org.infinispan.demo.distexec.PiApproximationDemo
109 demos/distexec/src/main/resources/runWordCountDemo.sh
View
@@ -1,103 +1,22 @@
#!/bin/bash
-add_to_classpath()
-{
- DIR=${1}
- for i in ${DIR}/*.jar ; do
- CP=${CP}:${i}
- done
-}
+source "`dirname "$0"`/functions.sh"
-# OS specific support.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- if [ -z "$JAVA_VERSION" ] ; then
- JAVA_VERSION="CurrentJDK"
- else
- echo "Using Java version: $JAVA_VERSION"
- fi
- if [ -z "$JAVA_HOME" ] ; then
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
- fi
- ;;
-esac
+add_classpath "${ISPN_HOME}"/*.jar
+add_classpath "${ISPN_HOME}/lib"
+add_classpath "${ISPN_HOME}/modules/demos/distexec"
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly."
- echo " We cannot execute $JAVACMD"
- exit 1
-fi
-
-DIRNAME=`dirname $0`
-
-# Setup ISPN_HOME
-if [ "x$ISPN_HOME" = "x" ]; then
- # get the full path (without any relative bits)
- ISPN_HOME=`cd $DIRNAME/..; pwd`
-fi
-export ISPN_HOME
-
-CP=${CP}:${ISPN_HOME}/etc:${ISPN_HOME}/etc/config-samples/distexec-demo
-
-
-add_to_classpath ${ISPN_HOME}
-add_to_classpath ${ISPN_HOME}/lib
-add_to_classpath ${ISPN_HOME}/modules/demos/distexec
-add_to_classpath ${ISPN_HOME}/modules/demos/distexec/lib
-
-if $cygwin; then
- # Turn paths into Windows style for Cygwin
- CP=`cygpath -wp ${CP}`
- LOG4J_CONFIG=`cygpath -w ${ISPN_HOME}/etc/log4j.xml`
-else
- LOG4J_CONFIG=${ISPN_HOME}/etc/log4j.xml
-fi
-
-JVM_PARAMS="${JVM_PARAMS} -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${LOG4J_CONFIG}"
+add_jvm_args $JVM_PARAMS
+add_jvm_args '-Djava.net.preferIPv4Stack=true'
# RHQ monitoring options
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.ssl=false"
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.authenticate=false"
-#JVM_PARAMS="$JVM_PARAMS -Dcom.sun.management.jmxremote.port=6996"
+add_jvm_args '-Dcom.sun.management.jmxremote.ssl=false'
+add_jvm_args '-Dcom.sun.management.jmxremote.authenticate=false'
+add_jvm_args -Dcom.sun.management.jmxremote.port=$(find_tcp_port)
+
+# Sample JPDA settings for remote socket debugging
+#add_jvm_args "-Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
-# Sample JPDA settings for remote socket debuging
-#JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
-#echo Classpath is $CP
+add_program_args $@
-${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.demo.mapreduce.WordCountDemo "$@"
+start org.infinispan.demo.mapreduce.WordCountDemo
Please sign in to comment.
Something went wrong with that request. Please try again.