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 (
commit acd6a2c1a64628d03ac9d5ed957935e7a0cc9da2
tree 1aebb52b796e773eed37308342d473fd0a5ca598
parent 40564b35d91d0d5c3bc535cd34e25fc927a12a65
tree 1aebb52b796e773eed37308342d473fd0a5ca598
parent 40564b35d91d0d5c3bc535cd34e25fc927a12a65
jmx-js /
| name | age | message | |
|---|---|---|---|
| |
.classpath | ||
| |
.gitignore | ||
| |
.project | ||
| |
META-INF/ | ||
| |
README | ||
| |
build.xml | ||
| |
examples/ | ||
| |
src/ | ||
| |
test/ |
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/]. == 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".








