<!DOCTYPE html>
<!-- [if IE 8]><html class="no - js lt - ie9" lang="en" > <![endif] -->
<!-- [if gt IE 8]><! --> < html class = "no-js" lang = "en" > <!-- <![endif] -->
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > jad — Arthas 3.0.5-SNAPSHOT documentation< / title >
< link rel = "shortcut icon" href = "_static/favicon.ico" / >
< link rel = "stylesheet" href = "_static/css/theme.css" type = "text/css" / >
< link rel = "stylesheet" href = "_static/pygments.css" type = "text/css" / >
< link rel = "stylesheet" href = "_static/overrides.css" type = "text/css" / >
< link rel = "index" title = "Index" href = "genindex.html" / >
< link rel = "search" title = "Search" href = "search.html" / >
< link rel = "next" title = "classloader" href = "classloader.html" / >
< link rel = "prev" title = "dump" href = "dump.html" / >
< script src = "_static/center_page.js" > < / script >
< script src = "_static/js/modernizr.min.js" > < / script >
< / head >
< body class = "wy-body-for-nav" >
< div class = "wy-grid-for-nav" >
< nav data-toggle = "wy-nav-shift" class = "wy-nav-side" >
< div class = "wy-side-scroll" >
< div class = "wy-side-nav-search" >
< a href = "index.html" class = "icon icon-home" > Arthas
< / a >
< div class = "version" >
3.0.5-SNAPSHOT
< / div >
< div role = "search" >
< form id = "rtd-search-form" class = "wy-form" action = "search.html" method = "get" >
< input type = "text" name = "q" placeholder = "Search docs" / >
< input type = "hidden" name = "check_keywords" value = "yes" / >
< input type = "hidden" name = "area" value = "default" / >
< / form >
< / div >
< / div >
< div class = "wy-menu wy-menu-vertical" data-spy = "affix" role = "navigation" aria-label = "main navigation" >
< ul class = "current" >
< li class = "toctree-l1" > < a class = "reference internal" href = "install-detail.html" > Installation< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "quick-start.html" > Quick start< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "advanced-use.html" > Advanced usage< / a > < / li >
< li class = "toctree-l1 current" > < a class = "reference internal" href = "commands.html" > Commands< / a > < ul class = "current" >
< li class = "toctree-l2" > < a class = "reference internal" href = "dashboard.html" > dashboard< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "thread.html" > thread< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "jvm.html" > jvm< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "sysprop.html" > sysprop< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "getstatic.html" > getstatic< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "sc.html" > sc< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "sm.html" > sm< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "dump.html" > dump< / a > < / li >
< li class = "toctree-l2 current" > < a class = "current reference internal" href = "#" > jad< / a > < ul >
< li class = "toctree-l3" > < a class = "reference internal" href = "#options" > Options< / a > < / li >
< li class = "toctree-l3" > < a class = "reference internal" href = "#usage" > Usage< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "classloader.html" > classloader< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "redefine.html" > redefine< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "monitor.html" > monitor< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "watch.html" > watch< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "trace.html" > trace< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "stack.html" > stack< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "tt.html" > tt< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "options.html" > options< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "commands.html#basic-commands" > Basic Commands< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l1" > < a class = "reference external" href = "https://github.com/alibaba/arthas/issues?q=label%3Auser-case" > User cases< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "release-notes.html" > Release Notes< / a > < / li >
< li class = "toctree-l1" > < a class = "reference external" href = "https://github.com/alibaba/arthas/issues?q=label%3Aquestion-answered" > Questions and answers< / a > < / li >
< li class = "toctree-l1" > < a class = "reference external" href = "https://github.com/alibaba/arthas" > Fork me at GitHub< / a > < / li >
< li class = "toctree-l1" > < a class = "reference external" href = "https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md" > CONTRIBUTING< / a > < / li >
< / ul >
< / div >
< / div >
< / nav >
< section data-toggle = "wy-nav-shift" class = "wy-nav-content-wrap" >
< nav class = "wy-nav-top" aria-label = "top navigation" >
< i data-toggle = "wy-nav-top" class = "fa fa-bars" > < / i >
< a href = "index.html" > Arthas< / a >
< / nav >
< div class = "wy-nav-content" >
< div class = "rst-content" >
< div role = "navigation" aria-label = "breadcrumbs navigation" >
< ul class = "wy-breadcrumbs" >
< li > < a href = "index.html" > Docs< / a > » < / li >
< li > < a href = "commands.html" > All Commands< / a > » < / li >
< li > jad< / li >
< li class = "wy-breadcrumbs-aside" >
< a href = "https://github.com/alibaba/arthas/blob/master/site/src/site/sphinx/en/jad.md" class = "fa fa-github" > Edit on GitHub< / a >
< / li >
< / ul >
< hr / >
< / div >
< div role = "main" class = "document" itemscope = "itemscope" itemtype = "http://schema.org/Article" >
< div itemprop = "articleBody" >
< div class = "section" id = "jad" >
< span id = "jad" > < / span > < h1 > jad< a class = "headerlink" href = "#jad" title = "Permalink to this headline" > ¶< / a > < / h1 >
< p > De-compile specified loaded classes.< / p >
< p > < code class = "docutils literal notranslate" > < span class = "pre" > jad< / span > < / code > helps to < em > de-compile< / em > the byte code in JVM to the source code to assist you to better understand the logic behind.< / p >
< p > F.Y.I< / p >
< ul class = "simple" >
< li > the de-compiled code will be grammatically highlighted for readability in Arthas console;< / li >
< li > there might be some trivial grammar errors but it won’ t affect the logic understanding.< / li >
< / ul >
< div class = "section" id = "options" >
< span id = "options" > < / span > < h2 > Options< a class = "headerlink" href = "#options" title = "Permalink to this headline" > ¶< / a > < / h2 >
< table border = "1" class = "docutils" >
< thead >
< tr >
< th align = "right" > Name< / th >
< th align = "left" > Specification< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td align = "right" > < em > class-pattern< / em > < / td >
< td align = "left" > pattern for the class name< / td >
< / tr >
< tr >
< td align = "right" > [c:]< / td >
< td align = "left" > hashcode of the class loader that loaded the class< / td >
< / tr >
< tr >
< td align = "right" > [E]< / td >
< td align = "left" > turn on regex matching while the default is wildcard matching< / td >
< / tr >
< / tbody >
< / table > < / div >
< div class = "section" id = "usage" >
< span id = "usage" > < / span > < h2 > Usage< a class = "headerlink" href = "#usage" title = "Permalink to this headline" > ¶< / a > < / h2 >
< p > When several class loaders loaded the same class:< / p >
< ol class = "simple" >
< li > < code class = "docutils literal notranslate" > < span class = "pre" > jad< / span > < / code > to get the hashcode of the class loader;< / li >
< li > < code class = "docutils literal notranslate" > < span class = "pre" > jad< / span > < span class = "pre" > -c< / span > < span class = "pre" > < hashcode> < / span > < / code > to get the de-compiled class loaded by the specified class loader.< / li >
< / ol >
< div class = "highlight-java notranslate" > < div class = "highlight" > < pre > < span > < / span > $ jad org.apache.log4j.Logger
Found more than one class for: org.apache.log4j.Logger, Please use jad -c hashcode org.apache.log4j.Logger
HASHCODE CLASSLOADER
69dcaba4 +-monitor' s ModuleClassLoader
6e51ad67 +-java.net.URLClassLoader@6e51ad67
+-sun.misc.Launcher$AppClassLoader@6951a712
+-sun.misc.Launcher$ExtClassLoader@6fafc4c2
2bdd9114 +-pandora-qos-service' s ModuleClassLoader
4c0df5f8 +-pandora-framework' s ModuleClassLoader
Affect(row-cnt:0) cost in 38 ms.
$ jad org.apache.log4j.Logger -c 69dcaba4
ClassLoader:
+-monitor' s ModuleClassLoader
Location:
/Users/zhuyong/Downloads/taobao-hsf.sar/plugins/monitor/lib/log4j-1.2.14.jar
package org.apache.log4j;
import org.apache.log4j.spi.*;
public class Logger extends Category
{
private static final String FQCN;
protected Logger(String name)
{
super(name);
}
public static Logger getLogger(String name)
{
return LogManager.getLogger(name);
}
public static Logger getLogger(Class clazz)
{
return LogManager.getLogger(clazz.getName());
}
public static Logger getRootLogger()
{
return LogManager.getRootLogger();
}
public static Logger getLogger(String name, LoggerFactory factory)
{
return LogManager.getLogger(name, factory);
}
public void trace(Object message)
{
if (repository.isDisabled(5000))
{
return;
}
if (Level.TRACE.isGreaterOrEqual(getEffectiveLevel()))
{
forcedLog(Logger.FQCN, Level.TRACE, message, null);
}
}
public void trace(Object message, Throwable t)
{
if (repository.isDisabled(5000))
{
return;
}
if (Level.TRACE.isGreaterOrEqual(getEffectiveLevel()))
{
forcedLog(Logger.FQCN, Level.TRACE, message, t);
}
}
public boolean isTraceEnabled()
{
if (repository.isDisabled(5000))
{
return false;
}
return Level.TRACE.isGreaterOrEqual(getEffectiveLevel());
}
static
{
Logger.FQCN = Logger.class.getName();
}
}
Affect(row-cnt:1) cost in 190 ms.
< / pre > < / div >
< / div >
< p > De-compile the specified method:< / p >
< div class = "highlight-sh notranslate" > < div class = "highlight" > < pre > < span > < / span > $ jad com.taobao.container.web.arthas.rest.MetricsController directMetrics
ClassLoader:
+-com.taobao.pandora.boot.loader.ReLaunchURLClassLoader@1817d444
+-sun.misc.Launcher< span class = "nv" > $AppClassLoader< / span > @14dad5dc
+-sun.misc.Launcher< span class = "nv" > $ExtClassLoader< / span > @a38d7a3
Location:
/Users/zhuyong/middleware/tomcat-web/tomcat-web-web/target/classes/
private Map< String, Object> directMetrics< span class = "o" > (< / span > String ip, String< span class = "o" > []< / span > metrics< span class = "o" > )< / span > < span class = "o" > {< / span >
JSONObject obj< span class = "p" > ;< / span >
HashMap< String, Object> < span class = "nv" > result< / span > < span class = "o" > =< / span > new HashMap< String, Object> < span class = "o" > ()< / span > < span class = "p" > ;< / span >
result.put< span class = "o" > (< / span > < span class = "s2" > " success" < / span > , < span class = "nb" > false< / span > < span class = "o" > )< / span > < span class = "p" > ;< / span >
String < span class = "nv" > metricUrl< / span > < span class = "o" > =< / span > < span class = "s2" > " http://" < / span > + ip + < span class = "s2" > " :8006/metrics/specific" < / span > < span class = "p" > ;< / span >
String < span class = "nv" > postBody< / span > < span class = "o" > =< / span > Arrays.stream< span class = "o" > (< / span > metrics< span class = "o" > )< / span > .map< span class = "o" > (< / span > metric -> < span class = "s2" > " metric=" < / span > + metric< span class = "o" > )< / span > .collect< span class = "o" > (< / span > Collectors.joining< span class = "o" > (< / span > < span class = "s2" > " & " < / span > < span class = "o" > ))< / span > < span class = "p" > ;< / span >
HttpClientUtils.Response < span class = "nv" > resp< / span > < span class = "o" > =< / span > HttpClientUtils.sendPostRequest< span class = "o" > ((< / span > String< span class = "o" > )< / span > metricUrl, < span class = "o" > (< / span > String< span class = "o" > )< / span > postBody< span class = "o" > )< / span > < span class = "p" > ;< / span >
< span class = "k" > if< / span > < span class = "o" > (< / span > resp.isSuccess< span class = "o" > ()< / span > < span class = "o" > & & < / span > < span class = "o" > (< / span > < span class = "nv" > obj< / span > < span class = "o" > =< / span > JSON.parseObject< span class = "o" > (< / span > resp.getContent< span class = "o" > ()))< / span > .containsKey< span class = "o" > (< / span > < span class = "s2" > " success" < / span > < span class = "o" > )< / span > < span class = "o" > & & < / span > obj.getBoolean< span class = "o" > (< / span > < span class = "s2" > " success" < / span > < span class = "o" > )< / span > .booleanValue< span class = "o" > ()< / span > < span class = "o" > & & < / span > obj.containsKey< span class = "o" > (< / span > < span class = "s2" > " data" < / span > < span class = "o" > ))< / span > < span class = "o" > {< / span >
JSONArray < span class = "nv" > dataArray< / span > < span class = "o" > =< / span > obj.getJSONArray< span class = "o" > (< / span > < span class = "s2" > " data" < / span > < span class = "o" > )< / span > < span class = "p" > ;< / span >
HashMap< String, Object> < span class = "nv" > metricMap< / span > < span class = "o" > =< / span > new HashMap< String, Object> < span class = "o" > ()< / span > < span class = "p" > ;< / span >
< span class = "k" > for< / span > < span class = "o" > (< / span > Object aDataArray : dataArray< span class = "o" > )< / span > < span class = "o" > {< / span >
JSONObject < span class = "nv" > o< / span > < span class = "o" > =< / span > < span class = "o" > (< / span > JSONObject< span class = "o" > )< / span > aDataArray< span class = "p" > ;< / span >
metricMap.put< span class = "o" > (< / span > o.getString< span class = "o" > (< / span > < span class = "s2" > " metric" < / span > < span class = "o" > )< / span > , o.get< span class = "o" > (< / span > < span class = "s2" > " value" < / span > < span class = "o" > ))< / span > < span class = "p" > ;< / span >
< span class = "o" > }< / span >
result.put< span class = "o" > (< / span > < span class = "s2" > " data" < / span > , metricMap< span class = "o" > )< / span > < span class = "p" > ;< / span >
result.put< span class = "o" > (< / span > < span class = "s2" > " success" < / span > , < span class = "nb" > true< / span > < span class = "o" > )< / span > < span class = "p" > ;< / span >
< span class = "k" > return< / span > result< span class = "p" > ;< / span >
< span class = "o" > }< / span >
< span class = "k" > return< / span > result< span class = "p" > ;< / span >
< span class = "o" > }< / span >
Affect< span class = "o" > (< / span > row-cnt:1< span class = "o" > )< / span > cost in < span class = "m" > 1508< / span > ms.
< / pre > < / div >
< / div >
< p > F.Y.I< / p >
< p > Inner class is not yet supported, you can just check the < em > outer< / em > class to further check the inner class.< / p >
< / div >
< / div >
< / div >
< / div >
< footer >
< div class = "rst-footer-buttons" role = "navigation" aria-label = "footer navigation" >
< a href = "classloader.html" class = "btn btn-neutral float-right" title = "classloader" accesskey = "n" rel = "next" > Next < span class = "fa fa-arrow-circle-right" > < / span > < / a >
< a href = "dump.html" class = "btn btn-neutral" title = "dump" accesskey = "p" rel = "prev" > < span class = "fa fa-arrow-circle-left" > < / span > Previous< / a >
< / div >
< hr / >
< div role = "contentinfo" >
< p >
© Copyright 2018, Alibaba Middleware Group, and contributors.
< / p >
< / div >
Built with < a href = "http://sphinx-doc.org/" > Sphinx< / a > using a < a href = "https://github.com/rtfd/sphinx_rtd_theme" > theme< / a > provided by < a href = "https://readthedocs.org" > Read the Docs< / a > .
< / footer >
< / div >
< / div >
< / section >
< / div >
< script type = "text/javascript" >
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'3.0.5-SNAPSHOT',
LANGUAGE:'en',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
< / script >
< script type = "text/javascript" src = "_static/jquery.js" > < / script >
< script type = "text/javascript" src = "_static/underscore.js" > < / script >
< script type = "text/javascript" src = "_static/doctools.js" > < / script >
< script type = "text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" > < / script >
< script type = "text/javascript" src = "_static/js/theme.js" > < / script >
< script type = "text/javascript" >
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
< / script >
< div class = "github-fork-ribbon-wrapper right" >
< div class = "github-fork-ribbon" >
< a href = "https://github.com/alibaba/arthas" > Fork me at GitHub< / a >
< / div >
< / div >
< script type = "text/javascript" src = "_static/add_badges.js" > < / script >
< script >
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
< / script >
< / body >
< / html >