[infinispan-commits] Infinispan SVN: r2636 - in branches/4.2.x: demos/ec2/src/main/resources and 4 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Oct 29 09:01:38 EDT 2010


Author: manik.surtani at jboss.com
Date: 2010-10-29 09:01:37 -0400 (Fri, 29 Oct 2010)
New Revision: 2636

Modified:
   branches/4.2.x/core/src/main/resources/importConfig.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-all.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-influenza.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-nucleotide.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-protein.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-query.sh
   branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-reader.sh
   branches/4.2.x/demos/gui/src/main/resources/runGuiDemo.sh
   branches/4.2.x/demos/lucene-directory-demo/src/main/resources/runLuceneDemo.sh
   branches/4.2.x/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
   branches/4.2.x/server/core/src/main/resources/startServer.sh
Log:
ISPN-747 - Ensure java executable is properly detected for different OSs and JDKs in all shell scripts

Modified: branches/4.2.x/core/src/main/resources/importConfig.sh
===================================================================
--- branches/4.2.x/core/src/main/resources/importConfig.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/core/src/main/resources/importConfig.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -17,4 +73,10 @@
    done
 fi
 CLASSPATH=${ISPN_HOME}/infinispan-core.jar:$CLASSPATH
-java -classpath $CLASSPATH org.infinispan.config.parsing.ConfigFilesConvertor ${*}
+
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CLASSPATH=`cygpath -wp ${CLASSPATH}`
+fi
+
+${JAVACMD} -classpath $CLASSPATH org.infinispan.config.parsing.ConfigFilesConvertor ${*}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-all.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-all.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-all.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -35,4 +91,9 @@
 DEMO_ARGS="${DEMO_ARGS} -n ${ISPN_HOME}/etc/Amazon-TestData/influenza_na.dat"
 DEMO_ARGS="${DEMO_ARGS} -i ${ISPN_HOME}/etc/Amazon-TestData/influenza.dat"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS} 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-influenza.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-influenza.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-influenza.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -31,4 +87,9 @@
 DEMO_ARGS="${DEMO_ARGS} -c ${ISPN_HOME}/etc/config-samples/ec2-demo/infinispan-ec2-config.xml"
 DEMO_ARGS="${DEMO_ARGS} -i ${ISPN_HOME}/etc/Amazon-TestData/influenza.dat"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS} 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-nucleotide.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-nucleotide.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-nucleotide.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -31,4 +87,9 @@
 DEMO_ARGS="${DEMO_ARGS} -c ${ISPN_HOME}/etc/config-samples/ec2-demo/infinispan-ec2-config.xml"
 DEMO_ARGS="${DEMO_ARGS} -n ${ISPN_HOME}/etc/Amazon-TestData/influenza_na.dat"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS} 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-protein.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-protein.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-protein.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -31,4 +87,9 @@
 DEMO_ARGS="${DEMO_ARGS} -c ${ISPN_HOME}/etc/config-samples/ec2-demo/infinispan-ec2-config.xml"
 DEMO_ARGS="${DEMO_ARGS} -p ${ISPN_HOME}/etc/Amazon-TestData/influenza_aa.dat"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS} 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-query.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-query.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-query.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -27,4 +83,9 @@
 DEMO_ARGS="${DEMO_ARGS} -c ${ISPN_HOME}/etc/config-samples/ec2-demo/infinispan-ec2-config.xml"
 DEMO_ARGS="${DEMO_ARGS} -q "
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS} 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-reader.sh
===================================================================
--- branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-reader.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/ec2/src/main/resources/runEC2Demo-reader.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -2,6 +2,62 @@
 
 DIRNAME=`dirname $0`
 
+# 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
+
+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
+
 # Setup ISPN_HOME
 if [ "x$ISPN_HOME" = "x" ]; then
     # get the full path (without any relative bits)
@@ -28,4 +84,9 @@
 DEMO_ARGS="${DEMO_ARGS} -r "
 DEMO_ARGS="${DEMO_ARGS} -i ${ISPN_HOME}/etc/Amazon-TestData/influenza.dat"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.ec2demo.InfinispanFluDemo ${DEMO_ARGS}

