update doc

pull/483/head
hengyunabc 6 years ago
parent 72e97ebc10
commit 9a7cef6f87

@ -59,8 +59,7 @@ $ java -jar arthas-boot.jar -h
## 离线帮助文档
最新版本,点击下载:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=doc&v=LATEST)
最新版本,点击下载:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip)
## 卸载

@ -21,4 +21,35 @@ redefine
```
redefine -p /tmp/Test.class
redefine -c 327a647b -p /tmp/Test.class /tmp/Test\$Inner.class
```
### redefine的限制
* 不允许新增加field/method
* 正在跑的函数,没有退出不能生效,比如下面新增加的`System.out.println`,只有`run()`函数里的会生效
```java
public class MathGame {
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
while (true) {
game.run();
TimeUnit.SECONDS.sleep(1);
// 这个不生效,因为代码一直跑在 while里
System.out.println("in loop");
}
}
public void run() throws InterruptedException {
// 这个生效因为run()函数每次都可以完整结束
System.out.println("call run()");
try {
int number = random.nextInt();
List<Integer> primeFactors = primeFactors(number);
print(number, primeFactors);
} catch (Exception e) {
System.out.println(String.format("illegalArgumentCount:%3d, ", illegalArgumentCount) + e.getMessage());
}
}
```

@ -56,7 +56,7 @@ $ java -jar arthas-boot.jar -h
## Offline Help Documentation
Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.taobao.arthas&a=arthas-packaging&e=zip&c=doc&v=LATEST)
Latest Version, Click To Download:[![Arthas](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square "Arthas")](https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip)
## Uninstall

