removing dependency ShellServer from Session

pull/1171/head
kylixs 5 years ago
parent cfddec4bed
commit dbed24a2f4

@ -1,6 +1,7 @@
package com.taobao.arthas.core.command.basic1000;
import com.taobao.arthas.core.advisor.Enhancer;
import com.taobao.arthas.core.server.ArthasBootstrap;
import com.taobao.arthas.core.shell.ShellServer;
import com.taobao.arthas.core.shell.command.AnnotatedCommand;
import com.taobao.arthas.core.shell.command.CommandProcess;
@ -39,7 +40,8 @@ public class ShutdownCommand extends AnnotatedCommand {
// ignore
} finally {
process.end();
ShellServer server = process.session().getServer();
//ShellServer server = process.session().getServer();
ShellServer server = ArthasBootstrap.getInstance().getShellServer();
server.close();
}
}

@ -357,4 +357,8 @@ public class ArthasBootstrap {
public TunnelClient getTunnelClient() {
return tunnelClient;
}
public ShellServer getShellServer() {
return shellServer;
}
}

@ -10,6 +10,7 @@ import java.util.List;
* A shell session.
*
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
* @author gongdewei 2020-03-23
*/
public interface Session {
String COMMAND_MANAGER = "arthas-command-manager";
@ -80,13 +81,6 @@ public interface Session {
*/
String getSessionId();
/**
* Get shell server
*
* @return shell server
*/
ShellServer getServer();
/**
* Get Java PID
*

@ -1,6 +1,5 @@
package com.taobao.arthas.core.shell.session.impl;
import com.taobao.arthas.core.shell.ShellServer;
import com.taobao.arthas.core.shell.command.CommandResolver;
import com.taobao.arthas.core.shell.session.Session;
import com.taobao.arthas.core.shell.system.impl.InternalCommandManager;
@ -69,11 +68,6 @@ public class SessionImpl implements Session {
return (String) data.get(ID);
}
@Override
public ShellServer getServer() {
return (ShellServer) data.get(SERVER);
}
@Override
public long getPid() {
return (Long) data.get(PID);

Loading…
Cancel
Save