Modified: branches/4.2.x/demos/gui/src/main/resources/runGuiDemo.sh
===================================================================
--- branches/4.2.x/demos/gui/src/main/resources/runGuiDemo.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/gui/src/main/resources/runGuiDemo.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -8,15 +8,64 @@
   done
 }
 
-DIRNAME=`dirname $0`
-
-# Detect Cygwin
-# Cygwin fix courtesy of Supin Ko
-cygwin=false
+# OS specific support.
+cygwin=false;
+darwin=false;
+mingw=false
 case "`uname`" in
-CYGWIN*) cygwin=true;;
+  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
 
+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)
@@ -44,4 +93,4 @@
 # Sample JPDA settings for remote socket debuging
 #JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.demo.InfinispanDemo &
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.demo.InfinispanDemo &

Modified: branches/4.2.x/demos/lucene-directory-demo/src/main/resources/runLuceneDemo.sh
===================================================================
--- branches/4.2.x/demos/lucene-directory-demo/src/main/resources/runLuceneDemo.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/demos/lucene-directory-demo/src/main/resources/runLuceneDemo.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -1,5 +1,61 @@
 #!/bin/bash
 
+# 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
+
+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
@@ -23,9 +79,14 @@
    CP=${i}:${CP}
 done
 
+if $cygwin; then
+   # Turn paths into Windows style for Cygwin
+   CP=`cygpath -wp ${CP}`
+fi
+
 JVM_PARAMS="${JVM_PARAMS} -Dbind.address=127.0.0.1 -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${ISPN_HOME}/etc/log4j.xml"
 
 # Sample JPDA settings for remote socket debugging
 #JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
 
-java -cp ${CP} ${JVM_PARAMS} org.infinispan.lucenedemo.DemoDriver
+${JAVACMD} -cp ${CP} ${JVM_PARAMS} org.infinispan.lucenedemo.DemoDriver

Modified: branches/4.2.x/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/4.2.x/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2010-10-29 13:01:37 UTC (rev 2636)
@@ -27,13 +27,13 @@
                 </c:template>
             </plugin-configuration>
 
-           <operation name="startCache" displayName="Starts the default cache" description="Starts the default cache associated with this cache manager">
-           </operation>
            <operation name="startCacheWithCacheName" displayName="Starts a cache with the given name" description="Starts a named cache from this cache manager">
               <parameters>
                  <c:simple-property name="cacheName" description="Name of cache to start"/>
               </parameters>
            </operation>
+           <operation name="startCache" displayName="Starts the default cache" description="Starts the default cache associated with this cache manager">
+           </operation>
 
            <metric property="Name" displayName="Cache manager name" displayType="summary" units="none" dataType="trait"
                    description="The name of this cache manager" />
@@ -61,42 +61,37 @@
           >
 
 
-           <operation name="Transactions.resetStatistics" displayName="[Transactions] Reset Statistics" description="Resets statistics gathered by this component">
+           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Transactions.setStatisticsEnabled" displayName="[Transactions] Enable/disable statistics" description="Enable/disable statistics">
+           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
               <parameters>
                  <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="RpcManager.resetStatistics" displayName="[RpcManager] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="Transactions.resetStatistics" displayName="[Transactions] Reset Statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="RpcManager.setStatisticsEnabled" displayName="[RpcManager] Enable/disable statistics" description="Enable/disable statistics">
+           <operation name="Transactions.setStatisticsEnabled" displayName="[Transactions] Enable/disable statistics" description="Enable/disable statistics">
               <parameters>
                  <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="Activation.resetStatistics" displayName="[Activation] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
-           </operation>
            <operation name="DeadlockDetectingLockManager.resetStatistics" displayName="[DeadlockDetectingLockManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
