0N/AJTop monitors the CPU usage of all threads in a remote application
0N/Awhich has remote management enabled. JTop demonstrates the use of
0N/Athe java.lang.management API to obtain the CPU consumption for
0N/Aeach thread.
0N/A
0N/AJTop is also a JConsole Plugin. See below for details.
0N/A
0N/AJTop Standalone GUI
0N/A===================
0N/A
0N/AJTop first establishes a connection to a JMX agent in a remote
0N/Aapplication with a JMX service URL:
0N/A service:jmx:rmi:///jndi/rmi://<hostName>:<portNum>/jmxrmi
0N/A
0N/Awhere <hostName> is the hostname and <portNum> is the port number
0N/Ato which the JMX agent will be connected.
0N/A
0N/ATo run the demo
0N/A---------------
0N/A(1) Start the application with the JMX agent - here's an example of
0N/A how the Java2D is started
0N/A
0N/A java -Dcom.sun.management.jmxremote.port=1090
0N/A -Dcom.sun.management.jmxremote.ssl=false
0N/A -Dcom.sun.management.jmxremote.authenticate=false
0N/A -jar <JDK_HOME>/demo/jfc/Java2D/Java2Demo.jar
0N/A
0N/A This instruction uses the Sun's built-in support to enable a JMX agent
0N/A with a JMX service URL as described above.
0N/A You can programmatically start a JMX agent with the RMI connector
0N/A using javax.management.remote API. See the javadoc and examples for
0N/A javax.management.remote API for details.
0N/A
0N/A(2) Run JTop on a different machine:
0N/A
0N/A java -jar <JDK_HOME>/demo/management/JTop/JTop.jar <hostname>:1090
0N/A
0N/A where <hostname> is where the Java2Demo.jar runs in step (1).
0N/A
0N/AThese instructions assume that this installation's version of the java
0N/Acommand is in your path. If it isn't, then you should either
0N/Aspecify the complete path to the java command or update your
0N/APATH environment variable as described in the installation
0N/Ainstructions for the Java(TM) SDK.
0N/A
0N/AJTop JConsole Plugin
0N/A====================
0N/A
0N/AJTop is a JConsole Plugin which adds a "JTop" tab to JConsole.
0N/A
0N/ATo run JConsole with the JTop plugin
0N/A------------------------------------
0N/A jconsole -pluginpath <JDK_HOME>/demo/management/JTop/JTop.jar
0N/A
0N/A
0N/ATo compile
0N/A----------
0N/A javac -classpath <JDK_HOME>/lib/jconsole.jar JTopPlugin.java
0N/A
0N/Acom.sun.tools.jconsole API is in jconsole.jar which is needed
0N/Ain the classpath for compilation.