You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/assets/advice-class.html.349d22fb.js

17 lines
6.1 KiB
JavaScript

3 years ago
import{_ as s,o as l,c as o,a as e,b as a,d as r,e as t,r as i}from"./app.391b0e4e.js";const c={},d=r(`<h1 id="fundamental-fields-in-expressions" tabindex="-1"><a class="header-anchor" href="#fundamental-fields-in-expressions" aria-hidden="true">#</a> Fundamental Fields in Expressions</h1><p>There is a very fundamental class <code>Advice</code> for the expressions used in filtering, tracing or monitoring and other aspects in commands.</p><div class="language-java ext-java line-numbers-mode"><pre class="language-java"><code><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Advice</span> <span class="token punctuation">{</span>
3 years ago
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">ClassLoader</span> loader<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">Class</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token operator">?</span><span class="token punctuation">&gt;</span></span> clazz<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">ArthasMethod</span> method<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">Object</span> target<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">Object</span><span class="token punctuation">[</span><span class="token punctuation">]</span> params<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">Object</span> returnObj<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">Throwable</span> throwExp<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token keyword">boolean</span> isBefore<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token keyword">boolean</span> isThrow<span class="token punctuation">;</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token keyword">boolean</span> isReturn<span class="token punctuation">;</span>
<span class="token comment">// getter/setter</span>
<span class="token punctuation">}</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Description for the variables in the class <code>Advice</code>:</p><table><thead><tr><th style="text-align:right;">Name</th><th style="text-align:left;">Specification</th></tr></thead><tbody><tr><td style="text-align:right;">loader</td><td style="text-align:left;">the class loader for the current called class</td></tr><tr><td style="text-align:right;">clazz</td><td style="text-align:left;">the reference to the current called class</td></tr><tr><td style="text-align:right;">method</td><td style="text-align:left;">the reference to the current called method</td></tr><tr><td style="text-align:right;">target</td><td style="text-align:left;">the instance of the current called class</td></tr><tr><td style="text-align:right;">params</td><td style="text-align:left;">the parameters for the current call, which is an array (when there&#39;s no parameter, it will be an empty array)</td></tr><tr><td style="text-align:right;">returnObj</td><td style="text-align:left;">the return value from the current call - only available when the method call returns normally (<code>isReturn==true</code>), and <code>null</code> is for <code>void</code> return value</td></tr><tr><td style="text-align:right;">throwExp</td><td style="text-align:left;">the exceptions thrown from the current call - only available when the method call throws exception (<code>isThrow==true</code>)</td></tr><tr><td style="text-align:right;">isBefore</td><td style="text-align:left;">flag to indicate the method is about to execute. <code>isBefore==true</code> but <code>isThrow==false</code> and <code>isReturn==false</code> since it&#39;s no way to know how the method call will end</td></tr><tr><td style="text-align:right;">isThrow</td><td style="text-align:left;">flag to indicate the method call ends with exception thrown</td></tr><tr><td style="text-align:right;">isReturn</td><td style="text-align:left;">flag to indicate the method call ends normally without exception thrown</td></tr></tbody></table>`,5),p=t("All variables listed above can be used directly in the "),h={href:"https://commons.apache.org/proper/commons-ognl/language-guide.html",target:"_blank",rel:"noopener noreferrer"},u=t("OGNL expression"),k=t(". The command will not execute and exit if there's illegal OGNL grammar or unexpected variable in the expression."),m={href:"https://github.com/alibaba/arthas/issues/71",target:"_blank",rel:"noopener noreferrer"},g=t("typical use cases"),v=t(";"),f={href:"https://commons.apache.org/proper/commons-ognl/language-guide.html",target:"_blank",rel:"noopener noreferrer"},y=t("OGNL language guide"),b=t(".");function w(x,_){const n=i("ExternalLinkIcon");return l(),o("div",null,[d,e("p",null,[p,e("a",h,[u,a(n)]),k]),e("ul",null,[e("li",null,[e("a",m,[g,a(n)]),v]),e("li",null,[e("a",f,[y,a(n)]),b])])])}var N=s(c,[["render",w],["__file","advice-class.html.vue"]]);export{N as default};