-           </operation>
-           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
-              <parameters>
-                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
-              </parameters>
-           </operation>
            <operation name="Statistics.resetStatistics" displayName="[Statistics] Reset Statistics (Statistics)" description="Resets statistics gathered by this component">
            </operation>
            <operation name="Cache.start" displayName="[Cache] Starts cache." description="Starts the cache.">
            </operation>
            <operation name="Cache.stop" displayName="[Cache] Stops cache." description="Stops the cache.">
            </operation>
-           <operation name="DistributionManager.isAffectedByRehash" displayName="[DistributionManager] Could key be affected by reshah?" description="Determines whether a given key is affected by an ongoing rehash, if any.">
+           <operation name="Activation.resetStatistics" displayName="[Activation] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
+           <operation name="DistributionManager.isAffectedByRehash" displayName="[DistributionManager] Could key be affected by rehash?" description="Determines whether a given key is affected by an ongoing rehash, if any.">
               <parameters>
                  <c:simple-property name="key" description="Key to check"/>
               </parameters>
@@ -120,9 +115,32 @@
                  <c:simple-property name="operationResult" />
               </results>
            </operation>
-           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="RpcManager.resetStatistics" displayName="[RpcManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
+           <operation name="RpcManager.setStatisticsEnabled" displayName="[RpcManager] Enable/disable statistics" description="Enable/disable statistics">
+              <parameters>
+                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
+              </parameters>
+           </operation>
 
+           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries loaded from cache store" />
+           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries that did not exist in cache store" />
+           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
+                   description="number of cache loader stores" />
+           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of passivation events" />
+           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
+           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of invalidations" />
+           <metric property="LockManager.ConcurrencyLevel" displayName="[LockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
+                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
+           <metric property="LockManager.NumberOfLocksHeld" displayName="[LockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are held." />
+           <metric property="LockManager.NumberOfLocksAvailable" displayName="[LockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are available." />
            <metric property="Transactions.StatisticsEnabled" displayName="[Transactions] Statistics enabled" displayType="detail" units="none" dataType="trait"
                    description="Statistics enabled" />
            <metric property="Transactions.Prepares" displayName="[Transactions] Prepares" displayType="summary" units="none" dataType="measurement"
@@ -131,56 +149,22 @@
                    description="Number of transaction commits performed since last reset" />
            <metric property="Transactions.Rollbacks" displayName="[Transactions] Rollbacks" displayType="summary" units="none" dataType="measurement"
                    description="Number of transaction rollbacks performed since last reset" />
-           <metric property="RpcManager.Members" displayName="[RpcManager] Cluster members" displayType="summary" units="none" dataType="trait"
-                   description="List of members in the cluster" />
-           <metric property="RpcManager.StatisticsEnabled" displayName="[RpcManager] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="RpcManager.ReplicationCount" displayName="[RpcManager] Number of successfull replications" displayType="summary" units="none" dataType="measurement"
-                   description="Number of successful replications" />
-           <metric property="RpcManager.ReplicationFailures" displayName="[RpcManager] Number of failed replications" displayType="summary" units="none" dataType="measurement"
-                   description="Number of failed replications" />
-           <metric property="RpcManager.NodeAddress" displayName="[RpcManager] Network address" displayType="summary" units="none" dataType="trait"
-                   description="The network address associated with this instance" />
-           <metric property="RpcManager.PhysicalAddresses" displayName="[RpcManager] Physical network addresses" displayType="summary" units="none" dataType="trait"
-                   description="The physical network addresses associated with this instance" />
-           <metric property="RpcManager.ClusterSize" displayName="[RpcManager] Cluster size" displayType="summary" units="none" dataType="measurement"
-                   description="Size of the cluster in number of nodes" />
-           <metric property="RpcManager.SuccessRatioFloatingPoint" displayName="[RpcManager] Successful replication ratio" displayType="summary" units="percentage" dataType="measurement"
-                   description="Successful replications as a ratio of total replications in numeric double format" />
-           <metric property="RpcManager.AverageReplicationTime" displayName="[RpcManager] Average time spent in the transport layer" displayType="summary" units="milliseconds" dataType="measurement"
-                   description="The average time spent in the transport layer, in milliseconds" />
-           <metric property="Activation.Activations" displayName="[Activation] Number of cache entries activated" displayType="detail" units="none" dataType="measurement"
-                   description="Number of activation events" />
-           <metric property="Activation.CacheLoaderLoads" displayName="[Activation] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries loaded from cache store" />
-           <metric property="Activation.CacheLoaderMisses" displayName="[Activation] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries that did not exist in cache store" />
-           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries loaded from cache store" />
-           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries that did not exist in cache store" />
+           <metric property="DeadlockDetectingLockManager.TotalNumberOfDetectedDeadlocks" displayName="[DeadlockDetectingLockManager] Number of total detected deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Total number of local detected deadlocks" />
+           <metric property="DeadlockDetectingLockManager.DetectedRemoteDeadlocks" displayName="[DeadlockDetectingLockManager] Number of remote transaction that were roll backed due to deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Number of remote transaction that were roll backed due to deadlocks" />
+           <metric property="DeadlockDetectingLockManager.DetectedLocalDeadlocks" displayName="[DeadlockDetectingLockManager] Number of local transaction that were roll backed due to deadlocks" displayType="detail" units="none" dataType="measurement"
+                   description="Number of local transaction that were roll backed due to deadlocks" />
            <metric property="DeadlockDetectingLockManager.OverlapWithNotDeadlockAwareLockOwners" displayName="[DeadlockDetectingLockManager] Number of unsolvable deadlock situations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of situtations when we try to determine a deadlock and the other lock owner is e.g. a local tx. In this scenario we cannot run the deadlock detection mechanism" />
