Skip to content

Instantly share code, notes, and snippets.

@ksekhar
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksekhar/8810751 to your computer and use it in GitHub Desktop.
Save ksekhar/8810751 to your computer and use it in GitHub Desktop.
#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"
j= JMXConnectorFactory.connect(url1, {"jmx.remote.credentials" => ["controlRole","foobar"].to_java(:string)}).getMBeanServerConnection
o = ObjectName.new("jboss.jca:name=FrengineDS,service=ManagedConnectionPool")
j.is_registered?(o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment