View twiddle_jruby.rb
require 'lib/jar/getopt.jar'
require 'lib/jar/twiddle.jar'
java_import 'gnu.getopt.Getopt'
java_import 'java.lang.System'
java_import 'gnu.getopt.LongOpt'
java_import org.jboss.console.twiddle.Twiddle
java_import java.io.PrintWriter
args = "-s hostname -u admin -p admin set MBEAN_NAME ATTRIBUTE 25"
args = args.to_java(:string).split(" ").to_java
View jmx_jruby_test.rb
#from the deployed directory WEB-INF
#`which java` -client -Xbootclasspath/a:lib/jruby-complete-1.6.2.jar -Djruby.shell=/bin/sh org.jruby.Main script/console production
java_import javax.management.Attribute
java_import javax.management.MBeanServerFactory
java_import javax.management.remote.JMXConnectorFactory
java_import javax.management.remote.JMXServiceURL
java_import javax.management.ObjectName
url = "service:jmx:rmi:///jndi/rmi://hostname:1111/jmxrmi"
url1 = JMXServiceURL.new(url)
url_path = "/jmxrmi"
View run_sp.rb
require 'java'
require 'ojdbc-6.jar'
java_import "java.sql.Types"
java_import "oracle.jdbc.OracleTypes"
USER_ID = "12345"
WORKSPACE_ID = "222"
DOMAIN_ID = "X_1_1"