Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. 修复ptrace命令'#cost'条件不准确的情况
- Loading branch information
oldmanpushcart@gmail.com
committed
Nov 7, 2016
1 parent
8c33e40
commit 00e1dd3
Showing
4 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
agent/src/main/java/com/github/ompc/greys/agent/AgentClassLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.github.ompc.greys.agent; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
import java.net.URLClassLoader; | ||
|
||
/** | ||
* Agent ClassLoader | ||
* Created by vlinux on 2016/11/7. | ||
*/ | ||
public class AgentClassLoader extends URLClassLoader { | ||
|
||
|
||
public AgentClassLoader(final String agentJar) throws MalformedURLException { | ||
super(new URL[]{new URL("file:" + agentJar)}); | ||
} | ||
|
||
@Override | ||
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { | ||
final Class<?> loadedClass = findLoadedClass(name); | ||
if (loadedClass != null) { | ||
return loadedClass; | ||
} | ||
|
||
try { | ||
Class<?> aClass = findClass(name); | ||
if (resolve) { | ||
resolveClass(aClass); | ||
} | ||
return aClass; | ||
} catch (Exception e) { | ||
return super.loadClass(name, resolve); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.7.6.3 | ||
1.7.6.4 |