Add remote host name to ssh tunnel config, so that it can
be used to compute correct request mapping links for live
hovers.
This commit is contained in:
Kris De Volder
2018-08-07 10:04:21 -07:00
parent 64e7bbad45
commit 243586a8f8
8 changed files with 175 additions and 32 deletions

View File

@@ -21,9 +21,16 @@ import org.springframework.ide.vscode.commons.util.MemoizingProxy;
public class RemoteSpringBootApp extends AbstractSpringBootApp {
private String jmxUrl;
private String host = null;
private String port = "80";
protected RemoteSpringBootApp(String jmxUrl) {
protected RemoteSpringBootApp(String jmxUrl, String host) {
this.jmxUrl = jmxUrl;
this.host = host;
}
public void setHost(String host) {
this.host = host;
}
@Override
@@ -31,6 +38,19 @@ public class RemoteSpringBootApp extends AbstractSpringBootApp {
return jmxUrl;
}
@Override
public String getPort() throws Exception {
return port!=null ? port : super.getPort();
}
@Override
public String getHost() throws Exception {
if (host!=null) {
return host;
}
return super.getHost();
}
@Override
public Properties getSystemProperties() throws Exception {
return withPlatformMxBean(RuntimeMXBean.class, runtime -> {
@@ -78,8 +98,8 @@ public class RemoteSpringBootApp extends AbstractSpringBootApp {
return "Unknown";
}
public static SpringBootApp create(String jmxUrl) {
return MemoizingProxy.create(RemoteSpringBootApp.class, Duration.ofMillis(4900), jmxUrl);
public static SpringBootApp create(String jmxUrl, String host) {
return MemoizingProxy.create(RemoteSpringBootApp.class, Duration.ofMillis(4900), jmxUrl, host);
}
}