wsconsume.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/sh
  2. # Extract the directory and the program name
  3. # takes care of symlinks
  4. PRG="$0"
  5. while [ -h "$PRG" ] ; do
  6. ls=`ls -ld "$PRG"`
  7. link=`expr "$ls" : '.*-> \(.*\)$'`
  8. if expr "$link" : '/.*' > /dev/null; then
  9. PRG="$link"
  10. else
  11. PRG="`dirname "$PRG"`/$link"
  12. fi
  13. done
  14. DIRNAME=`dirname "$PRG"`
  15. PROGNAME=`basename "$PRG"`
  16. # OS specific support (must be 'true' or 'false').
  17. cygwin=false;
  18. case "`uname`" in
  19. CYGWIN*)
  20. cygwin=true
  21. ;;
  22. esac
  23. # For Cygwin, ensure paths are in UNIX format before anything is touched
  24. if $cygwin ; then
  25. [ -n "$JBOSS_HOME" ] &&
  26. JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
  27. [ -n "$JAVA_HOME" ] &&
  28. JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  29. fi
  30. # Setup JBOSS_HOME
  31. RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd`
  32. if [ "x$JBOSS_HOME" = "x" ]; then
  33. # get the full path (without any relative bits)
  34. JBOSS_HOME=$RESOLVED_JBOSS_HOME
  35. else
  36. SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
  37. if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
  38. echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
  39. echo ""
  40. fi
  41. fi
  42. export JBOSS_HOME
  43. # Setup the JVM
  44. if [ "x$JAVA" = "x" ]; then
  45. if [ "x$JAVA_HOME" != "x" ]; then
  46. JAVA="$JAVA_HOME/bin/java"
  47. else
  48. JAVA="java"
  49. fi
  50. fi
  51. #JPDA options. Uncomment and modify as appropriate to enable remote debugging .
  52. #JAVA_OPTS="-classic -Xdebug -Xnoagent -Djava.compiler=NONE -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=y $JAVA_OPTS"
  53. # Setup JBoss sepecific properties
  54. JAVA_OPTS="$JAVA_OPTS"
  55. # Setup classpath
  56. JBOSS_CLASSPATH=$JAVA_HOME/lib/tools.jar:$JBOSS_HOME/jboss-modules.jar
  57. # For Cygwin, switch paths to Windows format before running java
  58. if $cygwin; then
  59. JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
  60. JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  61. JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
  62. fi
  63. # Execute the command
  64. eval \"$JAVA\" $JAVA_OPTS \
  65. -classpath \"$JBOSS_CLASSPATH\" \
  66. org.jboss.modules.Main \
  67. -mp \"$JBOSS_HOME/modules\" \
  68. org.jboss.ws.tools.wsconsume \
  69. '"$@"'