mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
clean code
This commit is contained in:
@@ -23,7 +23,6 @@ public class AgentBootstrap {
|
||||
private static final String ARTHAS_BOOTSTRAP = "com.taobao.arthas.core.server.ArthasBootstrap";
|
||||
private static final String GET_INSTANCE = "getInstance";
|
||||
private static final String IS_BIND = "isBind";
|
||||
private static final String BIND = "bind";
|
||||
|
||||
private static PrintStream ps = System.err;
|
||||
static {
|
||||
@@ -187,15 +186,9 @@ public class AgentBootstrap {
|
||||
Object bootstrap = bootstrapClass.getMethod(GET_INSTANCE, Instrumentation.class, String.class).invoke(null, inst, args);
|
||||
boolean isBind = (Boolean) bootstrapClass.getMethod(IS_BIND).invoke(bootstrap);
|
||||
if (!isBind) {
|
||||
try {
|
||||
ps.println("Arthas start to bind...");
|
||||
bootstrapClass.getMethod(BIND, String.class).invoke(bootstrap, args);
|
||||
ps.println("Arthas server bind success.");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
ps.println("Arthas server port binding failed! Please check $HOME/logs/arthas/arthas.log for more details.");
|
||||
throw e;
|
||||
}
|
||||
String errorMsg = "Arthas server port binding failed! Please check $HOME/logs/arthas/arthas.log for more details.";
|
||||
ps.println(errorMsg);
|
||||
throw new RuntimeException(errorMsg);
|
||||
}
|
||||
ps.println("Arthas server already bind.");
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class ArthasBootstrap {
|
||||
* @param configure 配置信息
|
||||
* @throws IOException 服务器启动失败
|
||||
*/
|
||||
public void bind(Configure configure) throws Throwable {
|
||||
private void bind(Configure configure) throws Throwable {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user