@ -21,3 +21,34 @@ Reference: [Instrumentation#redefineClasses](https://docs.oracle.com/javase/8/do
redefine -p /tmp/Test.class
redefine -c 327a647b -p /tmp/Test.class /tmp/Test$Inner.class
```
### Restrictions of the redefine command
* New field/method is not allowed
* The function that is running, no exit can not take effect, such as the new `System.out.println` added below, only the `run()` function will take effect.
```java
public class MathGame {
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
while (true) {
game.run();
TimeUnit.SECONDS.sleep(1);
// This doesn't work because the code keeps running in while
System.out.println("in loop");
}
}
public void run() throws InterruptedException {
// This works because the run() function ends completely every time
System.out.println("call run()");
try {
int number = random.nextInt();
List<Integer> primeFactors = primeFactors(number);
print(number, primeFactors);
} catch (Exception e) {
System.out.println(String.format("illegalArgumentCount:%3d, ", illegalArgumentCount) + e.getMessage());
}
}
```

@ -220,7 +220,7 @@ $ java -jar arthas-boot.jar
</div>
<div class="section" id="offline-help-documentation">
<span id="offline-help-documentation"></span><h2>Offline Help Documentation<a class="headerlink" href="#offline-help-documentation" title="Permalink to this headline"></a></h2>
<p>Latest Version, Click To Download:<a class="reference external" href="http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&amp;g=com.taobao.arthas&amp;a=arthas-packaging&amp;e=zip&amp;c=doc&amp;v=LATEST"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>Latest Version, Click To Download:<a class="reference external" href="https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
<div class="section" id="uninstall">
<span id="uninstall"></span><h2>Uninstall<a class="headerlink" href="#uninstall" title="Permalink to this headline"></a></h2>

@ -109,6 +109,7 @@
<li class="toctree-l2 current"><a class="current reference internal" href="#">redefine</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>
<li class="toctree-l3"><a class="reference internal" href="#restrictions-of-the-redefine-command">Restrictions of the redefine command</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">monitor</a></li>
@ -226,6 +227,42 @@
redefine -c 327a647b -p /tmp/Test.class /tmp/Test$Inner.class</pre>
</div>
</div>
<div class="section" id="restrictions-of-the-redefine-command">
<span id="restrictions-of-the-redefine-command"></span><h2>Restrictions of the redefine command<a class="headerlink" href="#restrictions-of-the-redefine-command" title="Permalink to this headline"></a></h2>
<ul>
<li><p class="first">New field/method is not allowed</p>
</li>
<li><p class="first">The function that is running, no exit can not take effect, such as the new <tt class="docutils literal">System.out.println</tt> added below, only the <tt class="docutils literal">run()</tt> function will take effect.</p>
<div class="highlight-java notranslate"><div class="highlight hljs"><pre class="java">public class MathGame {
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
while (true) {
game.run();
TimeUnit.SECONDS.sleep(1);
// This doesn&#x27;t work because the code keeps running in while
System.out.println(&quot;in loop&quot;);
}
}
public void run() throws InterruptedException {
// This works because the run() function ends completely every time
System.out.println(&quot;call run()&quot;);
try {
int number = random.nextInt();
List&lt;Integer&gt; primeFactors = primeFactors(number);
print(number, primeFactors);
} catch (Exception e) {
System.out.println(String.format(&quot;illegalArgumentCount:%3d, &quot;, illegalArgumentCount) + e.getMessage());
}
}
</pre></div>
</div>
</li>
</ul>
<div class="highlight-default notranslate"><pre class="literal-block"></pre>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long

@ -228,7 +228,7 @@ $ java -jar arthas-boot.jar
</div>
<div class="section" id="">
<span id="id4"></span><h2>离线帮助文档<a class="headerlink" href="#" title="永久链接至标题"></a></h2>
<p>最新版本,点击下载:<a class="reference external" href="http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&amp;g=com.taobao.arthas&amp;a=arthas-packaging&amp;e=zip&amp;c=doc&amp;v=LATEST"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
<p>最新版本,点击下载:<a class="reference external" href="https://github.com/alibaba/arthas/releases/download/arthas-all-3.0.5/arthas-3.0.5-doc.zip"><img alt="Arthas" src="https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg?style=flat-square" /></a></p>
</div>
<div class="section" id="">
<span id="id5"></span><h2>卸载<a class="headerlink" href="#" title="永久链接至标题"></a></h2>

@ -110,6 +110,7 @@
<li class="toctree-l2 current"><a class="current reference internal" href="#">redefine</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#">参数说明</a></li>
<li class="toctree-l3"><a class="reference internal" href="#">使用参考</a></li>
<li class="toctree-l3"><a class="reference internal" href="#redefine">redefine的限制</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">monitor</a></li>
@ -228,6 +229,42 @@
redefine -c 327a647b -p /tmp/Test.class /tmp/Test\$Inner.class</pre>
</div>
</div>
<div class="section" id="redefine">
<span id="id3"></span><h2>redefine的限制<a class="headerlink" href="#redefine" title="永久链接至标题"></a></h2>
<ul>
<li><p class="first">不允许新增加field/method</p>
</li>
<li><p class="first">正在跑的函数,没有退出不能生效,比如下面新增加的<tt class="docutils literal">System.out.println</tt>,只有<tt class="docutils literal">run()</tt>函数里的会生效</p>
<div class="highlight-java notranslate"><div class="highlight hljs"><pre class="java">public class MathGame {
public static void main(String[] args) throws InterruptedException {
MathGame game = new MathGame();
while (true) {
game.run();
TimeUnit.SECONDS.sleep(1);
// 这个不生效,因为代码一直跑在 while里
System.out.println(&quot;in loop&quot;);
}
}
public void run() throws InterruptedException {
// 这个生效因为run()函数每次都可以完整结束
System.out.println(&quot;call run()&quot;);
try {
int number = random.nextInt();
List&lt;Integer&gt; primeFactors = primeFactors(number);
print(number, primeFactors);
} catch (Exception e) {
System.out.println(String.format(&quot;illegalArgumentCount:%3d, &quot;, illegalArgumentCount) + e.getMessage());
}
}
</pre></div>
</div>
</li>
</ul>
<div class="highlight-default notranslate"><pre class="literal-block"></pre>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save