[jboss-svn-commits] JBL Code SVN: r29687 - labs/jbosstm/workspace/adinn/byteman/trunk/bin.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Oct 20 08:34:13 EDT 2009


Author: adinn
Date: 2009-10-20 08:34:13 -0400 (Tue, 20 Oct 2009)
New Revision: 29687

Modified:
   labs/jbosstm/workspace/adinn/byteman/trunk/bin/bmjava.sh
Log:
enabled injection into java.lang by default when using bmjava.sh command script -- fixes BYTEMAN-51

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/bin/bmjava.sh
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/bin/bmjava.sh	2009-10-20 12:32:22 UTC (rev 29686)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/bin/bmjava.sh	2009-10-20 12:34:13 UTC (rev 29687)
@@ -53,7 +53,7 @@
 usage()
 {
 cat <<EOF
-usage: bmjava [-l rulescript | -b bootjar | -s sysjar | -nl | -nb ]* [--] javaargs
+usage: bmjava [-l rulescript | -b bootjar | -s sysjar | -nl | -nb | -nj ]* [--] javaargs
 
 terms enclosed between [ ] are optional
 terms separated by | are alternatives
@@ -73,6 +73,8 @@
   -nb  do not add the byteman jar to the bootstrap classpath (it is
        added by default)
 
+  -nj  do not inject into java.lang classes (it is enabled by default)
+
   --  optional separator to distinguish trailing arguments
 
   javaargs  trailing arguments to be supplied to the java command
@@ -115,11 +117,11 @@
 # default is to use listener and add byteman jar to bootstrap classpath
 LISTENER=1
 BYTEMAN_BOOT_JAR=1
+INJECT_JAVA_LANG=1
 
 # hmm. the asm code should be bundled in the byteman jar?
 #CP=${CP}:${BYTEMAN_HOME}/ext/asm-all-3.0.jar
 
-echo "\$# == $#" 
 while [ $# -ge 1 -a "${1#-*}" != "$1" ]
 do
     if [ "$1" == "-l" -a $# -ge 2 ]; then
@@ -155,6 +157,9 @@
     elif [ "$1" == "-nb" ]; then
 	    BYTEMAN_BOOT_JAR=0
 	    shift;
+    elif [ "$1" == "-nj" ]; then
+	    INJECT_JAVA_LANG=0
+	    shift;
     elif [ "$1" == "--" ]; then
 	    shift;
 	    break;
@@ -174,9 +179,15 @@
     AGENT_OPTS="listener:false$AGENT_OPTS"
 fi
 
+if [ $INJECT_JAVA_LANG -eq 1 ]; then
+    INJECT_JAVA_LANG_OPTS="-Dorg.jboss.byteman.quodlibet"
+else
+    INJECT_JAVA_LANG_OPTS=""
+fi
+
 AGENT_ARGUMENT=${AGENT_PREFIX}=${AGENT_OPTS}
 
 # allow for extra java opts via setting BYTEMAN_JAVA_OPTS
 
-exec java ${BYTEMAN_JAVA_OPTS} ${AGENT_ARGUMENT} $*
+exec java ${BYTEMAN_JAVA_OPTS} ${AGENT_ARGUMENT} ${INJECT_JAVA_LANG_OPTS} $*
 



More information about the jboss-svn-commits mailing list