+                   description="Number of situations when we try to determine a deadlock and the other lock owner is NOT a transaction. In this scenario we cannot run the deadlock detection mechanism" />
            <metric property="DeadlockDetectingLockManager.LocallyInterruptedTransactions" displayName="[DeadlockDetectingLockManager] Number of interrupted local transactions" displayType="detail" units="none" dataType="measurement"
                    description="Number of locally originated transactions that were interrupted as a deadlock situation was detected" />
-           <metric property="DeadlockDetectingLockManager.DetectedRemoteDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected remote deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Number of remote deadlocks detected" />
-           <metric property="DeadlockDetectingLockManager.DetectedLocalDeadlocks" displayName="[DeadlockDetectingLockManager] Number of detected local deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Number of local detected deadlocks" />
-           <metric property="DeadlockDetectingLockManager.TotalNumberOfDetectedDeadlocks" displayName="[DeadlockDetectingLockManager] Number of total detected deadlocks" displayType="detail" units="none" dataType="measurement"
-                   description="Total number of local detected deadlocks" />
            <metric property="DeadlockDetectingLockManager.ConcurrencyLevel" displayName="[DeadlockDetectingLockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
                    description="The concurrency level that the MVCC Lock Manager has been configured with." />
            <metric property="DeadlockDetectingLockManager.NumberOfLocksHeld" displayName="[DeadlockDetectingLockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
                    description="The number of exclusive locks that are held." />
            <metric property="DeadlockDetectingLockManager.NumberOfLocksAvailable" displayName="[DeadlockDetectingLockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
                    description="The number of exclusive locks that are available." />
-           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
-                   description="number of cache loader stores" />
-           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of invalidations" />
            <metric property="Statistics.Hits" displayName="[Statistics] Number of cache hits" displayType="summary" units="none" dataType="measurement"
                    description="Number of cache attribute hits" />
            <metric property="Statistics.Misses" displayName="[Statistics] Number of cache misses" displayType="summary" units="none" dataType="measurement"
@@ -211,18 +195,34 @@
                    description="Returns the cache status" />
            <metric property="Cache.CacheName" displayName="[Cache] Cache name" displayType="summary" units="none" dataType="trait"
                    description="Returns the cache name" />
