This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
jmx-js /
| name | age | message | |
|---|---|---|---|
| |
.classpath | Mon Aug 11 11:06:31 -0700 2008 | |
| |
.gitignore | Mon Aug 11 11:06:31 -0700 2008 | |
| |
.project | Mon Aug 11 11:06:31 -0700 2008 | |
| |
META-INF/ | Mon Aug 11 11:06:31 -0700 2008 | |
| |
README | Mon Aug 11 12:17:33 -0700 2008 | |
| |
build.xml | Mon Aug 11 11:27:20 -0700 2008 | |
| |
examples/ | Mon Aug 11 11:06:31 -0700 2008 | |
| |
src/ | Mon Aug 11 11:29:34 -0700 2008 | |
| |
test/ | Mon Aug 11 11:06:31 -0700 2008 |
README
jmx4r is a JavaScript bridge for JMX It can be used to write simple JavaScripts to manage remote Java applications (e.g. JBoss[http://www.jboss.org], Tomcat[http://tomcat.apache.org/]) using JMX[http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/]. == Requirements This bridge works only on Java 6 with a JavaScript engine. This is the case by default for Sun's JVM on Linux and Windows. For Mac OS X, there are additional steps[http://jmesnil.net/weblog/2008/05/14/how-to-include-javascript-engine-in-apples-java-6-vm/]. == Examples To trigger a garbage collection on a Java application: 1. Create a file "memory.js". var memory = mbsc.getMBean('java.lang:type=Memory'); memory.gc(); print("after gc: " + memory.heapMemoryUsage.get("used")); 2. Run the script to trigger a GC on a remote Java application: java -jar jmx-js.jar memory.js -h node1 -p 3000 memory.js This expects the remote Java application running on node1 to accept remote JMX connection on the port 3000. == How to build 1. Retrieve the project: git clone git://github.com/jmesnil/jmx-js.git cd jmx-js 2. Build the jar ant jar 3. Run the example java -jar jmx-js.jar examples/memory.js == How to write scripts * An object "mbsc" can be used to retrieve MBean: var mbean = mbsc.getMBean('java.lang:type=Memory'); or var mbeans = mbsc.getMBeans('java.lang:type=MemoryPool,*'); * An object "args" contains all the remaning arguments passed on the command line after removing the file name and the optional host and port. For example, if the script is run with "java -jar jmx-js.jar logging.js -p 3000 FINEST", in the script, args[0] is set to "FINEST".