+           <metric property="Activation.Activations" displayName="[Activation] Number of cache entries activated" displayType="detail" units="none" dataType="measurement"
+                   description="Number of activation events" />
+           <metric property="Activation.CacheLoaderLoads" displayName="[Activation] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries loaded from cache store" />
+           <metric property="Activation.CacheLoaderMisses" displayName="[Activation] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries that did not exist in cache store" />
            <metric property="DistributionManager.RehashInProgress" displayName="[DistributionManager] Is rehash in progress?" displayType="detail" units="none" dataType="trait"
                    description="Checks whether the node is involved in a rehash." />
            <metric property="DistributionManager.JoinComplete" displayName="[DistributionManager] Is join completed?" displayType="detail" units="none" dataType="trait"
                    description="If true, the node has successfully joined the grid and is considered to hold state.  If false, the join process is still in progress." />
-           <metric property="LockManager.ConcurrencyLevel" displayName="[LockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
-                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
-           <metric property="LockManager.NumberOfLocksHeld" displayName="[LockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are held." />
-           <metric property="LockManager.NumberOfLocksAvailable" displayName="[LockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are available." />
-           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of passivation events" />
+           <metric property="RpcManager.Members" displayName="[RpcManager] Cluster members" displayType="summary" units="none" dataType="trait"
+                   description="List of members in the cluster" />
+           <metric property="RpcManager.StatisticsEnabled" displayName="[RpcManager] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
+           <metric property="RpcManager.ReplicationCount" displayName="[RpcManager] Number of successful replications" displayType="summary" units="none" dataType="measurement"
+                   description="Number of successful replications" />
+           <metric property="RpcManager.ReplicationFailures" displayName="[RpcManager] Number of failed replications" displayType="summary" units="none" dataType="measurement"
+                   description="Number of failed replications" />
+           <metric property="RpcManager.NodeAddress" displayName="[RpcManager] Network address" displayType="summary" units="none" dataType="trait"
+                   description="The network address associated with this instance" />
+           <metric property="RpcManager.PhysicalAddresses" displayName="[RpcManager] Physical network addresses" displayType="summary" units="none" dataType="trait"
+                   description="The physical network addresses associated with this instance" />
+           <metric property="RpcManager.ClusterSize" displayName="[RpcManager] Cluster size" displayType="summary" units="none" dataType="measurement"
+                   description="Size of the cluster in number of nodes" />
+           <metric property="RpcManager.SuccessRatioFloatingPoint" displayName="[RpcManager] Successful replication ratio" displayType="summary" units="percentage" dataType="measurement"
+                   description="Successful replications as a ratio of total replications in numeric double format" />
+           <metric property="RpcManager.AverageReplicationTime" displayName="[RpcManager] Average time spent in the transport layer" displayType="summary" units="milliseconds" dataType="measurement"
+                   description="The average time spent in the transport layer, in milliseconds" />
 
 
        </service>

Modified: branches/4.2.x/server/core/src/main/resources/startServer.sh
===================================================================
--- branches/4.2.x/server/core/src/main/resources/startServer.sh	2010-10-29 12:55:19 UTC (rev 2635)
+++ branches/4.2.x/server/core/src/main/resources/startServer.sh	2010-10-29 13:01:37 UTC (rev 2636)
@@ -10,6 +10,68 @@
   fi
 }
 
+# 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
+
+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
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+fi
+
 DIRNAME=`dirname $0`
 
 # Setup ISPN_HOME
@@ -19,13 +81,6 @@
 fi
 export ISPN_HOME
 
-# Detect Cygwin
-# Cygwin fix courtesy of Supin Ko
-cygwin=false
-case "`uname`" in
-CYGWIN*) cygwin=true;;
-esac
-
 add_to_classpath ${ISPN_HOME}
 add_to_classpath ${ISPN_HOME}/lib
 add_to_classpath ${ISPN_HOME}/modules/memcached
@@ -48,4 +103,4 @@
 # Sample JPDA settings for remote socket debuging
 #JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
 
-java -cp $CP ${JVM_PARAMS} org.infinispan.server.core.Main ${*}
\ No newline at end of file
+${JAVACMD} -cp $CP ${JVM_PARAMS} org.infinispan.server.core.Main ${*}
\ No newline at end of file



More information about the infinispan-commits mailing list